# DOM-LM: Learning Generalizable Representations for HTML Documents

Source: [DOM-LM: Learning Generalizable Representations for HTML Documents](<https://www.sota2.com/research/paper/68fa6ba21e209131cea2f72c>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-01-04T03:38:00.237Z

Authors: Xiang Deng, Prashant Shiralkar, Colin Lockard, Binxuan Huang, Huan Sun

Published: 2022-01-25T20:10:32.000Z

## Abstract

HTML documents are an important medium for disseminating information on the Web for human consumption. An HTML document presents information in multiple text formats including unstructured text, structured key-value pairs, and tables. Effective representation of these documents is essential for machine understanding to enable a wide range of applications, such as Question Answering, Web Search, and Personalization. Existing work has either represented these documents using visual features extracted by rendering them in a browser, which is typically computationally expensive, or has simply treated them as plain text documents, thereby failing to capture useful information presented in their HTML structure. We argue that the text and HTML structure together convey important semantics of the content and therefore warrant a special treatment for their representation learning. In this paper, we introduce a novel representation learning approach for web pages, dubbed DOM-LM, which addresses the limitations of existing approaches by encoding both text and DOM tree structure with a transformer-based encoder and learning generalizable representations for HTML documents via self-supervised pre-training. We evaluate DOM-LM on a variety of webpage understanding tasks, including Attribute Extraction, Open Information Extraction, and Question Answering. Our extensive experiments show that DOM-LM consistently outperforms all baselines designed for these tasks. In particular, DOM-LM demonstrates better generalization performance both in few-shot and zero-shot settings, making it attractive for making it suitable for real-world application settings with limited labeled data.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Attribute Extraction on Movie-Music Movie domain](<https://www.sota2.com/research/sota/attribute-extraction-on-movie-music-movie-domain.md>): Attribute Extraction; Movie-Music Movie domain; F1 Score: 76.1.

- [Attribute Extraction on Movie-Music Music](<https://www.sota2.com/research/sota/attribute-extraction-on-movie-music-music.md>): Attribute Extraction; Movie-Music Music; F1 Score: 71.5.

- [Attribute Extraction on SWDE (test)](<https://www.sota2.com/research/sota/attribute-extraction-on-swde-test.md>): Attribute Extraction; SWDE (test); Movie Accuracy: 80.7.

- [Open Information Extraction on SWDE Movie](<https://www.sota2.com/research/sota/open-information-extraction-on-swde-movie.md>): Open Information Extraction; SWDE Movie; Pair F1: 0.875.

- [Open Information Extraction on SWDE University](<https://www.sota2.com/research/sota/open-information-extraction-on-swde-university.md>): Open Information Extraction; SWDE University; Pair F1: 77.5.

- [Attribute Extraction on SWDE](<https://www.sota2.com/research/sota/attribute-extraction-on-swde.md>): Attribute Extraction; SWDE; Movie Accuracy: 94.6.

- [Question Answering on WebSRC (dev)](<https://www.sota2.com/research/sota/question-answering-on-websrc-dev.md>): Question Answering; WebSRC (dev); EM: 69.7.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2201.10608>)

[PDF](<https://arxiv.org/pdf/2201.10608.pdf>)
