Learning Character-level Compositionality with Visual Features

Frederick Liu, Han Lu, Chieh Lo, Graham Neubig

Abstract Previous work has modeled the compositionality of words by creating character-level models of meaning, reducing problems of sparsity for rare words. However, in many writing systems compositionality has an effect even on the character-level: the meaning of a character is derived by the sum of its parts. In this paper, we model this effect by creating embeddings for characters based on their visual characteristics, creating an image for the character and running it through a convolutional neural network to produce a visual character embedding. Experiments on a text classification task demonstrate that such model allows for better processing of instances with rare characters in languages such as Chinese, Japanese, and Korean. Additionally, qualitative analyses demonstrate that our proposed model learns to focus on the parts of characters that carry semantic content, resulting in embeddings that are coherent in visual space.

Introduction

In many writing systems, particularly logographic ones like Chinese, Japanese, and Korean (CJK), characters are not merely atomic symbols but are composed of sub-character units that carry semantic or phonetic information. Traditional Natural Language Processing (NLP) models typically ignore this internal structure, treating each character as a discrete entity in a lookup table. While effective for frequent characters, this approach suffers from data sparsity when encountering the "long tail" of rare characters.

This paper addresses the challenge of rare character representation by proposing a model that leverages visual features. By treating characters as images and processing them through a Convolutional Neural Network (CNN), the model can capture sub-character compositionality. This allows the system to generalize to rare or even unseen characters by recognizing familiar components, such as radicals, much like a human reader might infer the meaning of an unfamiliar character.

Methodology

The researchers evaluated two primary architectures for character representation within a text classification framework:

  1. The LOOKUP Model (Baseline): A standard architecture where each character is represented by a one-hot vector mapped to a learned embedding matrix.
  2. The VISUAL Model (Proposed): Each character is rendered as a 36x36 grayscale image. This image is processed by a 3-layer CNN to generate a "visual character embedding."
The architecture comparison between the proposed VISUAL model and the baseline LOOKUP model.

Both models utilize a Gated Recurrent Unit (GRU) to process sequences of character embeddings for classifying Wikipedia article titles into 12 categories. The study also explored fusion techniques—Early, Late, and Fallback—to combine the strengths of discrete identifiers and visual features. The dataset used follows a Zipfian distribution, highlighting the prevalence of rare characters in CJK corpora.

Results and Analysis

The experimental results demonstrate the efficacy of visual embeddings, particularly in low-resource and rare-character scenarios:

  • Generalization to Rare Characters: While the LOOKUP model performs slightly better on overall accuracy due to its strength with frequent characters, the VISUAL model significantly outperforms it on the rarest characters. This suggests that visual features provide a robust mechanism for handling the long tail of the character distribution.
  • Semantic and Visual Coherence: Qualitative analysis of the embedding space shows that the VISUAL model groups characters that are both visually and semantically similar (e.g., various avian species sharing a common radical). In contrast, the LOOKUP model's nearest neighbors for rare characters often lack meaningful relationships.
  • Complementary Information: Late Fusion, which averages prediction probabilities from both models, yielded the best overall results. This indicates that visual features and discrete character IDs provide complementary signals for classification.
Performance comparison showing the VISUAL model (solid lines) outperforming the LOOKUP model (dashed lines) for rare characters.

Further analysis using occlusion sensitivity tests revealed that the CNN naturally learns to focus on the most semantically significant parts of a character, effectively identifying "semantic hotspots" without explicit supervision.

Conclusion

This work demonstrates that incorporating visual features into character representations can effectively model sub-character compositionality. The proposed VISUAL model offers a powerful solution for the sparsity issues inherent in logographic languages. Although the model entails higher computational costs during training due to image rendering and CNN operations, its superior performance on rare characters and its ability to learn semantically grounded visual features represent a significant advancement. Future research may apply these visual embeddings to broader tasks such as machine translation or the analysis of historical scripts.

Summary updated

BibTeX
@inproceedings{liu2017learning,
  author = {Frederick Liu and Han Lu and Chieh Lo and Graham Neubig},
  title = {{Learning Character-level Compositionality with Visual Features}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2017},
  url = {https://openreview.net/forum?id=rJW3Whedbr},
}
Figure