I am currently trying to use NLP (Dialogflow) to resolve all inputs into a number value. I would then like to use that number value as a variable in activechat, a visual chatbot builder. How can I do that?
EDIT: Is it done by using a payload?
When you are using direct Dialogflow integration all entity values are accessible in Activechat as $_nlp_entity_[entity_name] variables. So, if you have #city entity in Dialogflow, when any intent with that entity triggers an event in Activechat, $_nlp_entity_city will be populated with the value for that entity.
Hope that helps.
Related
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.
I have an intent that requires the user to give a path:
plot the file in /home/user/path
Is there a way to extract the path with dialogflow and to get its value into an entity? I think that this case cannot be approached with synonyms.
NO, as DialogFlow doesn't support Regex in entities, there is no easy way to parse path value in DialogFlow using entity.
You have two options to parse Paths into an entity.
One: Use #sys.any entity in place of the path and on fulfilment side check if the value of the entity is actually a valid path or not using Regex.
Two: Create your own entity for paths and use DialogFlow Agent-API to keep updating values in that entity whenever new file/folder is created/updated/deleted in whatever file system you are working on. (Yeah this sounds crazy but I don't think there are any other options to achieve what you want)
I have an issue developing an agent with dialogflow (api.ai). I am using a lot of entity values which are all different from one another. however there are similar synonyms for some entity values but the agent is returning only one value.
How can i get all the possible matches or ask question to resolve the ambiguity
for example i have an intent like: tell me the location of ABC express train
if my entity values are :
entity synonym
15127 ABC express
12345 ABC express
I want it to return two values or ask question to resolve such ambiguity
how can i work this out
Thanks in advance
If you enable fulfillment for this intent, you can take a look at the value the user said and ask a further question if you need to disambiguate between entities.
Let's imagine you are extracting an entity called "trains". The parameters table in your intent might look like this:
By default, if the user says ABC express, the fulfillment webhook will be called with the following parameter hash:
"parameters": {
"trains": "15127"
}
This isn't enough information to decide if the request was ambiguous, since train 15127 might also have non-ambiguous synonyms.
You can configure Dialogflow to send the original text of the entity, alongside the resolved value. This means you will receive the following information to your webhook:
"parameters": {
"trains": "15127",
"original": "ABC express"
}
You can then use some simple logic to ask a further question if the value of original appears in a list of known ambiguous synonyms.
To have Dialogflow send this data, modify your parameters table so it looks like the following:
This will cause the original synonym to be sent to Dialogflow alongside the resolved value.
if I use a query string like:
Does John know to code in C#?
Dialogflow cannot match the C# as an entity parameter. But if I ask like:
Does John know to code in C#
Without any following characters, Dialogflow can match C# as entity parameter. What can be the reason for this? I have tried template and also example queries for training the intent but the result is the same for both.
Is there a way with Watson to identify input.text's that have no entities at all?
I don't need to know anything about the input.text, I just need to know if it does or doesn't have an entity.
You can find out whether any Entity got identified or not, only from the entities array from the response. If this array is empty, then no entity got identified from the input.text, else some entities got identified.