Markup Language Modeling for Web Document Understanding

Su Liu, Bin Bi, Jan Bakus, Paritosh Kumar Velalam, Vijay Yella, Vinod HegdearXiv 2025 · DOI

Introduction

Web Information Extraction (WIE) is the engine behind price aggregators, recommendation engines, and market analysis tools. However, extracting structured data from the diverse and often chaotic landscape of the web remains a significant challenge. Traditional models frequently treat webpages as flat text or focus exclusively on "leaf nodes"—the visible text on a screen—ignoring the rich hierarchical information embedded in the underlying HTML structure.

The Structural Challenge

A primary obstacle in WIE is that essential information is often defined by its structural context rather than its textual content alone. For instance, a "Product Container" is not a single string but a structural DOM node that groups a product's name, price, and image. Standard models, such as the original MarkupLM, often prune these internal nodes to optimize memory, effectively "blinding" the model to the containers that define entity boundaries.

Methodology: From MarkupLM to MarkupLM++

To address these limitations, researchers developed MarkupLM++, an evolution of the RoBERTa-based MarkupLM. While the original model utilizes XPaths to understand spatial positioning, MarkupLM++ integrates the "skeleton" of the webpage directly into its processing.

The MarkupLM architecture processes text and XPath information into a unified input sequence.

The core innovation of MarkupLM++ lies in its treatment of HTML tags. Instead of discarding structural markers during preprocessing, they are inserted into the input sequence as special tokens. This allows the model to perform direct predictions on the tags themselves, enabling it to classify a <div> as a "Product Container" or an <a> tag as a "Product Link."

Experimental Results

The models were evaluated using datasets from shopping review websites, categorized by the number of domains: p-17 (37,500 pages) and p-48 (596,000 samples). The evaluation focused on 17 critical attributes, including Product Name, Link, and Review.

Performance comparison between standard MarkupLM variants and the structural-aware MarkupLM++.

As shown in the results, the MarkupLM p-48 model achieved the highest overall performance with an F1 score of 0.805. While MarkupLM++ recorded a lower overall F1 of 0.733, it demonstrated superior performance in 8 out of 17 specific attributes. Notably, it excelled in extracting complex structural elements like "Product Reviews" and "Product Links," where nested HTML tags (e.g., <a><span>Text</span></a>) often cause standard models to fail.

Discussion and Future Work

The performance of MarkupLM++ highlights a significant trade-off between structural detail and data sparsity. By including internal nodes, the number of potential prediction targets increases exponentially, making the training data appear sparser. Furthermore, because MarkupLM++ was fine-tuned rather than pre-trained on these internal nodes, it lacked an initial understanding of the relationships between tags and text.

Future research will focus on pre-training models on internal nodes from the outset to better learn the "language of HTML." Additionally, improvements in grouping algorithms are planned to more effectively cluster disparate attributes into coherent product entities on complex list pages.

Summary updated

BibTeX
@misc{liu2025markup,
  author = {Su Liu and Bin Bi and Jan Bakus and Paritosh Kumar Velalam and Vijay Yella and Vinod Hegde},
  title = {{Markup Language Modeling for Web Document Understanding}},
  year = {2025},
  eprint = {2509.20940},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.20940},
}
Figure