Skip to content

Commit a5ee708

Browse files
committed
Feature: Remove cucumber from overrides - not needed and the stemmed version of cucumber would not match anyway.
Increase threshold for checking alternative matches in FuzzyEmbeddingMatcher._select_best_match
1 parent db0933c commit a5ee708

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

ingredient_parser/en/_foundationfoods.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@
3434
"Dairy and Egg Products",
3535
"foundation_food",
3636
),
37-
("cucumber",): FoundationFood(
38-
"Cucumber, with peel, raw",
39-
1,
40-
2346406,
41-
"Vegetables and Vegetable Products",
42-
"foundation_food",
43-
),
4437
("garlic",): FoundationFood(
4538
"Garlic, raw",
4639
1,
@@ -510,7 +503,7 @@ def _select_best_match(
510503

511504
# Find other matches with score within 10% of best
512505
alternatives = [
513-
match for match in matches if (match.score - best_score) / best_score <= 0.1
506+
match for match in matches if (match.score - best_score) / best_score <= 0.2
514507
]
515508
for data_type in PREFERRED_DATATYPES:
516509
# Note that these will be sorted in order of best score first because the

0 commit comments

Comments
 (0)