m3hrdadfi commited on
Commit
db5385f
1 Parent(s): 21ff7c3

Fix data preparation

Browse files
src/preparaing_recipe_nlg_dataset.py CHANGED
@@ -92,13 +92,14 @@ def main():
92
  ingredients = item_dict["ingredients"]
93
  steps = item_dict["directions"]
94
 
95
- condition_1 = filter_by_item(ner, 2)
96
- condition_2 = filter_by_length(title, 4)
97
- condition_3 = filter_by_item(ingredients, 2)
98
- condition_4 = filter_by_item(steps, 2)
99
- condition_5 = filter_by_steps(" ".join(steps))
100
-
101
- if not all([condition_1, condition_2, condition_3, condition_4, condition_5]):
 
102
  return None
103
 
104
  ner = ", ".join(ner)
 
92
  ingredients = item_dict["ingredients"]
93
  steps = item_dict["directions"]
94
 
95
+ conditions = []
96
+ conditions += filter_by_item(ner, 2)
97
+ conditions += filter_by_length(title, 4)
98
+ conditions += filter_by_item(ingredients, 2)
99
+ conditions += filter_by_item(steps, 2)
100
+ # conditions += filter_by_steps(" ".join(steps))
101
+
102
+ if not all(conditions):
103
  return None
104
 
105
  ner = ", ".join(ner)