Food Ordering Design Question

So, I have been working on a basic food ordering application for a bit and I have a bit of a design question that I would like some advice about. The basic premise is like a classic restaurant ordering application, but I would like to support some more interesting actions for the user such as:

  • Ordering multiple items at once e.g. I want spag bolonese and garlic bread
  • Changing modifiers on items e.g. Add extra noodles to my ramen
  • Removing items e.g. Actually, remove the fries from my order

My question is whether to support these functions as a large “edit order” intent, and perhaps use role classification to decide what to do, or to have different intents for these use cases, and use multiple intent functionality to decide what to do. Assuming that I have a choice of how to annotate my dataset, is either of these methods generically better than the other?

Edit: I forgot to mention this before, but this is for a system that will interface with an asr/tts audio system. Thus, I can’t really have a lot of long forms for the user to read since that means that every interaction will take ages for the tts to finish talking.

@dragon18456 Heya!

Approach1: I guess you have your menu decided with basic options so you just need to show menu such as:

Bot: Hey, How can I help you today for your appetite :plate_with_cutlery:!

Please select from the menu below:

  1. Burger
  2. Pasta
  3. Noodles etc etc

User: user select Burger as per the burger options if you want to show more option for burger categories you can.

Bot: Great choice.

Qty:?

Veg or Non-veg?

User: 2 please and Veg

Bot: Due you want to add extras or sides in your order?

selection options related to the option ( for burger it will be generic such as extra cheese, extra patties, extra sauce etc) same with other.

Selection options for sides such as drinks and qty… etc

So, by this you restricting your marketing needs and menu

User: Yes, Extra slice of cheese and 1 coke. (user can select from the option you show )

Bot: Great. Please confirm your order:

Name:

Address:

Contact No:

Order : Burger | Veg Qty: 2

Extra: Cheese

Sides: Coke Qty: 1

The above Name, Address, Contact No you can asked in starting before order it will be generic again.

Bot: This is your final order or you want to change order? Please confirm! (Bot will show button option)

Confirm | Change Order

Here Two Scenario’s

Scenario 1

User: Confirm

Bot: bot show the order and say thank for the order enjoy your meal! Hava a great day! Or can show some promotion messages etc.

Scenario 2

User: Change order

Bot: What item you want to change?

User: 2 coke.

Bot: Sure! Please confirm your order:

Name:

Address:

Contact No:

Order : Burger | Veg Qty: 2

Extra: Cheese

Sides: Coke Qty: 2

Note: Same process you can used for remove then the qty or that related field will be empty.

I have given you generic approach. I hope it will help you? I will encourage you for design question; you can explore Ubereats, Justeats, Deliveroo etc

The above approach/suggestion is based on my own perception and dialogue management experience for bot/user. You can agree and dis-agreed I will not mind :slight_smile:

If you have any further questions please shout out :slight_smile: Good Luck!

Thanks for your help. The only issue that I might have here is that this is meant to interface with an asr/tts audio system, so I won’t have access to a lot of these functions since I wouldn’t want the audio to play so long. I don’t want to be constantly asking the user for verification when they have given enough information. Consider the following scenario in a fast food restaurant:

1 User: “Hi, I would like a large diet coke and a hamburger with extra cheese, extra pickles, and no lettuce”

2 Bot: “Hamburger with extra cheese, pickles, no lettuce and a large diet coke, anything else?”

3 User: “Yeah, I want large fries with my order with ketchup and special sauce.”

4 Bot: “Large fries with ketchup and special sauce, will that be all today?”

5 User: “Actually, I would like a milkshake instead of my coke and could you add a hashbrown on the side.”

6 Bot: “Okay, so I’ve removed the coke and added a milkshake and a hashbrown, what size and flavor would you like your milkshake to be?”

7 User: “How about a large chocolate milkshake”

8 Bot: “Okay, I’ve got a large chocolate milkshake. Is there anything else?”

9 User: “No, that’s it”

Notice how I don’t really have that much real estate for listing out all the stuff that my bot can do since it will be an audio system rather than a text system. I am trying to minimize the number of interactions that the user will need to have with the bot.

In this case, lines 1-4 are super simple, we just need some intent like “add_to_order” and a response that confirms the order from the bot. However, consider line 5. We would need the bot to understand that the user intends to swap the diet coke with a milkshake AND add a hashbrown to the order. In this case, there are 2 design options that I am mulling over:

  1. Have a universal “edit_order” intent for any action that involves adding things to the order. So this would be anything that isn’t responding to a form or asking a question or greetings etc. Here, we would need to use something like role classfication, so we would need the labeling to be like

Actually, I would like a [milkshake]{“entity”: “item”, “role”: “old_swap_item”} instead of my [coke][{“entity”: “item”, “role”: “new_swap_item”} and could you add a [hashbrown]{“entity”: “item”, “role”: “new_item”} on the side

Here, I am worried about the entity labeling not enforcing the pair for “old_swap_item” and “new_swap_item”, or mislabeling the “hashbrown” entity. Here, we would also need enough training data to learn this, perhaps using lookup tables for cue words that might indicate a swapping like “actually” and “instead” or “change”.

  1. Have multiple intents for actions that modify an order. Here, we would have “add_to_order”, “edit_order”. We might even split up the intents even more to include something like “modifying_order” like asking for extra sauce on your burger and “remove_order” for removing a side from your order. Here tho, it is hard for me to think about how the bot should interpret “Actually, I would like a milkshake instead of my coke”. Should it be modeled as removing the coke and adding a milkshake or should they be explicitly paired up? Also, here, I will still have the issue of role classification, since knowing that the user wants to both add to their order and change something in their order doesn’t tell me which entities correspond with which.

So far, I have been getting pretty far by just having a hard coded rule-based system where I just identify entities and swaps and deletes with a giant dictionary of cue words that indicate what the user wants to do, but this won’t scale well and I do think that it kinda negates the point of using ML for intent classification and entity extraction.

@dragon18456 You not mentioned It’s for Voice or Text :stuck_out_tongue_winking_eye: Update above post :slight_smile:

Oh yeah, sorry about that, I originally thought audio vs text was orthogonal this issue.

I guess the crux of the issue is that I don’t want the system to have to keep asking for clarifications or for the user to unnaturally interact with the chat bot. If the user want to change coke to milkshake, the bot should just accept that and move on without asking 2 more follow up questions. This is why I am wondering about the structure of the “edit_order” intent and whether it is better to have multiple intents or 1 intent with multiple roles?