Need some help.
I have the following json content in a file and would like to use langchain.js and gpt to parse , store and answer question such as
for example:
"find me jobs with 2 year experience" ==> should return a list
"I have knowledge in javascript find me jobs" ==> should return the jobs pbject
I use langchain json loader and I see the file is parse but it say that it find 13 docs . There is only be 3 docs in file . Is the json structure not correct?
Here is snippet of my parse code
const loader = new DirectoryLoader(docPath, {
".json": (path) => new JSONLoader(path),
});
const docs = await loader.load();
console.log(docs);
console.log(docs.length);
Here is my input data
[
{
"jobid":"job1",
"title":"software engineer"
"skills":"java,javascript",
"description":"this job requires a associate degrees in CS and 2 years experience"
},
{
"jobid":"job2",
"skills":"math, accounting, spreadsheet",
"description":"this job requires a degrees in accounting and 2 years experience"
},
{
"jobid":"job3",
"title":"programmer"
"skills":"java,javascript,cloud computing",
"description":"this job requires a ,master degrees in CS and 3 years experience"
}
]
OUTPUT
[
Document {
pageContent: 'job1',
metadata: {
source: 'langchain-document-loaders-in-node-js/documents/jobs.json',
line: 1
}
},
Document {
pageContent: 'software engineer',
metadata: {
source: 'langchain-document-loaders-in-node-js/documents/jobs.json',
line: 2
}
},
Document {
pageContent: 'java,javascript',
metadata: {
source: 'langchain-document-loaders-in-node-js/documents/jobs.json',
line: 3
}
},
Document {
pageContent: 'this job requires a associate degrees in CS and 2 years experience',
metadata: {
source: 'langchain-document-loaders-in-node-js/documents/jobs.json',
line: 4
}
},
Document {
pageContent: 'job2',
metadata: {
source: 'langchain-document-loaders-in-node-js/documents/jobs.json',
line: 5
}
},
...