Add a local searchable-PDF orientation reader, a stale OCR example, and verified results on 343 USGS and 553 Bengali archive pages
88248d0 verified Download text-layer/study/native_report.py from foliokestrel/folio-orient: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/foliokestrel/folio-orient/resolve/main/text-layer/study/native_report.py
- Command line
-
hf download hf://foliokestrel/folio-orient/text-layer/study/native_report.py
-
curl -L -o native_report.py https://huggingface.co/foliokestrel/folio-orient/resolve/main/text-layer/study/native_report.py
568 Bytes
| """Classify one native-view orientation decision.""" | |
| def outcome(truth, prediction, accepted): | |
| if truth is None: | |
| if not accepted: | |
| return "unclear_referred" | |
| return "unclear_changed" if prediction else "unclear_kept" | |
| if not accepted: | |
| return "upright_referred" if truth==0 else "turned_referred" | |
| if truth==0: | |
| return "upright_wrong_change" if prediction else "upright_correct_keep" | |
| if prediction==truth: | |
| return "turned_corrected" | |
| return "turned_wrong_change" if prediction else "turned_wrong_keep" | |