Difficulties with combined words as entities in Dialogflow - dialogflow-es

I'm trying to write an intent in Dialogflow that requires the user to fill both a room as well as an object.
I need to determine if the room is part of a house (check in entity 1) and if the object is made of glass (check in entity 2).
In English, for instance, that would result in '[kitchen] [window]', however I have to do this in Dutch, where a lot of words are combined.
Users should be able to say 'the window of my kitchen is damaged', but in Dutch it is more natural to say 'keukenraam', so: 'my kitchenwindow is damaged.
This one word combines location and object, but I have not been able to use one word to fill two entities.
Does anybody have a good suggestion, because I can't find a proper solution for this problem.

Related

Select multiple options from suggestion in dialogflow

I am building a chatbot using dialogflow and I want that a user will be able to select multiple responses from Suggestions.
Is there any way to get it done using dialogflow fulfillment or something else? Or is there some other alternative to implement this?
I had the same issue, and my finding is that we can't select multiple suggestion chips.
but if you want to select multiple items from user in single intent then you can use "IS LIST" option in actions and parameters.
suppose you have an entity "fruits" having values {apple, orange, mango etc}
bot: what would you like to eat
user: I would like to have apple and mango
for this add training phrase "I would like to have apple and orange"
and in actions and parameters select "IS LIST" against "fruits" entity
Suggestion Chips are meant to be hints or ways to pivot the conversation.
Depending on your use case you can guide your user through different options. For example, if they are selecting a shirt, you can first ask for the color and then the size -- separating the different options to smaller subsets. A different option/example is for selecting music style (where one can choose one or several options) can be ask them to tell you the style of music they like (while providing 5 suggestion chips) and then in your response you confirm the styles and allow them to add more (while providing 4 suggestion chips of music styles and another that says "All done") --- I think I would also use this design to implement ranking of their preferred music.

Is there an easy way to create a "Movie-name" entity in dialogflow

I want to create an action that takes the name of a Movie or Tv show and returns some details about it.
The problem is that I need to add all the possible tv show names to an entity.
Even then there is the limit of 3000 for the maximum number of entities in an Entity. Is there a way around this problem?
Ideally I would like to give it some sample tv show names and when the user says a new tv show name(one that the entity doesn't contain), it is able to recognise it and pass it on to the intent.
You should create a custom entity, and train it with as many examples as you can. Additionally, mark the allowed automatic expansion, so that dialogflow will be able to recognize the names which you have not defined.
The problem could still be there, that dialogflow might recognize something as movie name which is not a movie name, for that you should have a validation function in your webhook code. If validation fails, you can prompt the user again for correct movie name.

Complex Statements Intent Classification

Consider following sentences:
1) I want to watch movies watched by Srikanth but not by tarun
2) I want to watch movies of Christoper Nolan but not having Christian Bayle
3) I want watch movies watched by Srikanth but not liked by Tarun
The problem I am facing is -
Even though I can successfully define entities such as "not watched", "watched" , "not liked" , "having" , "not having" etc; etc;
Hence I will know what kind of action user is referring to.
I will also get to know names like Srikanth, Tarun, Nolan, Bayle etc;
But How do I establish Relationship between name and action. How do i know which action was related to which name.
I am not able to achieve this in LUIS / DIALOGFLOW.
What I feel is only way is to break statement into 2 distinct statements, How can we do that and is that a right approahc
We cannot directly assign multiple intents to the same utterance through LUIS. You can use NLTK along with LUIS to fix this issue as discussed here.
Another workaround is to create 2 apps with each intent and assign the same utterances and add the code which would differentiate the intent based on the keyword in the sentence.

LUIS does not recognize names with spaces

So I got a bot built with Microsoft Bot Framework and it's using the LUIS API for text recognition. With this bot, I'm able to ask about information about different devices that I got in my backend. They got names like Desk, Desk 2 and Phone Booth 4. The first and second name works just fine but whenever I send a name that contains 2 spaces or more, LUIS will fail to recognize it. I have added all the names to a feature list on LUIS but it doesn't seem to do anything. When I'm in the bot code executes the method for that intent, the entity is just null whenever I send this kind of names. Any idea how I might solve this? As I described, names with just one space like Desk 2 works just fine. Maybe there is a way to save multiple words as an entity inside LUIS?
In the image below, the top entry is "show me phone booth 4" and the bottom one "show me desk 2".
It'll take a little leg work, but have you tried updating your model programmatically?
On the LUIS API reference, you can label individual utterances or do it in batches. The benefit of doing it this way is that you can select what should be recognized as an entity based on index position.
Example:
{
"text": "Book me a flight from Cairo to Redmond next Thursday",
"intentName": "BookFlight",
"entityLabels":
[
{
"entityName": "Location::From",
"startCharIndex": 22,
"endCharIndex": 26
},
{
"entityName": "Location::To",
"startCharIndex": 31,
"endCharIndex": 37
}
]
}
I admit I haven't attempted to do this before, but I do not see how labeling/training this way would logically fail.
One thing I do note about your entities is that they're composed of an item and also a number. You could throw them into a composite entity; but in this case doing it the way I mentioned above is a good way to do what you're looking for.
That said, if you plan on using the office-furniture-pieces(?) as entities for a separate intent, say, 'PurchaseNewOfficePieces', it might pay to create use a composite entity for 'Desk 2' and 'Phone Booth 4'.

Sending specific words to webhook

I'm trying to make an agent that can give me details about movies.
For example, the user says "Tell me about (movie-name)", which sends a post request to my API with the (movie-name) which then returns the response.
However, I don't understand how to grab the movie name from the user's speech without creating a movieName entity with a list of all the movies out there. I just want to grab the next word the user says after "tell me about" and store it as a parameter. How do I go about achieving that?
Yes, you must create a movieName entity, but you do not need to create a list of all movies. Maybe you are experienced with Alexa which requires a list of suggested values, but in api.ai you don't need to do that.
I find that api.ai is not very good at figuring out which words are part of a free-form entity like movieName, but hopefully adding enough user expressions will help it with that.
edit: the entity I was thinking of is '#sys.any' but maybe it would be better to use a list of movie names with the 'automated expansion' feature. I haven't tried that, but it sounds like the way that Alexa's custom slots work, which is actually a lot more flexible (just using the list as a guideline) then people seem to think.

Resources