Better document that setting an ocr_engine means that if no text layer is found, it will use this engine, regardless of force_ocr

Offen
#335 2 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@duckduckgrayduck arbeitet bereits daran.

Seit 22.9.2025.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

documentation

Testing out some improvements python-documentcloud library, I discovered an unintended behavior that should be fixed.

2025-09-22 13:55:08,772 INFO squarelet request: post - documents/process/ - {'json': [{'id': 26105881, 'force_ocr': False, 'ocr_engine': 'textract'}, {'id': 26105882, 'force_ocr': False, 'ocr_engine': 'textract'}]}
2025-09-22 13:55:08,774 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): api.www.documentcloud.org:443
2025-09-22 13:55:09,088 DEBUG urllib3.connectionpool https://api.www.documentcloud.org:443 "POST /api/documents/process/ HTTP/1.1" 200 None
2025-09-22 13:55:09,088 DEBUG squarelet response: 200 - b'"OK"'
2025-09-22 13:55:09,094 INFO documentcloud Process payload: [{'id': 26105881, 'force_ocr': False, 'ocr_engine': 'textract'}, {'id': 26105882, 'force_ocr': False, 'ocr_engine': 'textract'}]
2025-09-22 13:55:09,094 INFO documentcloud Upload directory complete

This document: https://www.documentcloud.org/documents/26105882-test/, despite having ocr_engine:False and an ocr_engine specified, because the document didn't have a text layer provided, DocumentCloud used the provided OCR engine to run OCR anyway. Since our policy is to run OCR if no text layer is detected, it should use tesseract and ignore the provided ocr_engine since force_ocr was explicitly set to False.

I am handling this in the python-documentcloud library so that it can't happen, but we should probably also fix this behavior on the backend

Vorherrschende Sprache
Python
Sterne
55
Forks
10
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
22

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus MuckRock/documentcloud

Alle Issues in MuckRock/documentcloud

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.