rauldpm / ChatbotTFG

This project houses a chatbot built with the Open Source Rasa software.
GNU General Public License v3.0
0 stars 0 forks source link

Add direct presentation by the user #4

Closed rauldpm closed 2 years ago

rauldpm commented 2 years ago

Related to https://github.com/rauldpm/RuleChatbotTFG/issues/2

It is possible that the user indicates his name without saying hello first, it is necessary to add the necessary rules to recognize basic phrases such as the following:

This must be a different intent than repeat_name, whose main objective is to detect only the user's name without more expression words, in addition, it should only be used if the user indicates that he wants to change the username or has not greeted, for example, in the event that the user starts asking something, which opens the possibility of a more complex presentation that must trigger the form so that it tries to extract the name and validate it

rauldpm commented 2 years ago

Due to the complexity of name recognition, this issue will be reconsidered in the future, for now, the following strategies have been considered:

Pre-trained models

They are based on using a pre-trained entity extractor like Spacy (GitHub repository), but that shows the problem of failure to recognize certain entities, such as mixing people's names with organizations or cities.

This model is based on training its models using Wikipedia so the user input may not be correct,

NamesList

This approach is based on machine learning given a list of names defined by a lookup table and using an entity regex extractor, Rasa proposes a mix between the previous model using Spacy and this one, so that both complement each other. This presents the following problem:

Example:

nlu:
- lookup: PERSON
  examples: |
    - aafrae
    - ....
    - zoumoumou

UI (Option chosen)

To avoid these problems, I have decided to use the option of asking the user directly for their name, so that the specific name can be extracted, validated as many times as necessary if it is wrong and assigned, in addition an initial dictionary of accepted names can be incorporated or avoided that the names have bad names.

One of the possibilities that this option has is that the conversation can start by asking the user for the name, either directly when starting the chat or making the user have to start the conversation by means of a command.

Another reason why I have chosen this option is because it allows me to use rasa at a code level of my own without using external tools like Spacy, focusing more on the platform.

The modules that I have choose this option is:

rauldpm commented 2 years ago

It has been decided that the user can choose to identify himself but by entering only his name without using more complex phrases, under the pretext of controlling the user in a guided way

In this way, if the user starts the conversation with a greeting, he is no longer prompted to identify himself, but instead is shown the options available to him only the first time he greets.

Among these options, the user is told that he can enter "commands" such as "Login" or "Options" to perform actions.

In this case, when entering "Identify", the username is asked, when it is accepted, the form ends and the user is greeted with his name to give a sense of understanding about him.

It has been decided that the user can choose to identify himself but by entering only his name without using more complex phrases, under the pretext of controlling the user in a guided way

In this way, if the user starts the conversation with a greeting, he is no longer prompted to identify himself, but instead is shown the options available to him only the first time he greets.

Among these options, the user is told that he can enter "commands" such as "Login" or "Options" to perform actions.

In this case, when entering "Identify", the username is asked, when it is accepted, the form ends and the user is greeted with his name to give a sense of understanding about him.

With this approach, this issue is closed.