Skip to main content
Home

Born-digital document converter: PDF and office files into structured text without OCR - ATRIUM

Reads documents that were created on a computer rather than scanned, and writes their text with its structure into the ATRIUM document record (JSON), without OCR: pages, text lines in reading order grouped into blocks, and the headings, running headers and footers, footnotes and tables the format carries. The two kinds of input differ. From a PDF it takes the page geometry: the size of each page and the position of every line, with headings recognised from the size and weight of the type. From an office document (DOCX, ODT, ODS, XLSX, RTF, and the legacy DOC and XLS through LibreOffice) it takes the structure the format declares, with no positions on the page. The type is recognised from the file's content, not its extension.

The text layer of every page is checked. A page without a text layer, with one that does not decode, or with one left by an earlier OCR run is flagged as needing OCR, with the reason, so that only such pages go to OCR; a PDF that is mostly an earlier OCR run is refused as not born-digital. Pages with substantial character loss from unmapped glyphs are also flagged as needing OCR and their text layer is marked as garbled. On request the record is also rendered as annotated Markdown in reading order.

REST API container image (ghcr.io/ufal/atrium-digital-convert-api): /reformat returns the record; /describe adds a per-page assessment with the suggested next step (NLP, OCR or handwritten text recognition), asking the ATRIUM page classifier and OCR post-processor when they are available. The command line gives the same results, the per-page assessment included. The default engine needs no OCR, no model and no network; an optional layout-model engine for complex PDFs (Docling) runs only on the command line, in a local build. The API returns the provenance of every run (paradata); the command line writes it on request.

The code is MIT.

ComponentLicenceUsed when
pdfplumber, pdfminer.sixMITPDF: words, their positions, fonts and ruled tables.
pypdfium2Apache-2.0PDF: page labels, text-layer checks and page counts.
python-docx; lxml; text_formats (vendored)MIT; BSD-3-Clause; MITOffice documents (DOCX, ODT, ODS, XLSX, RTF).
jsonschemaMITEvery record is validated before it is returned.
LibreOfficeMPL 2.0DOC and XLS are converted to DOCX and XLSX before reading; not listed by a run, as it adds no text.
Docling, docling-parse; layout and table-structure weightsMIT; Apache-2.0, CDLA-Permissive-2.0Only the optional Docling engine (command line, local build).

Each run lists the components it used, each with its own licence or terms. None of these is the licence of the output: the rights in an output depend first on the source document, and only their holder can state them (Licences and paradata).

European Union flag

The SSH Open Marketplace is maintained and will be further developed by three European Research Infrastructures - DARIAH, CLARIN and CESSDA - and their national partners. It was developed as part of the "Social Sciences and Humanities Open Cloud" SSHOC project, European Union's Horizon 2020 project call H2020-INFRAEOSC-04-2018, grant agreement #823782.

CESSDACLARINDARIAH-EU