Answer the question
In order to leave comments, you need to log in
How to determine intentions using a neural network?
How to determine intentions using a neural network?
Found a library
I will give an example.
import * as brain from 'brain.js';
const trainingData = [
{ input: 'Конечно', output: 'одобрение' },
{ input: 'Определённо', output: 'одобрение' },
{ input: 'Хорошо', output: 'одобрение' },
{ input: 'Согласен', output: 'одобрение' },
{ input: 'Далее', output: 'одобрение' },
{ input: 'Идём', output: 'одобрение' },
{ input: 'Правильно', output: 'одобрение' },
{ input: 'Угу', output: 'одобрение' },
{ input: 'Одобряю', output: 'одобрение' },
{ input: 'Ладно', output: 'одобрение' },
{ input: 'Пусть', output: 'одобрение' },
{ input: '+', output: 'одобрение' },
{ input: 'Ага', output: 'одобрение' }
];
const lstm = new brain.recurrent.LSTM();
lstm.train(trainingData, {
iterations: 1500,
log: (details) => console.log(details),
errorThresh: 0.011
});
export function assert (input: string): string {
return lstm.run(input)
}
if (assert (input: string) === 'одобрение') {
// Юзер одобряет
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question