Composite of Automated Expansion Entity in Dialogflow - dialogflow-es

In Dialogflow for my Google Action, I have this automated expansion entity, called food, trained with some types of food included bananas and onions.
Then I have a composite entity called thing-to-buy structured like this:
#sys.number:number #food:food #sys.date:date
My intent has just one training phrase:
'four bananas tomorrow' auto-detected by dialogflow as thing-to-buy entity
In the simulator, when I say 'four bananas tommorrow' it obviously works well, getting the thing-to-buy as {date: 2019-02-26T12:00:00+01:00, food: bananas, number: 4}
It works also when I say another food present in the training phrases of the entity 'food', like 'onions'
'100 onions today' -> {"date":"2019-02-25T12:00:00+01:00","number":100,"food":"onions"}
But when I try with a food that's not present in the 'food' training phrases, it doesen't recognize it as a new one:
'4 carrots tomorrow' -> {}
Why is it so?
Is there a way I can achieve my goal of having my big 'thing-to-buy' entity?
Thanks!

As per my understanding, you don't have enough data to bot to be trained although the auto expansion is on. You will have to add more utterances/entity values and keep on trying for the bot to be trained.

Related

IBM Watson: what should be the right granularity of intent?

Let's imagine we are opening a restaurant. We use a chatbot to handle customer ordering.
Intent: #order
Entity: #food: burger, noodle, chicken #drinks: coke, water, wine #compliantItem: service, burger, chicken, noodle
Currently I put "I am thirsty, can I order a can of #drinks", and "I am hungry, can I order a #food" in the intent #order. Does any one know if this would confuse Watson?
I am wondering if this should be improved by
create a new entity called #menuItem and put 2 values food and drinks in it, while keeping entity #food and # drinks
create a new entity called #menuItem and put all values from #food and #drinks in it and remove entities #food and #drinks
maintain 2 intents: (1) #orderfood: put sample "I am hungry, can I order a #food" in the intent #orderfood and (2) #orderdrinks: put sample "I am thirsty, can I order a can of #drinks" in the intent #orderdrinks
Thanks a lot!
Your question is discussed in "How entity references are treated" in the IBM Watson Assistant documentation. You can reference entities as you did. It cancels out any specific examples.
I cannot comment on your intent definitions and improvements. It depends on your dialog flow and how the bot is used. It is learning from user input and how it is processed. If there is something wrong, you as admin can correct it and Watson Assistant would learn it.

slot filling triggers different intent in dialogflow

I have two intents pizzaSelected and burgerSelected in both intents I am asking for required parameters
I have below entities
#pizza [pepperoni, farmhouse, country special, cheese]
#pizzaSize [small, medium, large]
#burger [veg, beef, ham]
#burgerToppings [onion, tomato, lettuce, pepper]
expected conversation
user: order 2 burgers
bot: which burger?
user: cheese
bot: sorry but we have veg, beef and ham burgers. please select one from this.
user: veg
bot: toppings?
user: tomato and lettuce
bot: you order for 2 veg burgers with tomato and lettuce toppings is placed.
actual conversation
user: order 2 burgers
bot: which burger?
user: cheese
bot: what size of pizza you want
as in actual conv when user says cheese which belongs to #pizza entity then it triggers the pizzaSelected intent instead of re-prompting the user for entering correct value.
Is there a way to handle this.
If you are not using custom fulfilment based logic for slot filing then your burger_type entity (or whichever name you might have used for entity) must have cheese as a valid value.
I would recommend to go to entities and check the values of entity which you are using to store type of burger. Even if you have only the correct values there try reordering them and then save. This will force the bot to retrain as this is a machine learning model sometimes it might get optimized for the wrong output, if that is the case for you then try retraining it.

Recognize 'a' in a sentence and indicate as 1 #sys.number in Dialogflow

I would like Dialogflow to detect a in a sentence and give it a number = 1.
Example: I would like to have a chicken rice.
Dialogflow should detect as:
'a' = #sys.number, Resolved value : one or 1
"chicken rice" = #delivery-product, resolved value : chicken rice
I already have an entity to detect the product, a intent to detect single order or multiple order,
i.e. "I want 2 chicken rice and 2 coffee" .
this would return me both numbers and products.
However I just can't get Dialogflow to detect:
I want a coffee
I want 2 chicken rice and a coffee.
Anyone have any recommendation to tackle this issue?
Thank you!
Create a new custom entity with the synonym of "1" as "a" and then add that custom entity in a new custom entity with "#sys.number". Do not add synonyms for this entity. Use the second custom entity in your intent training phrases.

Difficulties with combined words as entities in Dialogflow

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.

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'.

Resources