Glyph-aware Embedding of Chinese Characters

Jon Cai, Falcon Z Dai

Abstract

Traditional Natural Language Processing (NLP) models treat Chinese characters as discrete, arbitrary IDs, ignoring the rich semantic and phonetic information embedded in their visual structures. This paper proposes a "glyph-aware" embedding method that utilizes a Convolutional Neural Network (CNN) to extract features directly from character images. By capturing sub-character structures like radicals, the model achieves state-of-the-art results in Chinese word segmentation, demonstrating the value of visual inductive biases in logographic scripts.

Introduction

In most NLP pipelines, characters are represented as unique indices in a vocabulary, mapped to dense vectors via a lookup table. While effective for alphabetic languages, this approach fails to leverage the internal logic of logographic scripts like Chinese. Chinese characters are often composed of "radicals"—reusable sub-structures that provide clues about meaning or pronunciation. For instance, characters related to weather, such as snow (雪), hail (雹), and thunder (雷), all share the "rain" radical (雨).

Standard ID-based embeddings treat these as entirely distinct entities, missing opportunities to generalize knowledge across visually and semantically related characters. This research aims to bridge this gap by allowing models to "see" the characters, extracting features directly from their rendered forms.

Methods

The authors introduce a CNN-based embedder designed to replace or augment traditional lookup tables. The process involves four key steps:

  1. Rendering: Each character is rendered into a raw grayscale image using a standard font (e.g., Google Noto).
  2. Feature Extraction: A CNN processes these pixel grids. CNNs are ideal for this task due to their spatial translational invariance, allowing them to recognize a radical regardless of its position (left, right, top, or bottom) within the character.
  3. Embedding Generation: The CNN's output is passed through a fully connected layer to produce a fixed-length embedding vector.
  4. Hybrid Approach: To balance visual features with unique character identities, the authors also evaluate a "mixed embedding" that sums the CNN-derived vector with a standard ID-based vector.
Comparison between CNN-based glyph embedding and traditional ID-based lookup tables.

These embeddings are integrated into sequence models, such as Gated Recurrent Units (GRUs) or Bidirectional LSTMs, to perform downstream tasks.

Datasets and Evaluation

The approach was evaluated using two primary datasets from the Second International Chinese Word Segmentation Bakeoff (2005):

  • MSR (Microsoft Research): Utilized for both Language Modeling and Word Segmentation.
  • PKU (Peking University): Utilized for Word Segmentation.

To maintain computational efficiency, the vocabulary was limited to the 4,000 most frequent characters.

Key Insights

  • Visual Generalization: By processing glyphs, the model can infer properties of rare or unseen characters if they share radicals with more common ones.
  • Parameter Efficiency: Unlike ID-based embedders that scale $O(N \times K)$ with vocabulary size $N$ and dimension $K$, the CNN embedder is more compact ($O(N + K)$), as radical knowledge is shared across convolutional filters.
  • Task-Specific Utility: Visual information proved highly effective for Word Segmentation, where structural cues help define boundaries. However, it was less effective for Language Modeling, where the model often prioritized stronger ID-based signals.
  • The Ambiguity Trap: Some characters are visually similar but semantically distinct (e.g., 人 "person" vs. 入 "enter"). The hybrid (ID + CNN) approach mitigates this risk by ensuring unique identities are preserved.

Key Results

The mixed (ID + CNN) embedder combined with a Bidirectional LSTM achieved state-of-the-art F1 scores in word segmentation, significantly outperforming previous benchmarks.

Performance of different embedders on Chinese word segmentation tasks using GRU and Bidirectional LSTM architectures.

In Language Modeling, however, the CNN-only embedder lagged behind the ID-based baseline (Perplexity of 55.51 vs. 47.53). Analysis indicated that the model tended to minimize the influence of CNN embeddings in this specific task, relying more heavily on ID information.

Conclusion and Future Work

While the glyph-aware approach shows great promise, several avenues for improvement remain. The current model was trained on a single font; introducing visual variance through multiple fonts or more aggressive data augmentation might improve the CNN's robustness. Additionally, future research could explore whether glyphs assist in phonetic tasks, such as Pinyin prediction, or utilize multi-task learning (e.g., predicting stroke counts) to provide deeper supervision for the CNN.

Summary updated

BibTeX
@inproceedings{cai2017glyph,
  author = {Jon Cai and Falcon Z Dai},
  title = {{Glyph-aware Embedding of Chinese Characters}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  url = {https://openreview.net/forum?id=6QAHwKBvyM},
}
Figure