beweinreich commited on
Commit
4a1be51
1 Parent(s): ecfb899

prefer food items, but if there are none, then lets skip it

Browse files
Files changed (1) hide show
  1. multi_food_item_detector.py +2 -0
multi_food_item_detector.py CHANGED
@@ -51,6 +51,8 @@ def extract_items(text):
51
 
52
  # Get the food items
53
  food_items = extract_food_phrases(text)
 
 
54
 
55
  # Find the items that were not matched as food items
56
  non_food_items = [item for item in items if item not in food_items]
 
51
 
52
  # Get the food items
53
  food_items = extract_food_phrases(text)
54
+ if len(food_items) > 0:
55
+ return food_items
56
 
57
  # Find the items that were not matched as food items
58
  non_food_items = [item for item in items if item not in food_items]