Repository navigation
API change for digital-convert repo + minor algo and param optim edits
·
74 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
Born-digital lines get the same quality answer as OCR lines (atrium-digital-convert#4, W3): the common line-quality model now scores an existing record in place. The release also carries the #3 parameter work since v1.8.0-beta. The spec stays compatible: /score_record is a new endpoint, and nothing existing changed.
POST /score_record (atrium-digital-convert#4 W3)
- In:
document_json(required; any record, born-digital or OCR) and an optionalpages: the record's own page keys, comma-separated (i,ii,3). A key the record lacks is 422. - Scored: each
lines[]row with text, exactly as it is: no re-reading, splitting or reordering, so every answer maps back onto its row. The scorer is the same as on every other path, batched byPPL_BATCH_LINES. - Skipped and counted:
- lines that carry atrium-digital-convert's decode verdict (
categGarbageorInverted): their text layer does not decode, so the verdict stands; - lines without text.
- lines that carry atrium-digital-convert's decode verdict (
- Written:
lines[].categ/quality_score/langandpages[].quality_score/quality_band, on rows that already exist. Nevertext,bboxorsource, and never a new row. - Out:
cleaned_lines: theAltoLinefields, plus the record'sline.pageholds the record's page key (e.g.iv), not a 1-based index;pages[]:lines_scored,skipped_decode_verdict,skipped_empty,quality_score,quality_band;limits_applied;document_json: scored, or returned as sent when nothing was scored;paradata: the run'sCreateAction.
- Limits:
MAX_UPLOAD_MB(the record part),ATRIUM_TEXT_INGEST_MAX_PAGES(pages scored) andATRIUM_TEXT_INGEST_MAX_LINES_PER_PAGE(lines on one page), each413 limit_exceeded. A record that cannot be opened, or has nodoc_id, is422 invalid_record. - atrium-digital-convert's
POST /describecalls it whenOCR_POSTPROCESS_URLis set. Against an older version of this service, it falls back to/process, one page at a time. Those scores reach the/describereport only; the record is not written.
Record writes
document_hook.write_scores()is a scoring-only write path:- only the scoring fields above; any other field is refused before a file is opened;
- existing rows only;
- lines with a decode verdict are left alone;
- the result is validated before it is written.
- Re-vendored
atrium_document.py(SCORING_FIELDS). On a record another tool originated (a born-digital one), such a merge is a scoring co-contribution: noted, not refused, and stampedcontribution: "scoring". The record stays the converter's, and the fan-in accepts it. Any other write onto a foreign record is still refused unless a page asks for OCR (needs_ocr). This tool's own OCR records are unchanged. DIGITAL_CONVERT_KINDSgains ODT, ODS, XLSX and RTF, which atrium-digital-convertv1.1.0-betareads with this repository'stext_formats.py. This changes only the wording of the text-split report note.
Categorisation (#3)
- Witness floor (
rule_short_garbage_witness_floor), new and shipped off. With[TEXT_UTILS] SHORT_GARBAGE_WITNESS_FLOOR = true, a short line the cascade ratedClearbecomesNoisywhen the shape witness finds garbage in it.- It is off in
setup/config.txtand in the code, so categories do not change for any input. - The stage-13 figures are in the
setup/config.txtcomment, anddocs/categorization_logic.mddescribes the rule. Switching it on is the maintainers' call.
- It is off in
tools/ab_constant_eval.pyreports gold-Clearlines sent to another class (Clear-demoted). Its discordant dump gainsref_pred/arm_predandclear_lossrows. Developer tools only.
Note
setup/setup_api_server.sh now uses the virtualenv directory venv-ocr (it was venv-alto). An existing installation gets a fresh environment on the next run.
Assets
service_bundle.zip, openapi.json and openapi.json.sha256 (sha256sum -c openapi.json.sha256).
Full Changelog: v1.8.0-beta...v1.9.0-beta