Skip to content

Commit

Permalink
update ingredient postprocessing patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Nov 10, 2023
1 parent af40b55 commit 2b91a29
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion robotoff/prediction/ingredient_list/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@
ASTERISK_SYMBOL = r"((\* ?=?|\(¹\)|\") ?)"
FROM_ORGANIC_FARMING_FR = r"issus? de l'agriculture (biologique|bio|durable)"
ORGANIC_MENTIONS_RE = re.compile(
# fr
rf"{ASTERISK_SYMBOL}?ingr[ée]dients?( agricoles?)? {FROM_ORGANIC_FARMING_FR}"
rf"|{ASTERISK_SYMBOL}?produits? {FROM_ORGANIC_FARMING_FR}"
rf"|{ASTERISK_SYMBOL}?{FROM_ORGANIC_FARMING_FR}"
# en
rf"|{ASTERISK_SYMBOL}organic( farming)?"
# de
rf"|{ASTERISK_SYMBOL}?aus biologischer landwirtschaft"
# es
rf"|{ASTERISK_SYMBOL}?procedentes del cultivo ecol[óo]gico"
rf"|{ASTERISK_SYMBOL}?de cultivo ecol[óo]gico certificado"
rf"|{ASTERISK_SYMBOL}?ingredientes? ecol[óo]gicos?",
rf"|{ASTERISK_SYMBOL}?ingredientes? ecol[óo]gicos?"
# it
rf"|{ASTERISK_SYMBOL}?biologico",
re.I,
)

Expand Down

0 comments on commit 2b91a29

Please sign in to comment.