Skip to content

Record Schema 2.0 update of `atrium_document`

Choose a tag to compare

@github-actions github-actions released this 28 Nov 11:44
· 11 commits to master since this release
Immutable release. Only release title and notes can be modified.

Major release on top of v1.15.4-beta: the record moves to schema 2.0 (atrium-project#84), so the major version moves.

New

  • The record builder: build_record.py and POST /build_record build the record from a docproc, whoever wrote it. Every page gets a row, and lines come in reading order with their docproc block, text source and box precision.
  • Mixed documents are built from the ATR's docproc and digital-convert's (--text-layer-docproc, text_layer_docproc):
    • the text layer's exact lines are kept;
    • the ATR's lines fill the forced pages and the blocks no kept line falls into;
    • a forced page takes the ATR's lines, for an office document as for a PDF (#84 decision 3).
  • digital-convert's figure blocks (no lines, no imageRef) are read as blocks without lines (#84 decision 6).

Changed

  • Every line is scored with one model, then the batch's document passes. A block scored as one unit is marked unit: block and kept out of the page score; an empty page has no score.
  • /process and /score_record answer in the record's field names: line (was line_num), categ (was category), and page_index and page (were page and page_label). /info line_fields follows. docproc's decode flags read as decode:garbled and decode:inverted.
  • Spreadsheets keep every cell: an ODS row keeps each non-empty cell as the sheet displays it (atrium-digital-convert#9).
  • Paradata 3.0 name the docproc and seed read and the record written, by distribution name and SHA-512.
  • The batch scripts keep only settings and models in config (#84 decision 1c). Every file they read or write is named by file name and SHA-512, stored: false. classify_TEXT.py and aggregate_STAT.py also name the records they write.
  • No calculated licence anywhere; an RO-Crate root names #no-licence-asserted.
  • CI runs on pull requests and releases only (atrium-project#40). The hub's workflows are pinned to ff0a8ea.

Fails the job instead of writing a partial record

  • Each of these fails the job:
    • a docproc that cannot be read;
    • a page that was not read;
    • a page that needs the ATR, sent without the ATR's docproc;
    • two docprocs that disagree on pages, forced pages or page sizes.
  • /score_record answers a line it cannot score whole with 422 limit_exceeded.

Compatibility

  • Records are schema 2.0; a 1.x record is migrated as it is read.
  • ocr_handoff, skipped_decode_verdict and ATRIUM_TEXT_INGEST_PDF_OBJECT_CAP are gone. The batch CSVs keep their column names.
  • data_samples/RECORD/ and data_samples/paradata/ (the records and one batch run) are this version's.

Also included, parked during the pilot: tools/decide_lines.py and its decision files (atrium-project#83). They are not run by the service or the pipeline.

Images this release certifies (images.json, atrium-project#81):

  • ghcr.io/ufal/atrium-ocr-postprocess:2.0.0-beta = sha256:e8196d49ff441bcf89b447422484c475f091ab6c3e3624a5aec25e1642333f83
  • ghcr.io/ufal/atrium-ocr-postprocess-api:2.0.0-beta = sha256:e9969c344a9603b9b09d8c3df187927647a77bb389fde25f9fcd8fcd7404e932

What's Changed

New Contributors

  • @K4TEL made their first contribution in #11

Full Changelog: v1.15.4-beta...v2.0.0-beta