Multi-Domain Ancient Chinese Named Entity Recognition Based on Attention-Enhanced Pre-trained Language Model

Qi Zhang, Ziyang Duan, Shijie Ma, Shengyu Liu, Zibo Yuan, Ruimin Ma2025

TL;DR

Researchers have developed a new deep learning architecture, GujiRoberta-BiLSTM-Attention-CRF, specifically designed to extract entities (like names, titles, and medical terms) from ancient Chinese texts. By combining a domain-specific pre-trained model with an attention mechanism, the system significantly outperforms standard benchmarks across historical and medical datasets, providing a vital tool for digital humanities.

What Problem Does This Paper Address?

Ancient Chinese (Classical Chinese) is a nightmare for standard Natural Language Processing (NLP) tools. Unlike modern Chinese, it features archaic vocabulary, highly compressed grammar, and "semantic obscurity"—where the meaning of a character changes drastically depending on the context or the era.

Furthermore, "Ancient Chinese" isn't a monolith. A historical record like the Records of the Grand Historian uses vastly different terminology than a traditional medical manual. Most existing Named Entity Recognition (NER) systems struggle with this "multi-domain" challenge. They might be good at finding names of emperors but fail completely when asked to identify a complex herbal prescription or an obscure official title. This paper aims to create a robust, "all-rounder" model that can handle these diverse specialized domains.

Methods

The authors propose a four-stage "sandwich" architecture called GujiRoberta-BiLSTM-Attention-CRF:

  1. The Backbone (GujiRoberta): They start with a Pre-trained Language Model (PLM) called GujiRoberta (or SikuRoBERTa), which was trained specifically on the Siku Quanshu—the largest collection of books in Chinese history. This gives the model a "native" understanding of ancient syntax.
  2. The Contextualizer (BiLSTM): A Bidirectional Long Short-Term Memory network captures long-distance dependencies in the text, helping the model understand how a word at the beginning of a sentence relates to one at the end.
  3. The Enhancer (Attention): This is the paper's key addition. An attention mechanism assigns "weights" to different parts of the text. It helps the model focus on "core" features (like specific verbs that usually precede a disease name) while ignoring irrelevant "noise" in the prose.
  4. The Decoder (CRF): Finally, a Conditional Random Field layer ensures the output makes sense. It uses "global optimization" to prevent illegal label sequences (e.g., ensuring a "Middle-of-Entity" tag doesn't appear without a "Beginning-of-Entity" tag).

Datasets

The model was tested on three distinct datasets provided by the EVAHAN 2025 competition:

  • Dataset A: Based on the Records of the Grand Historian (Shiji). It labels personal names, place names, book titles, official titles, dynasties, and time.
  • Dataset B: Selected from the Twenty-Four Histories. It focuses on names, places, and time but is complicated by frequent ancient abbreviations.
  • Dataset C: Sourced from traditional Chinese medical classics. This is the most specialized, covering six categories: diseases, syndromes, prescriptions, medicinal materials, symptoms, and acupoints.

Key Insights and Ideas

  • Attention is the "Aha!" Moment: The authors found that adding the attention layer consistently boosted the F1-score (a measure of accuracy) by over 1% compared to models without it. It acts like a highlighter, helping the model pick out "scattered" entity expressions that are common in ancient prose.
  • Domain Sensitivity: The model isn't just memorizing words; it's learning domain-specific patterns. For instance, in medical texts, it learned to identify the "core verbs" that signal a clinical description.
  • Recall vs. Precision: Interestingly, the model’s recall (its ability to find all entities) was generally higher than its precision (its ability to be exactly right). This suggests the model is very good at "sniffing out" potential entities, even if it occasionally gets the boundaries slightly wrong.

Key Results

The proposed model outperformed the official EVAHAN 2025 baselines across the board:

Dataset Method Precision (P) Recall (R) F1-Score
Total Ours 82.84 85.46 84.13
Baseline 81.41 79.82 80.61

The most dramatic improvement was seen in Dataset C (Medical), where the F1-score jumped by 8.28 percentage points (from 72.40 to 80.68). This highlights how effective the attention-enhanced architecture is at handling highly specialized, technical ancient vocabulary.

Limitations and Future Work

Despite the success, the authors noted that the model still struggles with polysemy—words that have multiple meanings. In ancient Chinese, a single character can represent a person's name in one sentence and a common verb in the next.

Future work will focus on:

  • Dynamic Attention: Refining how the model allocates focus to better handle "fine-grained" semantic contexts.
  • Domain-Adaptive Pre-training: Further "tuning" the model on even more specific sub-domains to reduce misidentification of complex historical names.
  • Generalization: Exploring how these modules can be adapted for other ancient languages beyond Chinese.

Summary updated

Abstract

Recent advancements in digital humanities have intensified the demand for intelligent processing of ancient Chinese texts, particularly across specialized domains such as historical records and ancient medical literature.Among related research areas, Named Entity Recognition (NER) plays a crucial role, serving as the foundation for knowledge graph construction and deeper humanities computing studies.In this paper, we introduce a architecture specifically designed for multi-domain ancient Chinese NER tasks based on a pre-trained language model (PLM).Building upon the GujiRoberta backbone, we propose the GujiRoberta-BiLSTM-Attention-CRF model.Experimental results on three distinct domain-specific datasets demonstrate that our approach significantly outperforms the official baselines across all three datasets, highlighting the particular effectiveness of integrating an attention mechanism within our architecture.
BibTeX
@misc{zhang2025multi,
  author = {Qi Zhang and Ziyang Duan and Shijie Ma and Shengyu Liu and Zibo Yuan and Ruimin Ma},
  title = {{Multi-Domain Ancient Chinese Named Entity Recognition Based on Attention-Enhanced Pre-trained Language Model}},
  year = {2025},
  doi = {10.18653/v1/2025.alp-1.32},
}
Figure