Spaces:
Runtime error
Runtime error
Commit
·
9c50a04
1
Parent(s):
6bb687d
Update app.py
Browse files
app.py
CHANGED
@@ -107,6 +107,7 @@ def main(audio):
|
|
107 |
print(f"You said: {command}")
|
108 |
txt_command ="extract the food related command keyword from the sentence :\n\n"+command
|
109 |
food_command = (" ".join(nlp(txt_command).strip().split()[-1:])).lower()
|
|
|
110 |
|
111 |
restaurant_name = ''
|
112 |
txt_extract = "extract the restaurants name keyword from the sentence :\n\n"+command
|
@@ -114,6 +115,7 @@ def main(audio):
|
|
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
|
@@ -121,9 +123,10 @@ def main(audio):
|
|
121 |
found_item = False
|
122 |
for restaurant, rest_info in restaurants.items():
|
123 |
if item_name in rest_info:
|
124 |
-
found_item =
|
|
|
125 |
|
126 |
-
|
127 |
if food_command in ['order', 'eat' , 'want' , 'serve' , 'prepare' ]:
|
128 |
if not found_rest and found_item:
|
129 |
temp_val = {}
|
|
|
107 |
print(f"You said: {command}")
|
108 |
txt_command ="extract the food related command keyword from the sentence :\n\n"+command
|
109 |
food_command = (" ".join(nlp(txt_command).strip().split()[-1:])).lower()
|
110 |
+
print(food_command)
|
111 |
|
112 |
restaurant_name = ''
|
113 |
txt_extract = "extract the restaurants name keyword from the sentence :\n\n"+command
|
|
|
115 |
found_rest = False
|
116 |
if(restaurant_name in restaurants.keys()):
|
117 |
found_rest = True
|
118 |
+
print(restaurant_name)
|
119 |
|
120 |
item_name = ''
|
121 |
txt_extract = "extract the food item from the sentence :\n\n"+command
|
|
|
123 |
found_item = False
|
124 |
for restaurant, rest_info in restaurants.items():
|
125 |
if item_name in rest_info:
|
126 |
+
found_item = Tru
|
127 |
+
print(item_name)
|
128 |
|
129 |
+
print(found_item , found_rest)
|
130 |
if food_command in ['order', 'eat' , 'want' , 'serve' , 'prepare' ]:
|
131 |
if not found_rest and found_item:
|
132 |
temp_val = {}
|