Recovering Text from Endangered Languages Corrupted PDF documents

Nicolas StefanovitchACL 2022

TL;DR

This paper introduces an interactive system to recover text from corrupted PDF documents of endangered languages, where standard tools fail due to missing or incorrect font mappings. By leveraging user input and a novel interactive approach, the system significantly speeds up the creation of usable text corpora for these languages, aiding in their preservation.

What Problem Does This Paper Address?

Endangered languages often have very limited digital resources, and the few that exist are frequently in PDF format. A major hurdle is that these PDFs can be "corrupted" in two ways: either they contain scanned images (which requires OCR) or, more commonly for born-digital documents, the font encoding is broken. This means that when you try to copy-paste text, you get gibberish or missing characters because the mapping from the PDF's internal character identifiers (CIDs) to actual Unicode characters is incorrect or incomplete. This renders these valuable documents unusable for linguistic analysis, corpus building, and even basic searchability, effectively hiding the language from wider study and preservation efforts.

Methods

The paper proposes an interactive system that tackles the corrupted font mapping problem. It operates in two phases:

  1. Automatic Recovery: The system first attempts to heuristically identify the CIDs corresponding to the space and dot characters. It uses statistical methods, like identifying the most frequent character appearing at the end of lines (for dots) or the most common character overall (for spaces), to establish initial mappings. This phase is crucial for speeding up the process but requires a minimum amount of text to be effective.
  2. Interactive Recovery: This is the core of the system. The user is prompted to input text snippets they can read from the document. The system then tries to match these user-provided Unicode sequences to the CID sequences extracted from the PDF. It progressively builds a CID-to-Unicode translation map. The user can input single tokens (words) or, more effectively, sequences of tokens. The system uses these inputs to infer the correct mappings for unknown CIDs. If a contradiction arises with a previously learned mapping, the system flags it for user review. The system also helps the user by identifying the most frequent CIDs and those appearing in lines with many unrecovered characters, guiding their input.

Datasets

The primary dataset used is the Universal Declaration of Human Rights (UDHR) corpus. The authors specifically focus on corrupted PDF documents from this corpus for endangered languages that lack readily available Unicode text versions. They mention working with documents for four languages: Nenets, Nivkh, Mundari, and a Mongolian dialect.

Key Insights and Ideas

  • Interactive recovery is key: For endangered languages, where pre-existing language models are scarce, human expertise is indispensable. The paper's innovation lies in making this human intervention efficient and guided.
  • CID-to-Unicode mapping is the bottleneck: The problem isn't usually the visual rendering of characters but the underlying digital mapping, which is often broken in corrupted PDFs.
  • Statistical heuristics can bootstrap the process: Even a partial recovery of common characters like spaces and dots can significantly reduce the manual effort required later.
  • Sequence matching is more powerful than token matching: Inputting longer, meaningful sequences of characters dramatically increases the likelihood of unique CID sequence identification, leading to faster and more accurate decoding.
  • Preservation through accessibility: By making these documents text-searchable and analyzable, the system directly contributes to the preservation and study of endangered languages.

Key Results

The authors successfully applied their approach to recover text from corrupted UDHR documents for Nivkh and Nenets, with the recovered texts being sent to the UDHR website for public availability. They report that the process required less than an hour of work for these languages. For the tested languages, the system required the user to input between 4% to 5% of the total words to achieve full recovery. This is significantly more efficient than manual transliteration or correcting OCR errors.

Limitations and Future Work

  • Scanned Images: The current approach focuses on "born digital" PDFs with corrupted font mappings and does not address PDFs that are purely scanned images. This is identified as a more complex problem for future work.
  • Language-Specific Challenges: While the system is designed to be general, specific writing systems (like the top-down writing of Mongolian or the vowel display in Mundari) require additional ad-hoc steps or post-processing, indicating that further development might be needed for certain languages.
  • Vertical Segmentation: For languages written top-down, the standard PDF text extraction tools fail to recover lines correctly, necessitating further vertical segmentation steps, which are left for future work.
  • Broader Application: The authors plan to apply the approach to more UDHR languages and explore image augmentation techniques for OCR systems to handle scanned documents. They also aim to make the tool publicly available.

Summary updated

BibTeX
@inproceedings{stefanovitch2022recovering,
  author = {Nicolas Stefanovitch},
  title = {{Recovering Text from Endangered Languages Corrupted PDF documents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
}

Loading related content...

Figure