How to do chat bot?
See original GitHub issueWhy it didn’t work? I tried set sents in [], same problem Can anyone show example how make simple chat bot?
var brain = require('brain.js');
var net = new brain.recurrent.LSTM();
net.train([
{input: "hello", output: "Hi!"},
{input: "How are you?", output: "Super!"},
{input: "Where are you?", output: "Next to you"}
], { log: true });
console.log(net.run("Hello!"));
Sometimes it crash with errors like
Error: unrecognized character “Hello!” at DataFormatter.toIndexes (/home/node/neural/node_modules/brain.js/dist/utilities/data-formatter.js:85:17) at DataFormatter.toIndexesInputOutput (/home/node/neural/node_modules/brain.js/dist/utilities/data-formatter.js:103:23) at LSTM.formatDataIn (/home/node/neural/node_modules/brain.js/dist/recurrent/rnn.js:769:35) at LSTM.run (/home/node/neural/node_modules/brain.js/dist/recurrent/rnn.js:381:24) at Object.<anonymous> (/home/node/neural/index.js:9:17) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3)
Sorry for my bad English
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (8 by maintainers)
Top GitHub Comments
We really need to handle the case of a generic non-understood value so that the net can essentially just skip that value.
Anybody want to review?: https://github.com/BrainJS/brain.js/pull/241