Custom entity matching issues - dialogflow-es

I have a custom entity for specific gravity and if a user enters in 1.042, 1.043 something exact it will not match the reference value. However if they are using the other synonyms work fine.
Custom Entity
1.042 is the reference synonyms are: 10 42, 1042, 1 dot 042, 1 point 042, 1.042
Intent
calculate abv 1.080 to 1.010 (numbers mapping to custom entity

Related

Action and parameters in dialogeflow

When I created A Parameter and I assigned it to te entity called #sys.unit-information-name,
I keep getting this warning: *The annotated text 'diabetes' in training phrase 'show me results on diabetes' does not correspond to entity type '#sys.unit-information-name'. And as a result my chatbot does not give me the right result, basically it will just keep asking the question under the Prompts under the Action and parameters.
If I remove this parameter it works. But I want to use the parameter & Entity
Any Help
Thanks
The problem you are facing is because you are explicitly creating a parameter and adding the system entity #sys.unit-information-name. This entity is used to refer to information about units as per system Entities documentation.
Since you are referring to a disease “diabetes” as per your expression “show me results on diabetes”, this entity cannot be used to map diabetes or any other disease also. There is no system Entities for Diseases, so it's better that we create a custom entity defining most of the disease names.
When giving the training Phrases if the word matches with values defined in entity, then entity mapping for that word will be done and the response will be generated.

Dialogflow intent triggering only if value of Entity matches

I have an entity called 'Vehicle', inside there are different values like 'Car', 'Motorcycle' or 'Truck'.
I want the intent to trigger only if detects a Entity Vehicle with value 'Truck'.
In this pic I show the configuration of my intent. The problem is that will trigger with any value which is a Vehycle
How can I fix it without using fulfillments?
Don't use entities in this case. The issue is that an entity will match any instance of that entity.
If you only want to match 'Truck', add that in your training phrases and then add a parameter named Vehicle with the value Truck, without using an entity. Like so:
Notice that Truck is not highlighted and the Entity field is empty.

[dialogflow][actions-on-google] Composite entities for slot filling

I have a very basic example
I want to be able to add multiple types and quantities of things - the user may or may not enter the quantity in which case i want to ask for it.For example
I want to order 1 Margherita pizza Medium pan crust and a deluxe veggie
I have defined the following entities
#Pizzas
#PizzaCrusts
#PizzaSizes`
And a composite entity #PizzaWithCrustAndSizes which is made up of all three of the above.
In my request i have a slotfill parameter 'allPizzas' which is a list of the above composite type.
There is a webhook call which refines the order before confirming it. However when i receive the parameter - i get it as a string rather than an object type.
allPizzas: [ '1 Margherita Pan Medium' ]
How do i make Dialogflow send it as an object, is there any way
Yes you can achieve this
you have 3 entites
#Pizzas
#PizzaCrusts
#PizzaSizes
and a composite entity #PizzaWithCrustAndSizes
so in the entity #PizzaWithCrustAndSizes first uncheck the define synonyms checkbox
then you will get the value field now enter the values as
#Pizzas:Pizzas #PizzaCrusts:PizzaCrusts #PizzaSizes:PizzaSizes
go to intent training phrases
I want to order 1 Margherita pizza Medium pan crust
remove all the individual entities and select "Margherita pizza Medium pan crust" and map it to composite entity "#PizzaWithCrustAndSizes"
it will give you the parameter value as object.

How do i fetch the exact word that is searched, instead of its synonym in DialogFlow (Formerly, API.ai)

I'm using dialogflow to let users query for keywords of my product and give them the value of those specific keywords.
But the problem is, when user's search for the synonyms of those keywords, which are already defined in my entity list.
Its HTTP call, returns me the root word, and not the synonym due to which I am not able to find the dropped words.
How do I retrieve the exact word which was fetched?
Please look at the screenshots below for better understanding
Look at the KPIs, as it fetched "Death Rate"
Look at parameters that are fetched, under KPIs, it is fetched as "Mortality"
Screenshot of my entities, Mortality has a synonym "Death Rate"
I need to fetch the exact keyword that is entered
I know, I can put each word in entities, with synonyms apart, but it is too vague for large amount of data. As there is restrictions in number of entities too
To fetch the keywords you just use your returned entities ($entity_name). To fetch the exact synonym matched you use $entity_name.original. What you see at the training phrases is the resolved value but if you check the JSON (from the diagnostic info, bottom right corner, you'll see that the entity that returns is the one defined.
following you example, my entity is named Mortality and one of the synonyms is 'death rate'. You can see the difference between the resolved value and the actual entity name being returned

How can I create composite entities which include other entities without a space between them?

For example i want to create an entity to match voltage values like:
5 V, 5 volt, 5 v, etc...
I give composite entity values like:
#sys.number V, #sys.number volt, #sys.number v, etc...
However user often write like:
"I am looking for a 5v lamp"
In order to create examples without space i try,
{#sys.number}V, {#sys.number}volt, {#sys.number}v, etc...
But it doesn't work. What is the correct way to do it?
Go to Entities,
Create a new entity and give the name as 5v,
Enter reference value as 5v and enter synonyms as 5 V, 5 volts, 5 v, 5v,5V or every possibility that you can think.
Save the entity and go back to your intent now when you add the question in
user expression it will automatically detect the entity as #5v because we gave a name to an entity as 5v

Resources