I
I
Igor2020-10-04 18:16:10
Neural networks
Igor, 2020-10-04 18:16:10

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)
}


Why do I need it?
I need this for a bot.

For example, a bot asks a certain question, and I need to understand whether the user agrees with this statement or not.

if (assert (input: string) === 'одобрение') {
       // Юзер одобряет
   }


True example?

I am new to neural networks.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Developer, 2020-10-04
@samodum

"Of course not." - get approved? Well, OK. Doing pointless nonsense

A
Arseny Kravchenko, 2020-10-05
@Arseny_Info

You do not need neural networks for such a task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question