Extracting Variable-Depth Logical Document Hierarchy from Long Documents: Method, Evaluation, and Application

Rongyu Cao, Yixuan Cao, Ganbin Zhou, Ping Luo

Navigating a standard ten-page research paper is a straightforward task for most readers. However, navigating a 2,000-page financial prospectus or a massive legal filing is a logistical nightmare. While modern document analysis tools are excellent at recognizing "physical" objects—identifying a block of text as a paragraph or a grid as a table—they often fail to capture the "logical" structure that connects these elements. Understanding how a specific subsection relates to its parent section is crucial for both human comprehension and automated information retrieval.

In the paper "Extracting Variable-Depth Logical Document Hierarchy from Long Documents," researchers from the Chinese Academy of Sciences and Tencent propose a new framework called HELD (Hierarchy Extraction from Long Document) to solve this structural puzzle.

The Challenge of Variable Depth and Scale

Most existing document analysis research focuses on short scientific papers or web pages where the hierarchy is relatively shallow, typically spanning three to four levels. Real-world long documents are far more complex. Annual reports or legal filings can reach depths of 11 levels and contain thousands of individual physical objects.

Distribution of physical objects and node depth across the study's datasets.

Existing approaches generally fall into two categories, both with significant drawbacks:

  1. Sequence Labeling: These models attempt to predict the "absolute depth" of a heading (e.g., "this is Level 3"). This approach fails because depth is relative; a heading's level depends entirely on the context of the headings that preceded it.
  2. Rule-Based Systems: These rely on visual cues like font size or indentation. Such systems lack robustness when documents do not follow strict templates, a common occurrence in diverse financial markets.

The HELD Framework

The HELD framework mimics the human process of organizing information while reading. Instead of labeling every object simultaneously, it treats hierarchy building as a sequential "put-or-skip" insertion task into a growing tree structure.

Mapping a physical document layout to its logical tree structure.

The "Put-Or-Skip" Module

For every new object identified in the document, the system evaluates the current document tree and asks: "Does this object belong at this specific position?" This is formulated as a binary classification problem. The module integrates two primary feature sets:

  • Textual Features: Bi-LSTMs capture the semantic meaning of the heading and its potential relationship to existing "siblings" or "parents" in the tree.
  • Visual Features: A separate Bi-LSTM processes formatting data, including font size, bolding, and indentation.

Traversal Strategies

To find the correct insertion point efficiently, the authors evaluated several traversal methods. The Root-to-leaf strategy emerged as the most effective, starting from the top of the tree and stopping at the first appropriate spot. This provided the best balance between accuracy and computational speed.

Datasets and Evaluation

The researchers established three large-scale benchmarks to test variable-depth hierarchies, including Chinese and English financial datasets and an arXiv scientific publication dataset. These benchmarks are significantly more challenging than previous standards, featuring maximum depths of 11 levels.

To evaluate performance, the authors introduced a strict Path-Based Metric. Traditional metrics often only check if a node is at the correct depth. Under the path-based measure, a node is only considered "correct" if its entire path to the root is accurate. This ensures that a subsection placed under the wrong chapter is marked as an error, even if its relative level is correct.

Key Results and Impact

The HELD framework demonstrated state-of-the-art performance, achieving an accuracy of 97.26% on Chinese financial data. Furthermore, the two-step model (extracting headings before building the tree) combined with root-to-leaf traversal provided an 8.3x speedup in inference time compared to one-step approaches.

Beyond structural accuracy, the researchers proved the practical utility of logical hierarchies in downstream tasks. When applied to passage retrieval—finding a specific section within a massive document—the logical hierarchy improved the Mean Average Precision (mAP) by 0.189, demonstrating that structural understanding is vital for effective search and data extraction.

Conclusion and Future Directions

While HELD represents a significant leap forward, its "greedy" nature means that early errors in tree construction can propagate through the rest of the document. Future research may explore more sophisticated search algorithms, such as Monte Carlo Tree Search (MCTS), to navigate the massive search space of possible document structures more efficiently without the high computational cost of traditional beam search.

Summary updated

BibTeX
@article{cao2022extracting,
  author = {Rongyu Cao and Yixuan Cao and Ganbin Zhou and Ping Luo},
  title = {{Extracting Variable-Depth Logical Document Hierarchy from Long Documents: Method, Evaluation, and Application}},
  journal = {J. Comput. Sci. Technol.},
  year = {2022},
  doi = {10.1007/s11390-021-1076-7},
}
Figure