Skip to content

Commit

Permalink
Bugfix: Fix export of database to csv so the name field is populated
Browse files Browse the repository at this point in the history
  • Loading branch information
strangetom committed Jan 31, 2025
1 parent ff4dcbd commit 2bc7bc1
Show file tree
Hide file tree
Showing 7 changed files with 81,319 additions and 81,315 deletions.
29,998 changes: 14,999 additions & 14,999 deletions train/data/allrecipes/allrecipes-ingredients-snapshot-2017.csv

Large diffs are not rendered by default.

30,000 changes: 15,000 additions & 15,000 deletions train/data/bbc/bbc-ingredients-snapshot-2017.csv

Large diffs are not rendered by default.

29,999 changes: 14,999 additions & 15,000 deletions train/data/cookstr/cookstr-ingredients-snapshot-2017.csv

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions train/data/db_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@ def create_csv_value(db_row: dict[str, str], label: str) -> str:
str
Constructed value to insert into csv
"""
tokens = [
tok for tok, lab in zip(db_row["tokens"], db_row["labels"]) if lab == label
]
if label == "NAME":
tokens = [
tok for tok, lab in zip(db_row["tokens"], db_row["labels"]) if label in lab
]
else:
tokens = [
tok for tok, lab in zip(db_row["tokens"], db_row["labels"]) if lab == label
]
return " ".join(tokens)


Expand Down
59,996 changes: 29,998 additions & 29,998 deletions train/data/nytimes/nyt-ingredients-snapshot-2015.csv

Large diffs are not rendered by default.

12,630 changes: 6,315 additions & 6,315 deletions train/data/tastecooking/tastecooking-ingredients-snapshot-2024.csv

Large diffs are not rendered by default.

Binary file modified train/data/training.sqlite3
Binary file not shown.

0 comments on commit 2bc7bc1

Please sign in to comment.