Skip to content

Commit

Permalink
fix: replace with fr prefix references to en:ab-agriculture-biologique (
Browse files Browse the repository at this point in the history
#919)

fr:ab-agriculture-biologique is the correct version
  • Loading branch information
raphael0202 authored Oct 3, 2022
1 parent 239eacd commit ec1500c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/ocr/label_logo_annotation.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
igp||en:pgi
label ab||en:ab-agriculture-biologique
label ab||fr:ab-agriculture-biologique
label rouge vectoriel||en:label-rouge
label rouge||en:label-rouge
produit en bretagne||en:produced-in-bretagne
Expand Down
2 changes: 1 addition & 1 deletion data/ocr/label_whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ en:no-lactose
en:palm-oil-free
en:max-havelaar
en:organic
en:ab-agriculture-biologique
fr:ab-agriculture-biologique
en:no-flavors
en:no-artificial-flavors
en:vegan
Expand Down
2 changes: 1 addition & 1 deletion robotoff/insights/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

LABEL_IMAGES = {
"en:eu-organic": LABEL_IMG_BASE_URL + "/en/labels/eu-organic.135x90.svg",
"en:ab-agriculture-biologique": LABEL_IMG_BASE_URL
"fr:ab-agriculture-biologique": LABEL_IMG_BASE_URL
+ "/fr/labels/ab-agriculture-biologique.74x90.svg",
"en:european-vegetarian-union": LABEL_IMG_BASE_URL
+ "/en/labels/european-vegetarian-union.90x90.svg",
Expand Down
2 changes: 1 addition & 1 deletion robotoff/prediction/ocr/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def process_es_bio_label_code(match) -> str:
processing_func=process_es_bio_label_code,
),
],
"en:ab-agriculture-biologique": [
"fr:ab-agriculture-biologique": [
OCRRegex(
re.compile(r"certifi[ée] ab[\s.,)]"),
field=OCRField.full_text_contiguous,
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/models_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Meta:
score = 0.7
annotation_value = "ab agriculture biologique"
annotation_value_tag = "ab-agriculture-biologique"
taxonomy_value = "en:ab-agriculture-biologique"
taxonomy_value = "fr:ab-agriculture-biologique"
annotation_type = "label"
nearest_neighbors = {"logo_ids": [111111, 222222], "distances": [11.1, 12.4]}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/prediction/ocr/test_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_es_ocr_regex(input_str: str, is_match: bool, output: Optional[str]):
@pytest.mark.parametrize(
"text,value_tags",
[
("certifié ab.", ["en:ab-agriculture-biologique"]),
("certifié ab.", ["fr:ab-agriculture-biologique"]),
("décret du 5/01/07", ["en:label-rouge"]),
("DECRET du 05.01.07", ["en:label-rouge"]),
("Homologation n° LA 21/88", ["en:label-rouge"]),
Expand Down

0 comments on commit ec1500c

Please sign in to comment.