Dialogflow intent triggering only if value of Entity matches - dialogflow-es

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.

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 does not evaluate parameters to its reference value

I have the following custom entity named 'department'. The entity defines like below:
department [Define synonyms - checked]:
appliances| stove, washer, appliance has, appliance part, appliances, appliances department.
An intent uses this entity type (department) in training phrases. ML is enabled for the corresponding intent.
The issue:
when in the DF console I enter 'appliances department', DF does not evaluate the value as 'appliances' and set it to be equals to original value (appliances department). If I use other synonyms, the value is evaluated correctly.
Could you please help me to resolve this case.
Thank you in advance!
I have reproduced the entity, and it is working for me.
I believe that maybe Dialog Flow is seeing the synonym ‘appliances department’ as redundant since the value is ‘appliances’ and it is contained in the synonym list, as well.
Also, there is a possibility that the same value is being overlapped by other entities.

How do I create a Dialogflow custom entity that works like #sys.airport?

Since #sys.airport only exists for the default English locale, I want to create a custom entity that emulates it for other locales.
From what I've read here, you can put subentity types into the value fields, say, the system entity #sys.geo-city:city and a custom entity #usr.iata-code:iata, and it will match either one or the other.
But I don't understand how you would tell Dialogflow which city and which IATA code go together, so that Dialogflow (ES) would know to send the complete object {"city":"Amsterdam", "iata": "AMS"} to the webhook after matching either "Amsterdam" or "AMS", as it does happen with #sys.airport.
Thanks for any input!
It will be difficult to create a custom entity that works just like #sys.airport. The #sys entities are special and can do somethings custom entities can't, for instance, pairing values together.
As you pointed out, you can put multiple entities together in one single entity by using Composite Entities, but the only thing this does is allow you to recognize two values made up from other #sys or custom entities in a single entity. It doesn't give you the option to create pairs between the values of the entities.
If you would want to create something like this, you would need some code that does a look up in a dictionary or list. So when "AMS" is matched, the code fills in the missing property "Amsterdam" or vice versa.

Dialogflow entity recognition sets a value very different from the ones defined in the console

Dialogflow detects an ingredients entity value 'se' even when 'se' is not a value defined as valid for ingredients.
This is the console parameters for ingredients entity.
And this is the 'se' value that Dialogflow resolves for the required ingredients parameter.
setting off 'allow automated expansion' in the entity configuration solved the problem.

Entity with excluded values in Dialogflow

I want to create an entity that has any value except the values that are defined in another entity.
For example, i have an entity that contains all the possible products categories that i use in the bot, and if the user type a value that is not in that entity i want to react in some way.
It's like a fallback but only triggered when that condition is met.
Any suggestion?
Entity extraction is based on some definite value that can be identified and separated. There should be some basic features defined for the agent to train on. Based on these trained features, the agent will look for an entity and extract it from the user's response.
If you have already defined an entity to look for, it will be extracted by the Dialogflow based on the training data. If there is nothing defined it will not be identified as an entity as the agent will be not sure what to look for.
So, what you can do is,
Make the entity (already defined) as not required. Uncheck the "required" checkbox in the Dialogflow.
Add the "#sys.any" in the Entity you defined and make it a composite Entity with the combination of your Entity and "#sys.any" something in the line of
Train your agent to look for this new Entity with your Basic Entity data and Anything else data.
Collect this in the webhook.
OR
You when you want to collect anything else, you can collect user utterance from the agent object and parse the data using Regex pattern of your choice.

Resources