I dentification of training phrases for Dialogflow - dialogflow-es

I am trying to build a chatbot using Google Dialogflow. I have a set of 100 utterances with me for different Intents. How can I select the training phrases out of this 100 utterance list? Is there any rule to select the unique patterns from the list on the basis of entity pattern or unique paraphrase?
It would be very helpful if you could share the answer here.
Thanks!

Training phrases are example phrases for what end-users might type or say, referred to as end-user expressions. For each intent, you create many training phrases. When an end-user expression resembles one of these phrases, Dialogflow matches the intent.
For example, the training phrase "I want pizza" trains your agent to recognize end-user expressions that are similar to that phrase, like "Get a pizza" or "Order pizza".
You don't have to define every possible example, because Dialogflow's built-in machine learning expands on your list with other, similar phrases. You should create at least 10-20 (depending on complexity of intent) training phrases and try to include more unique training phrases which are relevant to that specific Intent, so your agent can recognize a variety of end-user expressions.
Reference link :https://cloud.google.com/dialogflow/es/docs/intents-training-phrases

Related

Wrong intents are getting trigger on the inappropriate User input in Dialog Flow

I have few intents which are getting trigger on the inappropriate User input. Below are a few examples.
Intent 1). Training phrases I have given
When will I get a job abroad?
Is there any possibility that I will be settled in foreign
When will I settle in foreign
This intent is getting called for user input I had a fight with my friend, will it settle down
Intent 2). Training phrases I have given
When my financial problems will over
Tell me about my financial condition
How will be my financial condition in the future
What will be my financial condition
This intent is getting called for user input When my family problems will over
Please help me out to handle these scenarios.
According to this documentation, you should use at least 10-20 trainning phrases.
You don't have to define every possible example, because Dialogflow's
built-in machine learning expands on your list with other, similar
phrases. You should create at least 10-20 (depending on complexity of
intent) training phrases, so your agent can recognize a variety of
end-user expressions. For example, if you want your intent to
recognize an end-user's expression about their favorite color, you
could define the following training phrases:
"I like red"
"My favorite color is yellow"
"black"
"Blue is my favorite"
...
Given that, to increase the assertiveness of your intents I'd recommend you creating more training phrases and focus them in the main terms necessary in your problem.

Word tolerance of training phrases in Dialogflow (- to create a Google Action)

I have an important question, at the moment i am writing my last essay before starting with my bachelor thesis. It is about voice apps, which includes the google actions for sure.
But i need some informations about the word tolerance of the training phrases. And I was not able to find some information on the internet yet. Does Google only recognize the training phrases typed in by the developer or can Google add some phrases by time or with training (so that the user can say different phrases to trigger an intent which were not typed in from the developer in the beginning) ?
It is really important for my essay. So I would be very happy if you can help me with this question.
I wish you a nice weekend!
Dialogflow uses the training phrases to build a machine-learning algorithm to match similar phrases that aren't exactly what you enter.
For example, the training phrase "I want pizza" trains your agent to recognize end-user expressions that are similar to that phrase, like "Get a pizza" or "Order pizza".

Rules in Dialogflow

Dialogflow documentation mentions that agents can be set in two modes, Hybrid(Rule-base and ML) and ML Only. How do we set up rules in Dialogflow? Can't find any documentation for this. Or is it only through training phrases? For example I want to set a rule that says any utterance that starts with 'XYZ' should be matched against Intent A.
I've tried marking 'XYZ' as an entity at the beginning of the training phrases in Intent A hoping that all such utterances are matched with this intent, however that does not seem to be happening.
'XYZ needs some goods to be transferred to location 23'
I expect such utterances to be matched against Intent A but that doesn't happen always
Rule based agent will match only those request which will match the training phrases as it is (or maybe it will match lemma values also).
It will match the sentence and extract the parameters as well if you have annotated the parameters in the training phrase.
But it will not match the variant of the sentence.
Hope it helps.

Difference between DialogFlow and Google Cloud Natural Language product

Both DialogFlow and Google Cloud NL (Natural Language) are under Google, and to me they are very similar. Does anyone know any specific on their differences and whether Google will consolidate into one product? If I am a new developer to use the features, which one I should pick?
I search around and cannot find any satisfactory answers.
Thanks!
While they are vaguely similar, since they both take text inputs, the results from each are somewhat different.
By default, GCNL doesn't require you to provide any training phrases at all. It takes any sorts of textual input and lets you do things such as sentiment analysis, parts of speech analysis, and sentence structure analysis on the phrase.
If you are expecting very free-form inputs, then GCNL is very appropriate for what you want.
On the other hand, Dialogflow requires that you provide training phrases that are associated with each Intent and possible parameters for some of the words in those phrases. It then tries to take the input and determine which Intent matches that input and how the parameters match.
If you have a more narrow set of commands, and just want a way to more flexibly have people issue those commands in a conversation, Dialogflow is more appropriate.
It is unlikely the two will ever be merged. Dialogflow is well tuned to make conversational interfaces easier to develop, while GCNL is more open-ended, and thus more complex.

Map to the wrong LUIS intent

I am facing an issue whereby words that does not match with any intents, it will assume it belongs to intent with the most labeled utterances.
Example: if
Intent A consists of utterances such as Animals
Intent B consists of utterances such as Fruits
Intent C consists of utterances such as Insects
Intent D consists of utterances such as People Name
Desired: If the random word(s) does not fit into any of the luis intent, it will fit into none luis intent. Example of desired: If word such as "emotions" or "clothes" were entered, it will match as "None" intent.
Actual: When user type random word(s), it match with luis intent with highest number of labeled utterances. If word such as "emotions" was entered, it will match as "A" intent as intent A consist of highest number of labeled utterances.
Please advise on the issue.
Set a score threshold, below which your app won't show any response to the user (or could show a "sorry I didn't get you" message instead). This avoid responding to users with anything LUIS is unsure about, which usually takes care of a lot of "off topic" input too.
I would suggest setting it your threshold between 0.3 and 0.7, depending on the seriousness of your subject matter. This is not a configuration option in LUIS, rather in your code you just do:
if(result.score >=0.5) {
// show response based on intent.
} else {
// ask user to rephrase
}
On a separate note, it looks like your intents are very imbalanced. You want to try and have roughly the same number of utterances for each intent, between 10 and 20 ideally.
So without more details on how you've built your language model, most likely the underlying issue is that you either don't have enough utterances in each intent that have enough variation displaying the different ways in which different utterances could be said for that particular intent.
And by variation I mean different lengths of the utterance (word count), different word order, tenses, grammatical correctness, etc. (docs here)
And remember each intent should have at least 15 utterances.
Also, as stated in best practices, do did you also make sure to include example utterances in your None intent as well? Best practices state that you should have 1 utterances in None for every 10 utterances in the other parts of your app.
Ultimately: build your app so that your intents are distinct enough with varying example utterances built into the intent, so that when you test other utterances LUIS will be more likely able to match to your distinct intents--and if you enter an utterance that doesn't follow any sort of pattern or context of your distinct intents, LUIS will know to detect the utterance to your fallback "None" intent.
If you want more specific help, please post the JSON of your language model.

Resources