Universal Lemmatizer: A Sequence to Sequence Model for Lemmatizing\n Universal Dependencies Treebanks

Jenna Kanerva, Filip Ginter, Tapio Salakoski · DOI

Abstract

In this paper we present a novel lemmatization method based on a sequence-to-sequence neural network architecture and morphosyntactic context representation. In the proposed method, our context-sensitive lemmatizer generates the lemma one character at a time based on the surface form characters and its morphosyntactic features obtained from a morphological tagger. We argue that a sliding window context representation suffers from sparseness, while in majority of cases the morphosyntactic features of a word bring enough information to resolve lemma ambiguities while keeping the context representation dense and more practical for machine learning systems. Additionally, we study two different data augmentation methods utilizing autoencoder training and morphological transducers especially beneficial for low resource languages. We evaluate our lemmatizer on 52 different languages and 76 different treebanks, showing that our system outperforms all latest baseline systems. Compared to the best overall baseline, UDPipe Future, our system outperforms it on 62 out of 76 treebanks reducing errors on average by 19% relative. The lemmatizer together with all trained models is made available as a part of the Turku-neural-parsing-pipeline under the Apache 2.0 license.

Introduction

Lemmatization—the process of reducing a word to its base dictionary form (e.g., "lives" to "life" or "live")—is a cornerstone of NLP, especially for morphologically rich languages. The primary challenge in lemmatization is ambiguity: a single surface form can correspond to different lemmas depending on its context.

Traditional neural models often rely on a "sliding window" of surrounding raw text to resolve these ambiguities. However, such representations are frequently sparse and require substantial data to be effective. This research introduces a more efficient, dense context representation that leverages morphosyntactic features to improve lemmatization across diverse languages and data scales.

Methodology

The proposed system is a context-sensitive sequence-to-sequence (seq2seq) model built on the OpenNMT framework.

Dense Context Representation

Instead of raw text windows, the model utilizes characters of the target word concatenated with its morphosyntactic features. These features include Universal POS tags, language-specific tags, and morphological features (e.g., Case, Number, Tense) predicted by a prior morphological tagger. This approach transforms sparse textual context into a dense linguistic signal.

Architecture

The model employs a deep attentional encoder-decoder network. The encoder consists of bidirectional LSTM layers, while the decoder uses unidirectional LSTMs to generate the lemma character-by-character. To handle unknown symbols (UNK), a post-processing step replaces them with the input character that received the highest attention at that specific timestep.

The sequence-to-sequence architecture uses bidirectional LSTMs to encode characters and morphosyntactic tags, decoding the lemma character-by-character.

Data Augmentation

To improve performance on low-resource languages, two augmentation techniques are introduced:

  1. Autoencoding Random Strings: The model is trained to verbatim copy randomly generated strings, helping it learn the "identity" mapping essential for stems that do not change.
  2. Morphological Transducers: External linguistic resources (such as Apertium) are used to generate additional synthetic training examples.

Key Insights: The Role of Morphosyntactic Context

A central finding of this work is that morphosyntactic features provide a significantly more effective signal for disambiguation than raw text. For most languages, incorporating POS and inflectional tags reduces lemma ambiguity from approximately 12% to less than 1%.

Ambiguity levels drop significantly across almost all languages when morphosyntactic tags are included compared to raw tokens.

While some languages like Urdu and Hindi appear to maintain high ambiguity even with tags, further analysis reveals this is often due to annotation inconsistencies or extremely skewed distributions where one lemma is vastly more common than others. Furthermore, the character-level approach ensures robustness to out-of-vocabulary (OOV) words by allowing the model to generalize morphological patterns.

Results and Evaluation

The model was evaluated on 76 treebanks from 52 languages in the Universal Dependencies (UD) v2.2 collection. The system outperformed all baselines, including the state-of-the-art UDPipe Future, on 62 out of 76 treebanks.

Key performance metrics include:

  • 19% Relative Error Reduction: Average improvement across all treebanks.
  • Small Treebanks: Achieved a 30% error reduction in the "small" category.
  • Low-Resource Gains: A 24% reduction in errors when utilizing data augmentation for low-resource languages.
  • Efficiency: The system processes approximately 1,300 tokens per second on a standard GPU, making it suitable for practical production pipelines.

Conclusion

The Universal Lemmatizer demonstrates that dense morphosyntactic features are superior to sparse text windows for resolving lemma ambiguity. By combining a character-level seq2seq architecture with rich linguistic tags and targeted data augmentation, the system sets a new standard for lemmatization across a wide array of languages. Future work will focus on reducing dependency on tagger accuracy and improving the integration of external linguistic transducers.

Summary updated

BibTeX
@article{kanerva2021universal,
  author = {Jenna Kanerva and Filip Ginter and Tapio Salakoski},
  title = {{Universal Lemmatizer: A Sequence to Sequence Model for Lemmatizing\textbackslash\{\}n Universal Dependencies Treebanks}},
  journal = {Nat. Lang. eng},
  year = {2021},
  doi = {10.1017/s1351324920000224},
}
Figure