An open source, friendly human-like chatbot to be with you, forever
CC-BY-4.0 License
(This is a much complex system to work with !)
.env.example
fileindex.js
corpus.json
filepipelines.md
for specific intent (type)conf.json
file !!It is your job to train the AI. The more you train, the more smarter it gets.
You can train the ai in two ways
Using the nlpjs module, you can train the system with functions
You can get the manager from the train(nlp)
function in index.js
// ------------------------------------
// These should be in a async function !
// ------------------------------------
// Training the input-type relation (user.testing is the type here)
manager.addDocument(
'en',
'im testing you',
'user.testing'
);
// Response for the type of the input (user.testing is the type here)
manager.addAnswer(
'en',
'user.testing',
'Ihopetopassthetests.Feelfreetotestmeoften'
);
awaitmanager.train();
You can directly edit the corpus.json
to train it. (Prone to more errors)
Template
{
"intent": "user.testing", // Initializing the type
"utterances": [ // Training the input-type relation (user.testing is the type here)
"im testing you",
"thats a test"
],
"answers": [ // Array of Response for the type of the input (user.testing is the type here)
"Ihopetopassyourtests.Feelfreetotestmeoften",
"Test me often.",
]
}
You need to send a dynamic URL for a specific type of input. But how ?
Its via using pipelines.md
!
Template
you need to train the input-type relation in corpus.json
{
"intent": "doubt.qna",
"utterances": [
"What is wikipedia",
"What is Ferrari",
"What is an atom",
"What is curtain",
"What is github"
]
}
where
doubt.qna
is the type of inpututterances
are the inputs to define its typeyou need to dynamically respond via pipelines.md
# onIntent(doubt.qna)
// compiler=javascript
{ The JS code }
where
doubt.qna
is the type of input{ The JS code }
is your Javascript code for dynamic response