PLM-GNN: A Webpage Classification Method based on Joint Pre-trained Language Model and Graph Neural Network

Qiwei Lang, Jingbo Zhou, Haoyi Wang, Shiqi Lyu, Rui Zhang · DOI

Abstract

The number of web pages is growing at an exponential rate, accumulating massive amounts of data on the web. It is one of the key processes to classify webpages in web information mining. Some classical methods are based on manually building features of web pages and training classifiers based on machine learning or deep learning. However, building features manually requires specific domain knowledge and usually takes a long time to validate the validity of features. Considering webpages generated by the combination of text and HTML Document Object Model(DOM) trees, we propose a representation and classification method based on a pre-trained language model and graph neural network, named PLM-GNN. It is based on the joint encoding of text and HTML DOM trees in the web pages. It performs well on the KI-04 and SWDE datasets and on practical dataset AHS for the project of scholar's homepage crawling.

Introduction

Classifying webpages is a foundational task for search engines and data miners. However, as the web grows, traditional methods are becoming less reliable. Manual feature engineering is slow and requires domain expertise, while link-based classification suffers from the sheer variability and volume of modern pages.

Researchers have developed PLM-GNN, a novel framework that classifies webpages by simultaneously "reading" their text with Pre-trained Language Models (PLMs) and "analyzing" their layout structure with Graph Neural Networks (GNNs). A webpage is a structured document where the position and nesting of text—defined by the HTML Document Object Model (DOM) tree—provide vital context that raw text alone might miss.

Methodology: The PLM-GNN Framework

The PLM-GNN architecture treats webpage classification as a two-stage representation problem, integrating semantic content with structural layout.

  1. Text Encoder: The model extracts text from the leaf nodes of the HTML DOM tree. This text is processed by a Pre-trained Language Model (PLM), specifically RoBERTa-large, to capture semantic meaning and context.
  2. DOM Tree Encoder: To capture layout, the HTML DOM tree is treated as a graph. XPath syntax is used to create unique embeddings for every node. These are processed by a Graph Neural Network (GNN) using message-passing to learn structural relationships.
  3. Fusion Classifier: Outputs from both encoders are normalized, concatenated, and passed through a Multi-Layer Perceptron (MLP) to predict the final webpage category.
The PLM-GNN architecture integrates text encoding with DOM tree structural encoding.

Experimental Setup

The model was evaluated on three distinct datasets:

  • KI-04: A classic dataset for genre classification (e.g., news vs. personal homepages).
  • SWDE: A multi-domain dataset repurposed for classification.
  • AHS (Academic Homepages of Scholars): A new dataset constructed by the authors featuring homepages from 22 universities. Version 2.0 includes negative samples (e.g., non-academic personal sites) to test discriminative power.

Results and Analysis

The PLM-GNN model demonstrated state-of-the-art performance across all benchmarks, achieving near-perfect accuracy on several tasks.

Dataset statistics and performance metrics for PLM-GNN across KI-04, SWDE, and AHS datasets.

Key Insights

  • Structural Synergy: Ablation studies confirmed that while text is a primary driver, the DOM tree structure provides a significant complementary boost. Similar page types (e.g., faculty profiles) often share consistent HTML "skeletons."
  • PLM Selection: Interestingly, using Longformer (designed for long sequences) resulted in lower performance than RoBERTa, likely due to overfitting on irrelevant text. This suggests that reading every word is less important than understanding key semantic and structural markers.
  • Automated Feature Discovery: PLM-GNN eliminates the need for manual tag selection by automatically learning the importance of different HTML structures through GNN and XPath embeddings.

Conclusion

PLM-GNN successfully marries semantic and structural information for robust webpage classification. While achieving perfect results on datasets like KI-04 and AHS 2.0, future work will focus on reducing the computational overhead of the dual-encoder architecture and exploring directed graph representations for the DOM tree to capture hierarchical dependencies more effectively.

Summary updated

Abstract

The number of web pages is growing at an exponential rate, accumulating massive amounts of data on the web. It is one of the key processes to classify webpages in web information mining. Some classical methods are based on manually building features of web pages and training classifiers based on machine learning or deep learning. However, building features manually requires specific domain knowledge and usually takes a long time to validate the validity of features. Considering webpages generated by the combination of text and HTML Document Object Model(DOM) trees, we propose a representation and classification method based on a pre-trained language model and graph neural network, named PLM-GNN. It is based on the joint encoding of text and HTML DOM trees in the web pages. It performs well on the KI-04 and SWDE datasets and on practical dataset AHS for the project of scholar's homepage crawling.
BibTeX
@misc{lang2023plm,
  author = {Qiwei Lang and Jingbo Zhou and Haoyi Wang and Shiqi Lyu and Rui Zhang},
  title = {{PLM-GNN: A Webpage Classification Method based on Joint Pre-trained Language Model and Graph Neural Network}},
  year = {2023},
  eprint = {2305.05378},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.05378},
}
Figure