Git Product home page Git Product logo

terrenjpeterson / caloriecounter Goto Github PK

View Code? Open in Web Editor NEW
56.0 6.0 36.0 296 KB

AWS Lex based chatbot that calculates calories based on different fast food restaurants. This was an entry for a coding challenge on DevPost, and is actively used on Facebook Messenger. The issues list is actively managed as what defects or improvements are found by real world usage.

Home Page: https://www.facebook.com/fastfoodcaloriecounter/

JavaScript 89.02% HTML 5.35% Shell 5.63%
chatbot aws-lex nutrition lex aws-lambda aws facebook-messenger-bot bot ai custom-slot

caloriecounter's Issues

Add healthy items option

Users asking questions like "What the healthiest item on McDonald's menu?" or "What items are at Taco Bell under 200 calories.".

Soup and Sandwich Sizes at Panera are vague

Soup and Sandwich sizes at Panera aren't reflected in the App.

Right now Soup is a "bowl size" and Sandwich is a "full size".

This should be reflected more in the language used with the user.

For example, Bowl of Chicken Noodle Soup, or Half Italian.

Add soups for Panera

No soups currently at Panera. Based on menu, add
{"foodName":"Vegetarian Autumn Squash Soup", "calories":340},
{"foodName":"Autumn Squash Soup", "foodType":"Soup", "calories":340},
{"foodName":"Turkey Chili", "foodType":"Soup", "calories":260},
{"foodName":"Cream of Chicken & Wild Rice Soup", "foodType":"Soup", "calories":260},
{"foodName":"Chicken Noodle Soup", "foodType":"Soup", "calories":160},
{"foodName":"Baked Potato Soup", "foodType":"Soup", "calories":330},
{"foodName":"Potato Soup", "calories":330},
{"foodName":"New England Clam Chowder", "foodType":"Soup", "calories":570},
{"foodName":"Broccoli Cheddar Soup", "foodType":"Soup", "calories":360},
{"foodName":"Vegetarian Creamy Tomato Soup", "calories":280},
{"foodName":"Creamy Tomato Soup", "foodType":"Soup", "calories":280},
{"foodName":"Tomato Soup", "calories":280},

Fries and Coke

Problem when someone answers the second question with both the extra and the drink name. Can solve by parsing out the two into separate variables.

var str = "fries and coke";
var n = str.indexOf(" and ");
var x = str.indexOf("fries");
if (n > 0) {
    var y = str.substring(n + 5, str.length);
} else {
	var y = str.substring(5, str.length);
}

getFoodOptions needs to scrub restaurant name

if the user doesn't spell (or hyphenate) correctly the restaurant name, it won't return the correct list of food items.

For example,
"What types of salad are at Arby's" - yields nothing.
"What types of salad are at arbys" - provides the list.

Add option for ketchup with fries

User may ask for ketchup after mentioning fries as an extra. Need to be able to handle it - right now it answers with an odd response as it assumes it's a food, or just doesn't recognize.

Add sauce for nuggets

Need to ask user if they are using sauce with their nuggets and add to the calorie count.

For example, Barbeque, Polynesian, etc.

Add nutritional analysis feature

After hearing a breakout of the number of calories in a meal, provide context for the user in the number of calories in a day. For context, the average calorie consumption for an adult male is 2500, for a female is 2000.

So if a meal is 800 calories, that's 33% for a male's calories for the day, or 40% for a females calories for a day.

Respond with full name on matched food items

To improve matching, there are multiple shortened versions of food items entered in the foods lookup. The calorie calculation response should answer back with the full name that may include sizing details, not just what the user asked for.

For example, how many calories in a italian bmt returns the calorie count for a 6" Italian BMT, but doesn't clarify for a user. Same thing for fries. Typically the calorie count quoted is for a medium size, but would be helpful to clarify for the user to make sure an accurate response is being retrieved.

Sorting out Nuggets at Burger King

Need to add food type of nuggets/chicken nuggets at Burger king.

Also, spicy nuggets only has one quantity (10) so leaving this out should still resolve to the same entity.

How to handle Meals

Users can request a meal for the Food, but need to be able to sort out what the different items are for calorie counting.

Simple solution could be to attempt to search for the term "meal" and add fries as an extra for the user.

i.e. the request goes like this - "double quarter pounder with cheese meal".

currently it parses out double quarter pounder into a slot, but leaves off the fries (which is implied with the word meal).

Reset Session Data during second conversation

need to remove all details from the session after a new session begins else will get wierd summaries like the following.

Big Mac is 540 calories. Roast Beef Salad is 140 calories and the Greek Dressing adds 230 calories. 12 oz. Coke is 150 calories. Total Calories are 140.

(the big mac and coke were left over from the prior session)

Offer alternative pizza sizes with response

If the user does not respond with a pizza size, the answer comes back as a medium. This may not have been what the user intended, so add a prompt to allow the user to change pizza size.

asking for item at alternative restaurant

error messages when asking for foods available at alternative restaurants. for example, if someone asks for a thickburger at wendys. it's not a valid food item name for wendy's, but an item at burger king.

Right now it's just a generic message back "Sorry, I dont have information for Thick burger at Wendys . Please try again."

Better Error message for Pizza Hut

Don't have the menus yet, and the error message is confusing.

Sorry, I can't find cheese as a valid type of pizza at Pizza Hut. Say 'what types of pizza are there' for valid types.

It should respond to something like "Sorry, I don't have any information for Pizza Hut."

Side Items should be customized per restaurant

When a user gets prompted for a side item, it should pull from valid side items specific to the given restaurant.

For example, at Subway, should offer up Chips. Panera a Baguette, and Arby's Curly Fries.

humorous intent responses?

Could come up with some humorous responses to intents. for example, someone answers which restaurant with "I'm at home" - what could be a funny response and would it engage the user?

Expand Pizza Calorie response

Expand response on Pizza Calorie count to break down in calories per piece.

For example,
At Dominos, a Medium (12 inch) Pepperoni pizza is 1760 calories. The pizza comes cut in 8 slices.

add the following...
Each slice is 220 (1760/8) calories.

Create separate intent for Restaurant Name lookup

Given the different flows for nuggets, pizza, mexican food, burgers, etc. need to split out the restaurant only lookup as a unique intent. This will allow better transition to other flows, and then pass the restaurant name through in the session.

For example, the following flow.
1 - User begins. "Eating at Taco Bell". This invokes GetCalories intent, with the reply "What are you eating?".
2 - User replies "Chicken Burrito". The session stays in the GetCalories intent vs. switching over to the GetMexicanFoodCalories intent.

Need to provide food type options per restaurant

When providing the answer back to the question "What are my food options at xxx", the response is generic "What type of food (i.e. Burger, Salad, etc.)" and doesn't vary by restaurant. That's misleading for when the restaurant is Subway which doesn't have burgers, and the user can get stuck guessing sandwich, sub, etc. to no avail (the right food type right now is Footlong).

Adjustments to food

Add feature to perform common adjustments to food.

For example, with a Big Mac (540 calories)

  • Remove the cheese (-50 calories)
  • Remove the sauce (-90 calories)

And with a Quarter Pounder (530 calories)

  • Remove the cheese (-100 calories)
  • Remove half the bun (-85 calories)

Clear out food and extra items when restaurant fails

Scenario - user provides request "How many calories are in a whopper with only mayo and cheese". An error message is returned, but is difficult for the user to get out of as the slot details get persisted (in this example, Cheese).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.