QnA Chatbot

rasa-nlu

(Asim Zaman) #1

Hi Suppose I have to create QnA on different topics and subjects for students (one of many other’s features of LMS chatbot), In nlu training can my whole one question is One Intent and Its answer will be its response and I do the training as

Intent: What are the organic chemical groups that compose carbohydrates? How are carbohydrates classified according to the presence of those groups?

Text: Carbohydrates are also known as sugars (starches, cellulose and other substances are also carbohydrates). Carbohydrates are polyhydroxy aldehydes or polyhydroxy ketones (polyalcohol aldehydes or polyalcohol ketones). Polyhydroxylated aldehydes are called aldoses and polyhydroxylated ketones are called ketoses.

Now my second question is if I want to use Stanford Q&A json to clean dataframe | Kaggle , I have to do some data processing and separate out relevant QnA and do the same above work for nlu training, is I am right?

Please I need urgent response.


(Souvik Ghosh) #2

To answer your first question,

No. that is not correct.

Intent classification isn’t a mapping like a database.

Your intent is clearly the question. you want to system to understand that a particular user is asking a question. so you are looking for the intent of the user. Let’s take an example

A restaurant bot helps us users let’s say to book a table in a particular restaurant.

As a user talking to this bot, his primary intent is to book a table.

so for the system to understand his intent, you make sure to provide example to the system as to how a user might ask the question

Hence Intent - Book a table,

text - I would like to book a table, i want to make a reservation, can i have a table for 4 this evening, i am coming with my family this evening to eat at your restaurant.

the same question can be asked in different ways. Once you have provided the texts for an intent, you train your model that will now try to interpret new requests coming from actual user. for example user might say - i want a table for lunch and the model should classify it to the intent - Book a table. Once you receive this intent, in this case say Rasa NLU. You process it in code quite simply If Intent == Book a table then reply = when would like the table

hope this helps


(Souvik Ghosh) #3

To answer your second question,

you have to first process out all the unique questions and for each question provide examples to how it can be asked by a user. if you are using the tensorflow pipeline, you should provide at least 10 examples for each intent( how would a user will ask the question) and then once you have a classifier you map each question to an answer programmatically.


(Asim Zaman) #4

@souvikg10 Thanks, lets move further, In above situation students ask question and chatbot response. On the other hand when chatbot take assessment then chatbot should ask difficult and more conceptual questions if students previously gives correct answers and simple questions if student doesn’t give correct answers? Building context while taking assessments?


(Souvik Ghosh) #5

Not sure you need a chat bot for that. That’s a simple form. In an assessment you are not classifying anything instead you are registering answers from users and trying to match it to a database to assess correctness.you can build a similarity model to see how similar two answers are. One in your database and one given by users. This method if users provide subjective answers, for objective questions it is even more easy. On the other hand, for the next question to be on a difficultly level there are several ways, Very simple one, put every question on a range of difficulty and based on previous answers you can build a graph. Could be done with a simple set of rules.

Not everything needs machine learning