Spaces:
Paused
Paused
Commit
•
bddf171
1
Parent(s):
ee698cf
fixed err in wweia category mapper
Browse files
category_mapper.py
CHANGED
@@ -23,6 +23,7 @@ file_path = './dictionary/final_corrected_wweia_food_category_complete - final_c
|
|
23 |
spreadsheet = pd.read_csv(file_path)
|
24 |
|
25 |
def find_best_category(food_item, category, dataframe):
|
|
|
26 |
filtered_df = dataframe[dataframe['closest_category'] == category]
|
27 |
if not filtered_df.empty:
|
28 |
descriptions = filtered_df['wweia_food_category_description'].tolist()
|
|
|
23 |
spreadsheet = pd.read_csv(file_path)
|
24 |
|
25 |
def find_best_category(food_item, category, dataframe):
|
26 |
+
print(food_item, category)
|
27 |
filtered_df = dataframe[dataframe['closest_category'] == category]
|
28 |
if not filtered_df.empty:
|
29 |
descriptions = filtered_df['wweia_food_category_description'].tolist()
|
dictionary/final_corrected_wweia_food_category_complete - final_corrected_wweia_food_category_complete.csv
CHANGED
@@ -17,7 +17,7 @@ wweia_food_category,wweia_food_category_description,closest_category,,Leakage Fo
|
|
17 |
2004,Ground beef,Beef Products,,Meat,4%,,Snacks,10%
|
18 |
2006,Pork,Pork Products,,Meat,4%,,Sweets,10%
|
19 |
2008,"Lamb, goat, game","Lamb, Veal, and Game Products",,Meat,4%,,Fruits and Fruit Juices,12%
|
20 |
-
2010,Liver and organ meats,Beef Products,,Meat,4%,,
|
21 |
2202,"Chicken, whole pieces",Poultry Products,,Meat,4%,,Beverages,10%
|
22 |
2204,"Chicken patties, nuggets and tenders",Poultry Products,,Meat,4%,,Alcoholic Beverages,10%
|
23 |
2206,"Turkey, duck, other poultry",Poultry Products,,Meat,4%,,Fats and Oils,21%
|
@@ -97,23 +97,23 @@ wweia_food_category,wweia_food_category_description,closest_category,,Leakage Fo
|
|
97 |
6020,Pears,Fruits and Fruit Juices,,Fruits,12%,,,
|
98 |
6022,Pineapple,Fruits and Fruit Juices,,Fruits,12%,,,
|
99 |
6024,Mango and papaya,Fruits and Fruit Juices,,Fruits,12%,,,
|
100 |
-
6402,Tomatoes,
|
101 |
-
6404,Carrots,
|
102 |
-
6406,Other red and orange vegetables,
|
103 |
-
6407,Broccoli,
|
104 |
-
6409,Spinach,
|
105 |
-
6410,Lettuce and lettuce salads,
|
106 |
-
6411,Other dark green vegetables,
|
107 |
-
6412,String beans,
|
108 |
-
6413,Cabbage,
|
109 |
-
6414,Onions,
|
110 |
-
6416,Corn,
|
111 |
-
6418,Other starchy vegetables,
|
112 |
-
6420,Other vegetables and combinations,
|
113 |
6430,Fried vegetables,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
114 |
6432,"Coleslaw, non-lettuce salads","Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
115 |
6489,Vegetables on a sandwich,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
116 |
-
6802,"White potatoes, baked or boiled",
|
117 |
6804,French fries and other fried white potatoes,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
118 |
6806,Mashed potatoes and white potato mixtures,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
119 |
7002,Citrus juice,Fruits and Fruit Juices,,Fruits,12%,,,
|
@@ -146,7 +146,7 @@ wweia_food_category,wweia_food_category_description,closest_category,,Leakage Fo
|
|
146 |
8402,Tomato-based condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
147 |
8404,Soy-based condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
148 |
8406,Mustard and other condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
149 |
-
8408,"Olives, pickles, pickled vegetables",
|
150 |
8410,"Pasta sauces, tomato-based",Condiments and Sauces,,Miscellaneous,10%,,,
|
151 |
8412,"Dips, gravies, other sauces",Condiments and Sauces,,Miscellaneous,10%,,,
|
152 |
8802,Sugars and honey,Sweets,,Miscellaneous,10%,,,
|
|
|
17 |
2004,Ground beef,Beef Products,,Meat,4%,,Snacks,10%
|
18 |
2006,Pork,Pork Products,,Meat,4%,,Sweets,10%
|
19 |
2008,"Lamb, goat, game","Lamb, Veal, and Game Products",,Meat,4%,,Fruits and Fruit Juices,12%
|
20 |
+
2010,Liver and organ meats,Beef Products,,Meat,4%,,Vegetables and Vegetable Products,9%
|
21 |
2202,"Chicken, whole pieces",Poultry Products,,Meat,4%,,Beverages,10%
|
22 |
2204,"Chicken patties, nuggets and tenders",Poultry Products,,Meat,4%,,Alcoholic Beverages,10%
|
23 |
2206,"Turkey, duck, other poultry",Poultry Products,,Meat,4%,,Fats and Oils,21%
|
|
|
97 |
6020,Pears,Fruits and Fruit Juices,,Fruits,12%,,,
|
98 |
6022,Pineapple,Fruits and Fruit Juices,,Fruits,12%,,,
|
99 |
6024,Mango and papaya,Fruits and Fruit Juices,,Fruits,12%,,,
|
100 |
+
6402,Tomatoes,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
101 |
+
6404,Carrots,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
102 |
+
6406,Other red and orange vegetables,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
103 |
+
6407,Broccoli,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
104 |
+
6409,Spinach,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
105 |
+
6410,Lettuce and lettuce salads,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
106 |
+
6411,Other dark green vegetables,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
107 |
+
6412,String beans,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
108 |
+
6413,Cabbage,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
109 |
+
6414,Onions,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
110 |
+
6416,Corn,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
111 |
+
6418,Other starchy vegetables,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
112 |
+
6420,Other vegetables and combinations,Vegetables and Vegetable Products,,Vegetables,9%,,,
|
113 |
6430,Fried vegetables,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
114 |
6432,"Coleslaw, non-lettuce salads","Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
115 |
6489,Vegetables on a sandwich,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
116 |
+
6802,"White potatoes, baked or boiled",Vegetables and Vegetable Products,,Vegetables,9%,,,
|
117 |
6804,French fries and other fried white potatoes,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
118 |
6806,Mashed potatoes and white potato mixtures,"Meals, Entrees, and Side Dishes",,Miscellaneous,10%,,,
|
119 |
7002,Citrus juice,Fruits and Fruit Juices,,Fruits,12%,,,
|
|
|
146 |
8402,Tomato-based condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
147 |
8404,Soy-based condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
148 |
8406,Mustard and other condiments,Condiments and Sauces,,Miscellaneous,10%,,,
|
149 |
+
8408,"Olives, pickles, pickled vegetables",Vegetables and Vegetable Products,,Vegetables,9%,,,
|
150 |
8410,"Pasta sauces, tomato-based",Condiments and Sauces,,Miscellaneous,10%,,,
|
151 |
8412,"Dips, gravies, other sauces",Condiments and Sauces,,Miscellaneous,10%,,,
|
152 |
8802,Sugars and honey,Sweets,,Miscellaneous,10%,,,
|