Difference between revisions of "Qubot NLU"

From QuData
Jump to navigation Jump to search
Line 27: Line 27:
 
</table>
 
</table>
  
В каждом из представленных примеров бот, несмотря на схожие намерения и распознанные сущности бот дает осмысленные ответы. В случае намерения '''greet''', мы понимаем что $NAME - имя клиента, а в случае намерения '''want''' мы понимаем что $NAME название пиццы.
+
The bot gives meaningful answers in every given example despite similar intentions and recognized entities. В случае намерения '''greet''', мы понимаем что $NAME - имя клиента, а в случае намерения '''want''' мы понимаем что $NAME название пиццы.
  
 
==Улучшение интеллектуального развития бота==
 
==Улучшение интеллектуального развития бота==

Revision as of 15:08, 5 July 2022

Introduction

If you want your bot to be up-to-date and able to process natural text input, then use our innovative technology - Natural Language Processing (NLP). It is NLP that allows your bot to understand the meaning of users' messages and generate appropriate responses. Whether the client wants “two Margherita pizzas and cola” or “cola and cheesecake for two”, the bot will understand and place the correct order.

How NLP works. General information

The essence of the work of NLP comes down to the analysis of the main components of any sentence - entities and intents.

  • Entities are any real world objects, e.g. cola (drink), Ukraine (country), 2022 (number), Dmitry (name).
  • Intents are the client's wishes described as a sentence, for example, I would like a cola (want), how to get to the theater (finding a way), hello (greeting).

To recognize intentions, machine learning methods are used based on prepared phrases as examples for each class. These methods range from a simple bag-of-words to neural networks of fairly complex architecture. Words, n-grams of words, n-grams of letters (combating typos), the presence of a question mark and others are used as features.

Using combinations of recognized entities and intents, we can confidently state what the client wants and take appropriate actions.

There are some simple examples from a pizzeria bot in the table below:

Message 👩EntitiesIntentsReply 💻
Hi-greetHello
Hi, I'm Margo$NAME = MargaretgreetNice to meet you, Margaret!
I would like two Margheritas and a cola$NUMBER = 2
$NAME = Margherita
$DRINK = cola
wantWould you like to place an order for:
2 Margherita pizzas and one cola?
I would like-wantWhat would you like?
I would like to go to Ukraine$COUNTRY = UkrainewantThe distance from you to Ukraine is 4768.95 km. It will be most convenient to fly by plane.

The bot gives meaningful answers in every given example despite similar intentions and recognized entities. В случае намерения greet, мы понимаем что $NAME - имя клиента, а в случае намерения want мы понимаем что $NAME название пиццы.

Улучшение интеллектуального развития бота

Описанные ранее общие сведения применяются для работы NLP у многих компаний, это довольно простая схема, только у неё есть недостаток - бот не способен ориентироваться в контексте. Это значит что во всех примерах из таблицы 1 всегда будет один и тот же ответ.

Для предоставления боту большего интеллекта в NLP от QuData используются забываемые намерения, а также механизм сохраняющий историю общения с клиентом.

Забываемые намерения - это такие намерения, которые происходят вне основного направления бота и забываются при первом же обычном намерении.

Благодаря этому Вам бот может ориентироваться в контексте, а также обрабатывать более сложные цепочки диалогов, например, такие:

Желтым выделены забываемые намерения.

Сообщение 👩СущностиНамерениеОтвет 💻
Хочу фанту$DRINKS = фантаwantСколько фанты Вы хотите?
А сколько она стоит?-[ want, what-is-the-price ]Фанта стоит 20 гривен.
Тогда три$NUMBER = 3[ want, number ]Я добавила в заказ 3 фанты


Сообщение 👩СущностиНамерениеОтвет 💻
/start-startЗдравствуйте. Меня зовут Бот. Как Вас зовут?
Меня зовут Катя$NAME = Екатерина[start, my name is]Очень приятно Екатерина, рад знакомству.
Привет-greetВсегда рад поздороваться повторно.
Meня зовут Маша$NAME = Марияmy name isПонятно... То есть Вас зовут Мария?
Нет.-denyКак же Вас тогда зовут?
Даша$NAME = ДарьяnameПонятно... То есть Вас зовут Дарья?
Да-yesХорошо, Дарья, я это запомню.
Meня зовут Даша$NAME = Дарьяmy name isДа, Дарья, я знаю.
Я хочу фанту$DRINKS = фантаwantСколько фанты Вы хотите?