Describe the bug
The expiration-date OCR extractor (robotoff/prediction/ocr/expiration_date.py) filters out any detected date whose year falls outside a hardcoded window:
if date.year > 2025 or date.year < 2015:
continue
The upper bound (2025) is now in the past. As a result, every valid expiration / best-before date from 2026 onwards - which is the normal case for products currently on shelves - is silently discarded and no expiration_date prediction is produced.
To reproduce
from robotoff.prediction.ocr.expiration_date import find_expiration_date
find_expiration_date("À consommer de préférence avant 14.06.2026") # -> [] (expected: one prediction)
Suggested fix
Compute the plausibility window relative to the current date instead of hardcoding the bounds, so it filters OCR noise without going stale as years pass. PR incoming.
Describe the bug
The expiration-date OCR extractor (
robotoff/prediction/ocr/expiration_date.py) filters out any detected date whose year falls outside a hardcoded window:The upper bound (2025) is now in the past. As a result, every valid expiration / best-before date from 2026 onwards - which is the normal case for products currently on shelves - is silently discarded and no
expiration_dateprediction is produced.To reproduce
Suggested fix
Compute the plausibility window relative to the current date instead of hardcoding the bounds, so it filters OCR noise without going stale as years pass. PR incoming.