Line 1: |
Line 1: |
| + | [[Category:Robotoff]] |
| == Finding opportunities == | | == Finding opportunities == |
| + | === Option 1 === |
| # Download the OCR JSONL | | # Download the OCR JSONL |
− | # <pre>grep -o '\<WORD\>' | wc -l</pre> | + | # <pre>zgrep -n '05.01.07' FILE | wc -l</pre> |
− | == Using REGEXes == | + | |
| + | === Option 2 === |
| + | # Right click on an image in a product page, in edit mode (eg 1.jpg) |
| + | # Replace `.jpg` by `.json` |
| + | # Find patterns or `logoAnnotations` in the JSON |
| + | |
| + | == Adding detections using REGEXes == |
| https://github.com/openfoodfacts/robotoff/tree/master/robotoff/insights/ocr | | https://github.com/openfoodfacts/robotoff/tree/master/robotoff/insights/ocr |
| | | |
Line 39: |
Line 47: |
| === Grab yourself a sandwich === | | === Grab yourself a sandwich === |
| | | |
− | == Using Flashtext == | + | == Adding detections using Flashtext == |
| https://github.com/openfoodfacts/robotoff/tree/master/data/ocr | | https://github.com/openfoodfacts/robotoff/tree/master/data/ocr |
− | === Choose a file matching the detection you want to add === | + | === Expanding existing detections === |
| + | * Choose a file matching the detection you want to add |
| In this example: https://github.com/openfoodfacts/robotoff/blob/master/data/ocr/brand_logo_annotation.txt | | In this example: https://github.com/openfoodfacts/robotoff/blob/master/data/ocr/brand_logo_annotation.txt |
| + | * Add entries one per line. The raw `logoAnnotation` you find in the OCR JSON is on the left, the value you want to add in the brand field is on the right. |
| <pre> | | <pre> |
| alnatura||Alnatura | | alnatura||Alnatura |
Line 48: |
Line 58: |
| andros||Andros | | andros||Andros |
| </pre> | | </pre> |
− |
| |
| | | |
| === Add a new type of detection === | | === Add a new type of detection === |