victorialslocum commited on
Commit
0b93d5b
1 Parent(s): 8282bc9

fix ingredients list

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -43,13 +43,15 @@ def get_recipe_data(recipe_url):
43
 
44
  def get_ingredient_data(instructions, ingredients):
45
  doc = nlp(instructions)
 
46
 
47
  ingredients_list = []
48
 
49
  # TODO: add lemmatizer
50
- for ent in doc.ents:
51
- if ent not in ingredients_list:
52
- ingredients_list.append(ent)
 
53
 
54
  ingredients = ""
55
 
 
43
 
44
  def get_ingredient_data(instructions, ingredients):
45
  doc = nlp(instructions)
46
+ print(doc)
47
 
48
  ingredients_list = []
49
 
50
  # TODO: add lemmatizer
51
+ for item in doc:
52
+ if item[1] == 'INGREDIENT':
53
+ if item[0] not in ingredients_list:
54
+ ingredients_list.append(item[0])
55
 
56
  ingredients = ""
57