A
A
Alex2017-10-24 12:34:54
Parsing
Alex, 2017-10-24 12:34:54

How to understand a text message?

We need an algorithm for parsing text and parsing into parameters for the API.
For example, a request to the API has two parameters:
count- a number less than 50
type- the value can be a series or a movie
Some mechanism is needed to understand the text in different formulations and return the parameters.

getParams('Сериал') // -> { type: 'сериал' }
getParams('Покажи мне сериал') // -> { type: 'сериал' }
getParams('Покажи мне 10 лучших сериалов') // -> { count: 10, type: 'сериал' }
getParams('Какой самый популярный фильм?') // -> { type: 'фильм' }
getParams('Топ 15 фильмов 90-х годов?') // -> { count: 15, type: 'фильм' }

Are there any libraries for such an analysis, taking into account the fact that there may be more parameters?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2017-10-24
@Taraflex

https://tech.yandex.ru/tomita/

T
TheRonCronix, 2017-10-24
@TheRonCronix

Bayesian classifier.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question