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

Aperta
#335 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@duckduckgrayduck ci sta già lavorando.

Dal 22/9/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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

Lingua principale
Python
Stelle
55
Fork
10
Merge medio
1g 13h
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MuckRock/documentcloud

Tutte le issue di MuckRock/documentcloud

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.