AashishKumar commited on
Commit
6bb687d
·
1 Parent(s): 14364bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -110,17 +110,18 @@ def main(audio):
110
 
111
  restaurant_name = ''
112
  txt_extract = "extract the restaurants name keyword from the sentence :\n\n"+command
113
- restaurant_name = " ".join(((nlp(txt_extract)).strip()).title().split()[-2:]))
114
  found_rest = False
115
  if(restaurant_name in restaurants.keys()):
116
  found_rest = True
117
 
118
  item_name = ''
119
  txt_extract = "extract the food item from the sentence :\n\n"+command
120
- item_name = " ".join( ((nlp(txt_extract)).strip()).title().strip(".,;:").split()[-2:])
121
  found_item = False
122
- if(restaurant_name in restaurants.keys()):
123
- found_item = True
 
124
 
125
 
126
  if food_command in ['order', 'eat' , 'want' , 'serve' , 'prepare' ]:
 
110
 
111
  restaurant_name = ''
112
  txt_extract = "extract the restaurants name keyword from the sentence :\n\n"+command
113
+ restaurant_name = " ".join(((nlp(txt_extract)).strip()).title().split()[-2:])
114
  found_rest = False
115
  if(restaurant_name in restaurants.keys()):
116
  found_rest = True
117
 
118
  item_name = ''
119
  txt_extract = "extract the food item from the sentence :\n\n"+command
120
+ item_name = " ".join(((nlp(txt_extract)).strip()).title().strip(".,;:").split()[-2:])
121
  found_item = False
122
+ for restaurant, rest_info in restaurants.items():
123
+ if item_name in rest_info:
124
+ found_item = True
125
 
126
 
127
  if food_command in ['order', 'eat' , 'want' , 'serve' , 'prepare' ]: