Made by Rahuletto#0243
This template powers our system at Simply API
This branch is for javascript. Go to typescript branch if you need the typescript project
(This is a much complex system to work with !)
- Provide your chatbot's details in the
.env.example
file - Change the input as you like in
index.js
- Run the project and you are ready to go
- Train your AI in the
corpus.json
file - Run javascript/dynamic response using
pipelines.md
for specific intent (type) - DO NOT edit the
conf.json
file !! - Use the response anywhere ! You can make an API or use in your application
- NLP (Natural Language Processing) is an CPU and RAM intensive system.
- Training the ML model is the most computationally intensive task
- DO NOT run this project on a potato !
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',
'I hope to pass the tests. Feel free to test me often'
);
await manager.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)
"I hope to pass your tests. Feel free to test me often",
"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
- the
doubt.qna
is the type of input - the
utterances
are the inputs to define its type
you need to dynamically respond via pipelines.md
# onIntent(doubt.qna)
// compiler=javascript
{ The JS code }
where
- the
doubt.qna
is the type of input - the
{ The JS code }
is your Javascript code for dynamic response