Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added origin extraction #890

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c65438d
Added origin extraction
ValentinRegnault Sep 8, 2022
e07cac9
Modifications to follow Semantic PRs
ValentinRegnault Sep 8, 2022
bf7dc9f
Removed unused import, and one useless statement
ValentinRegnault Sep 10, 2022
b77360d
Update robotoff/prediction/ocr/origin.py
ValentinRegnault Sep 13, 2022
eeb2c64
Update robotoff/prediction/ocr/origin.py
ValentinRegnault Sep 13, 2022
bb64958
Update robotoff/prediction/ocr/origin.py
ValentinRegnault Sep 13, 2022
6bb5767
Origin parser put in a class, with lazy initialization + small changes
ValentinRegnault Sep 14, 2022
668d2fc
Origin parser put in a class, with lazy initialization + small changes
ValentinRegnault Sep 14, 2022
31f07e5
repair last commit :/
ValentinRegnault Sep 14, 2022
ccba94c
small tweaks
ValentinRegnault Sep 14, 2022
c142504
Delete temp.txt
ValentinRegnault Sep 24, 2022
6d0af13
Delete temp2.txt
ValentinRegnault Sep 24, 2022
cc72baf
Small tweaks suggested by raphael0202
ValentinRegnault Sep 24, 2022
335e563
Revert .env
ValentinRegnault Sep 26, 2022
ee351bb
Added origin extraction
ValentinRegnault Oct 11, 2022
9806baa
remove useless comment
ValentinRegnault Oct 11, 2022
6228811
Merge branch 'master' of https://github.com/Pykorm/robotoff
ValentinRegnault Oct 11, 2022
64bf201
Revert "Merge branch 'master' of https://github.com/Pykorm/robotoff"
ValentinRegnault Oct 11, 2022
69c685d
Revert "remove useless comment"
ValentinRegnault Oct 11, 2022
8c48f12
Revert "Added origin extraction"
ValentinRegnault Oct 11, 2022
433ae15
Merge branch 'master' into master
ValentinRegnault Oct 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update robotoff/prediction/ocr/origin.py
Co-authored-by: Alex Garel <[email protected]>
ValentinRegnault and alexgarel authored Sep 13, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit eeb2c64b5daa31c3e6ba7b89ff78cd7e5fadb3f3
5 changes: 1 addition & 4 deletions robotoff/prediction/ocr/origin.py
Original file line number Diff line number Diff line change
@@ -205,10 +205,7 @@ def check_if_general_word_in_ingredients(general_words_regex: List[str], ingredi
Utility function for checking if one of the general words like 'elements' or 'ingredients' is
present in the list of ingredients returned by extract_ingredients_from_match_string
"""
for reg in general_words_regex:
if re.search(reg, ingredients) is not None:
return True
return False
return any(re.search(reg, ingredients) is not None for reg in general_words_regex)

def extract_origin_from_match (origin_match, lang: str) -> str:
if origin_match.group("in_or_outside") is not None and origin_match.group("in_or_outside") in OUTSIDE_WORDS_BY_LANG[lang]: