Venue: NAACL 2019

# Data Augmentation for Context-Sensitive Neural Lemmatization

Using Inflection Tables and Raw Text

Toms Bergmanis

School of Informatics

University of Edinburgh

T.Bergmanis@sms.ed.ac.uk &Sharon Goldwater

School of Informatics

University of Edinburgh

sgwater@inf.edu.ac.uk

###### Abstract

Lemmatization aims to reduce the sparse data problem by relating the inflected forms of a word to its dictionary form. Using context can help, both for unseen and ambiguous words. Yet most context-sensitive approaches require full lemma-annotated sentences for training, which may be scarce or unavailable in low-resource languages. In addition (as shown here), in a low-resource setting, a lemmatizer can learn more from \(n\) labeled examples of distinct words (types) than from \(n\) (contiguous) labeled tokens, since the latter contain far fewer distinct types. To combine the efficiency of type-based learning with the benefits of context, we propose a way to train a context-sensitive lemmatizer with little or no labeled corpus data, using inflection tables from the UniMorph project and raw text examples from Wikipedia that provide sentence contexts for the unambiguous UniMorph examples. Despite these being unambiguous examples, the model successfully generalizes from them, leading to improved results (both overall, and especially on unseen words) in comparison to a baseline that does not use context.

## 1 Introduction

Many temmatizers work on isolated wordforms Wicentowski (2002); Dreyer et al. (2008); Rastogi et al. (2016); Makarov and Clematide (2018, 2019). Lemmatizing in context can improve accuracy on ambiguous and unseen words Bergmans and Goldwater (2018), but most systems for context-sensitive lemmatization must train on complete sentences labeled with POS and/or morphological tags as well as lemmas, and have only been tested with 20k-300k training tokens Chrupala et al. (2008); Muller et al. (2015); Chakrabarty et al. (2017).1

Footnote 1: The smallest of these corpora contains 20k tokens of Bengali annotated only with lemmas, which Chakrabarty et al. (2017) reported took around two person months to create.

Intuitively, though, sentence-annotated data is inefficient for training a lemmatizer, especially in low-resource settings. Training on (say) 1000 word types will provide far more information about a language's morphology than training on 1000 contiguous tokens, where fewer types are represented. As noted above, sentence data can help with ambiguous and unseen words, but we show here that when data is scarce, this effect is small relative to the benefit of seeing more word types.2 Motivated by this result, we propose a training data augmentation method that combines the efficiency of type-based learning and the expressive power of a context-sensitive model.3 We use _Lematus_Bergmans and Goldwater (2018), a state-of-the-art lemmatizer that learns from lemma-annotated words in their \(N\)-character contexts. No predictions about surrounding words are used, so fully annotated training sentences are not needed. We exploit this fact by combining two sources of training data: 1k lemma-annotated types (with contexts) from the Universal Dependency Treebank (UDT) v2.24Nivre et al. (2017), plus examples obtained by finding _unambiguous_ word-lemma pairs in inflection tables from the Universal Morphology (UM) project5 and collecting sentence contexts for them from Wikipedia. Although these examples are noisy and biased, we show that they improve lemmatization accuracy in experiments on 10 languages, and that the use of context helps, both overall and especially on unseen words.

Footnote 2: Garrette et al. (2013) found the same for POS tagging.

Footnote 3: Code and data: [https://bitbucket.org/tomsbergmans/data_augumentation_um_wiki](https://bitbucket.org/tomsbergmans/data_augumentation_um_wiki)

Footnote 4: [http://hdl.handle.net/11234/l-2837](http://hdl.handle.net/11234/l-2837)

Footnote 5: [http://unimorph.org](http://unimorph.org)

## 2 Method

**Lematus**Bergmans and Goldwater (2018) is a neural sequence-to-sequence model with attention

inspired by the re-inflection model of Kann and Schutze (2016), which won the 2016 SIGMORPHON shared task Cotterell et al. (2016). It is built using the Nematus machine translation toolkit,6 which uses the architecture of Sennrich et al. (2017): a 2-layer bidirectional GRU encoder and a 2-layer decoder with a conditional GRU Sennrich et al. (2017) in the first layer and a GRU in the second layer.

Footnote 5: [https://github.com/EdinburghNLP/nematus](https://github.com/EdinburghNLP/nematus), Code for Lemanus: [https://bitbucket.org/tomsbergmanis/lematus.git](https://bitbucket.org/tomsbergmanis/lematus.git)

Lematus takes as input a character sequence representing the wordform in its \(N\)-character context, and outputs the characters of the lemma. Special input symbols are used to represent the left and right boundary of the target wordform (<lc>, <rc>) and other word boundaries (
). For example, if \(N=15\), the system trained on Latvian would be expected to produce the characters of the lemma _cel$_ (meaning _road_) given input such as:

```
saka+cs>pa%valdibu<lc>c#lw<r>un
ielu
regiantstr
```

When \(N=0\)**(Lematus 0-ch)**, no context is used, making Lematus 0-ch comparable to other systems that do not model context Dreyer et al. (2008); Rastogi et al. (2016); Makarov and Clematide (2018, 2019). In our experiments we use both Lematus 0-ch and **Lematus 20-ch** (20 characters of context), which was the best-performing system reported by Bergmanis and Goldwater (2018).

### Data Augmentation

Our data augmentation method uses UM inflection tables and creates additional training examples by finding Wikipedia sentences that use the inflected wordforms in context, pairing them with their lemma as shown in the inflection table. However, we cannot use all the words in the tables because some of them are ambiguous: for example, Figure 1 shows that the form ceji could be lemmatized either as cel$ or celis. Since we don't know which would be correct for any particular Wikipedia example, we only collect examples for forms which are unambiguous according to the UM tables. However, this method is only as good as the coverage of the UM tables. For example, if UM doesn't include a table for the Latvian verb _cell_, then the underlined forms in Table 1 would be incorrectly labeled as unambiguous.

There are several other issues with this method that could potentially limit its usefulness. First, the UM tables only include verbs, nouns and adjectives, whereas we test the system on UDT data, which includes all parts of speech. Second, by excluding ambiguous forms, we may be restricting the added examples to a non-representative subset of the potential inflections, or the system may simply ignore the context because it isn't needed for these examples. Finally, there are some annotation differences between UM and UDT.7 Despite all of these issues, however, we show below that the added examples and their contexts do actually help.

Footnote 7: Recent efforts to unify the two resources have mostly focused on validating dataset schema McCarthy et al. (2018), leaving conflicts in word lemmas unresolved. We estimated (by counting types that are unambiguous in each dataset but have different lemmas across them) that annotation inconsistencies affect up to 1% of types in the languages we used.

## 3 Experimental Setup

Baselines and Training ParametersWe use four baselines: (1) **Lemma**8 Muller et al. (2015) is a context-sensitive system that uses log-linear models to jointly tag and lemmatize the data, and is trained on sentences annotated with both lemmas and POS tags. (2) The hard monotonic attention model (**HMMAM**)9 Makarov and Clematide (2018) is a neural sequence-to-sequence model with a hard attention mechanism that advances through the sequence monotonically. It is trained on word-lemma pairs (without context)

\begin{table}
\begin{tabular}{l|c c|c c}  & \multicolumn{2}{c|}{**nomu:cej\$} & \multicolumn{2}{c}{**noun:eclis**} \\  & **SG** & **PL** & **SG** & **PL** \\ \hline NOM & cej\$ & eej\$ & cej\$ & cej\$ \\ GEN & eeje\$ & eej\$ & eej\$ & eej\$ \\ DAT & celam\$ & eej\$ & cej\$ & cej\$ \\ ACC & celu\$ & eej\$ & cej\$ & cej\$ \\ INS & celu\$ & eej\$ & cej\$ & cej\$ \\ LOC & cej\$ & eej\$ & cej\$ & cej\$ \\ VOC & cej\$ & eej\$ & cej\$ & cej\$ \\ \end{tabular}
\end{table}
Table 1: Example UM inflection tables for Latvian nouns _cel$_ (road)_ and _cells_ (_knee_). The **crossed–out forms** are examples of evidently ambiguous forms that are not used for data augmentation because of being shared by the two lemmas. The underlined forms appear unambiguous in this toy example but actually conflict with inflections of the verb _cell_ (_to lift_).

 

with character-level alignments learned in a preprocessing step using an alignment model, and it has proved to be competitive in low resource scenarios. (3) Our naive **Baseline** outputs the most frequent lemma (or one lemma at random from the options that are equally frequent) for words observed in training. For unseen words it outputs the wordform itself. (4) We also try a baseline data augmentation approach (**AE Aug Baseline**) inspired by Bergmanis et al. (2017) and Kann and Schutze (2017), who showed that adding training examples where the network simply learns to auto-encode corpus words can improve morphological inflection results in low-resource settings. The AE Aug Baseline is a variant of Lematus 0-ch which augments the UDT lemmatization examples by auto-encoding the inflected forms of the UM examples (i.e., it just treats them as corpus words). Comparing AE Aug Baseline to Lematus 0-ch augmented with UM lemma-inflection examples tells us whether using the UM lemma information helps more than simply auto-encoding more inflected examples.

To train the models we use the default settings for Lemming and the suggested lemmatization parameters for HMAM. We mainly follow the hyperparameters used by Bergmanis and Goldwater (2018) for Lemanus; details are in Appendix B.

Languages and Training DataWe conduct preliminary experiments on five development languages: Estonian, Finnish, Latvian, Polish, and Russian. In our final experiments we also add Bulgarian, Czech, Romanian, Swedish and Turkish. We vary the amount and type of training data (types vs. tokens, UDT only, UM only, or UDT plus up to 10k UM examples), as described in Section 4.

To obtain \(N\) UM-based training examples, we select the first \(N\) unambiguous UM types (with their sentence contexts) from shuffled Wikipedia sentences. For experiments with \(j>1\) examples per type, we first find all UM types with at least \(j\) sentence contexts in Wikipedia and then choose the \(N\) distinct types and their \(j\) contexts uniformly at random.

EvaluationTo evaluate models' ability to lemmatize wordforms in their sentence context we follow Bergmans and Goldwater (2018) and use the full UDT development and test sets. Unlike Bergmans and Goldwater (2018) who reported token level temmatization exact match accuracy, we report _type-level_ micro averaged lemmatization exact match accuracy. This measure better reflects improvements on unseen words, which tend to be rare but are more important (since a most-frequent-lemma baseline does very well on seen words, as shown by Bergmanis and Goldwater (2018)).

We separately report performance on unseen and ambiguous tokens. For a fair comparison across scenarios with different training sets, we count as unseen only words that are not ambiguous and are absent from _all_ training sets/scenarios introduced in Section 4. Due to the small training sets, between 70-90% of dev set types are classed as unseen in each language. We define a type as ambiguous if the empirical entropy over its lemmas is greater than 0.1 in the full original UDT training splits.10 According to this measure, only 1.2-5.3% of dev set types are classed as ambiguous in each language.

Footnote 10: This measure, _adjusted ambiguity_, was defined by Kirefu (2018), who noticed that many frequent wordforms appear to have multiple lemmas due to annotation errors. The adjusted ambiguity filters out these cases.

Significance TestingAll systems are trained and tested on ten languages. To test for statistically significant differences between the results of two systems we use a Monte Carlo method: for each set of results (i.e. a set of 10 numerical values) we generate 10000 random samples, where each sample swaps the results of the two systems for each language with a probability of \(0.5\). We then obtain a p-value as the proportion of samples for which the difference on average was at least as large as the difference observed in our experiments.

## 4 Experiments, Results, and Discussion

Types vs. Tokens and Context in Very Low Resource SettingsWe compare training on the first

\begin{table}
\begin{tabular}{c r r|r r} \hline \hline  & & **Ambig.** & **Unseen** & **All** \\ \hline \multirow{6}{*}{Courant} & \multicolumn{1}{l|}{_Baseline_} & 41.0 & 26.6 & 31.0 \\  & \multicolumn{1}{l|}{_Lemming_} & 38.2 & 48.3 & 50.6 \\  & \multicolumn{1}{l|}{_HMAM_} & 41.4 & 50.2 & 52.1 \\  & \multicolumn{1}{l|}{_Lematus 0-ch_} & 39.9 & 43.7 & 46.8 \\  & \multicolumn{1}{l|}{_Lematus 20-ch_} & 38.4 & 42.8 & 45.8 \\ \hline \multirow{6}{*}{Courant} & \multicolumn{1}{l|}{_Baseline_} & 43.0 & 26.6 & 32.4 \\  & \multicolumn{1}{l|}{_Lemming_} & N/A & N/A & N/A \\ \cline{1-1}  & \multicolumn{1}{l|}{_HMM_} & 41.8 & 38.7 & 58.1 \\ \cline{1-1}  & \multicolumn{1}{l|}{_Lematus 0-ch_} & 42.5 & 53.7 & 53.1 \\ \cline{1-1}  & \multicolumn{1}{l|}{_Lematus 20-ch_} & 43.1 & 51.7 & 54.9 \\ \hline \end{tabular}
\end{table}
Table 2: Average type level lemmatization exact match accuracy on five development languages in type and token based training data scenarios. Colour-scale is computed over the whole _Ambig._ column and over all but _Baseline_ rows for the other columns.

 

1k tokens vs. first 1k distinct types of the UDT training sets. Table 2 shows that if only 1k examples are available, using types is clearly better for all systems. Although Lematus does relatively poorly on the token data, it benefits the most from switching to types, putting it on par with HMAM and suggesting is it likely to benefit more from additional type data. Lemming requires token-based data, but does worse than HMAM (a context-free method) in the token-based setting, and we also see no benefit from context in comparing Lematus 20-ch vs Lematus 0-ch. So overall, in this very low-resource scenario with no data augmentation, context does not appear to help.

Using UM + Wikipedia OnlyWe now try training only on UM + Wikipedia examples, rather than examples from UDT. We use 1k, 2k or 5k unambiguous types from UM with a single example context from Wikipedia for each. With 5k types we also try adding more example contexts (2, 3, or 5 examples for each type).

Figure 1 presents the results (for unseen words only). As with the UDT experiments, there is little difference between Lematus 20-ch and Lematus 0-ch in the smallest data setting. However, when the number of training types increases to 5k, the benefits of context begin to show, with Lematus 20-ch yielding a 1.6% statistically significant (\(p<0.001\)) improvement over Lematus 0-ch. The results for increasing the number of examples per type are numerically higher than the one-example case, but the differences are not statistically significant.

It is worth noting that the accuracy even with 5k UM types is considerably lower than the accuracy of the model trained on only 1k UDT types (see Table 2). We believe this discrepancy is due to the issues of biased/incomplete data noted above. For example, we analyzed the Latvian data and found that the available tables for nouns, verbs, and adjectives give rise to 78 paradigm slots. The 17 POS tags in UDT give rise to about 10 times as many paradigm slots, although only 448 are present in the unseen words of the dev set. Of these, 197 are represented amongst the 1k UDT training types, whereas only 25 are included in the 1k UM training types. As a result, about \(72\%\) of the unseen types of dev set have no representative of their paradigm slot in 1k types of UM, whereas this figure is only \(17\%\) for the 1k types of UDT.

Data AugmentationAlthough UM + Wikipedia examples alone are not sufficient to train a good lemmatizer, they might improve a low-resource baseline trained on UDT data. To see, we augmented the 1k UDT types with 1k, 5k or 10k UM

Figure 1: Average type level lemmatization exact match accuracy on unseen words of five development languages. X-axis: thousands of types in training data.

 

types with contexts from Wikipedia.

Table 3 summarizes the results, showing that despite the lower quality of the UM + Wikipedia examples, using them improves results of all systems, and more so with more examples. Improvements are especially strong for unseen types, which constitute more than 70% of types in the dev set. Furthermore, the benefit of the additional UM examples is above and beyond the effect of auto-encoding (AE Aug Baseline) for all systems in all data scenarios.

Considering the two context-free models, HMAM does better on the un-augmented 1k UDT data, but (as predicted by our results above) it benefits less from data augmentation than does Lematus 0-ch, so with added data they are statistically equivalent (\(p=0.07\) on the test set with 10k UM).

More importantly, Lematus 20-ch begins to outperform the context-free models with as few as 1k UM + Wikipedia examples, and the difference increases with more examples, eventually reaching over 4% better on the test set than the next best model (Lematus 0-ch) when 10k UM + Wikipedia examples are used (\(p<0.001\)) This indicates that the system can learn useful contextual cues even from unambiguous training examples.

Finally, Figure 2 gives a breakdown of Lematus 20-ch dev set accuracy for individual languages, showing that data augmentation helps consistently, although results suggest diminishing returns.

Data Augmentation in Medium Resource SettingTo examine the extent to which augmented data can help in the medium resource setting of 10k continuous tokens of UDT used in previous work, we follow Bergmanis and Goldwater (2018) and train Lematus 20-ch models for all ten languages using the first 10k tokens of UDT and compare them with models trained on 10k tokens of UDT augmented with 10k UM types. To provide a better comparison of our results, we report both the type and the token level development set accuracy. First of all, Table 4 shows that training on 10k continuous tokens of UDT yields a token level accuracy that is about 8% higher than when using the 1k types of UDT augmented with 10k UM types--the best-performing data augmentation systems (see Table 3). Again, we believe this performance gap is due to the issues with the biased/incomplete data noted above. For example, we analyzed errors that were unique to the model trained on the Latvian augmented data and found that 41% of the errors were due to wrongly lemmatized words other than nouns, verbs, and adjectives--the three POSs with available inflection tables in UM. For instance, improperly lemmatized pronouns amounted to 14% of the errors on the Latvian dev set. Table 4 also shows that UM examples with Wikipedia contexts benefit lemmatization not only in the low but also the medium resource setting, yielding statistically significant type and token level accuracy gains over models trained on 10k UDT continuous tokens alone (for both Unseen and All \(p<0.001\)).

## 5 Conclusion

We proposed a training data augmentation method that combines the efficiency of type-based learning and the expressive power of a context-sensitive lemmatization model. The proposed method uses Wikipedia sentences to provide contextualized examples for unambiguous inflection-lemma pairs from UniMorph tables. These examples are noisy and biased, but nevertheless they improve lemmatization accuracy on all ten languages both in low (1k) and medium (10k) resource settings. In particular, we showed that context is helpful, both overall and especially on unseen words--the first work we know of to demonstrate improvements from context in a very low-resource setting.

Figure 2: Lematus 20-ch lemmatization accuracy for each language on all types in the dev sets.

 



## References

* Nivre et al. (2017) Joakim Nivre et al. 2017. Universal dependencies 2.0 CoNLL 2017 shared task development and test data. LINDAT/CLARIN digital library at the Institute of Formal and Applied Linguistics, Charles University.
* Bergmanis and Goldwater (2018) Toms Bergmanis and Sharon Goldwater. 2018. Context Sensitive Neural Lemmatization with Lematus. In _Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_.
* Bergmanis et al. (2017) Tomas Bergmanis, Katharina Kann, Hinrich Schutze, and Sharon Goldwater. 2017. Training Data Augmentation for Low-Resource Morphological Inflection. In _Proceedings of the CoNLL-SIGMORPHON 2017 Shared Task: Universal Morphological Reinflection_, Vancouver, Canada. Association for Computational Linguistics.
* Chakrabarty et al. (2017) Abhisek Chakrabarty, Onkar Arun Pandit, and Utpal Garain. 2017. Context Sensitive Lemmatization Using Two Successive Bidirectional Gated Recurrent Networks. In _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume I: Long Papers)_, pages 1481-1491, Vancouver, Canada. Association for Computational Linguistics.
* Chrupala et al. (2008) Grzegorz Chrupala, Georgiana Dinu, and Josef van Genabith. 2008. Learning Morphology with Morfette. In _Proceedings of the Sixth International Conference on Language Resources and Evaluation (LREC'08)_, Marrakech, Morocco. European Language Resources Association (ELRA).
* Cotterell et al. (2016) Ryan Cotterell, Christo Kirov, John Sylak-Glassman, David Yarowsky, Jason Eisner, and Mans Hulden. 2016. The SIGMORPHON 2016 shared taskmorphological reinflection. In _Proceedings of the 14th SIGMORPHON Workshop on Computational Research in Phonetics, Phonology, and Morphology_, pages 10-22.
* Dreyer et al. (2008) Markus Dreyer, Jason R Smith, and Jason Eisner. 2008. Latent-Variable Modeling of String Transductions with Finite-State Methods. In _Proceedings of the conference on empirical methods in natural language processing_, pages 1080-1089. Association for Computational Linguistics.
* Garrette et al. (2013) Dan Garrette, Jason Mielens, and Jason Baldridge. 2013. Real-world semi-supervised learning of postaggers for low-resource languages. In _Proceedings of the 51st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, volume 1, pages 583-592.
* Kann and Schutze (2016) Katharina Kann and Hinrich Schutze. 2016. MED: The LMU system for the SIGMORPHON 2016 shared task on morphological reinflection. In _Proceedings of ACL_. Association for Computational Linguistics.
* Kann and Schutze (2017) Katharina Kann and Hinrich Schutze. 2017. Unlabeled Data for Morphological Generation With Character-Based Sequence-to-Sequence Models. In _Proceedings of the First Workshop on Subword and Character Level Models in NLP_, pages 76-81.
* Kirefu (2018) Faheem Kirefu. 2018. _Exploring Context Representations for Neural Lemmatisation_. Master's thesis, University of Edinburgh.
* Koehn et al. (2007) Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, et al. 2007. Moses: Open source toolkit for statistical machine translation. In _Proceedings of the 45th annual meeting of the association for computational linguistics companion volume proceedings of the demo and poster sessions_, pages 177-180.
* Makarov and Clematide (2018a) Peter Makarov and Simon Clematide. 2018a. Imitation Learning for Neural Morphological String Transduction. In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_, pages 2877-2882.
* Makarov and Clematide (2018b) Peter Makarov and Simon Clematide. 2018b. Neural Transition-based String Transduction for Limited-Resource Setting in Morphology. In _Proceedings of the 27th International Conference on Computational Linguistics_, pages 83-93.
* McCarthy et al. (2018) Arya D McCarthy, Miikka Silferberg, Ryan Cotterell, Mans Hulden, and David Yarowsky. 2018. Marrying Universal Dependencies and Universal Morphology. In _Proceedings of the Second Workshop on Universal Dependencies (UDW 2018)_, pages 91-101.
* Muller et al. (2015) Thomas Muller, Ryan Cotterell, Alexander Fraser, and Hinrich Schutze. 2015. Joint Lemmatization and Morphological Tagging with Lemma. In _Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing_, pages 2268-2274, Lisbon, Portugal. Association for Computational Linguistics.
* Prechelt (1998) Lutz Prechelt. 1998. Early Stopping-but When? _Neural Networks: Tricks of the trade_, pages 553-553.
* Press and Wolf (2017) Ofir Press and Lior Wolf. 2017. Using the Output Embedding to Improve Language Models. In _Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers_, volume 2, pages 157-163.
* Rastogi et al. (2016) Pushpendre Rastogi, Ryan Cotterell, and Jason Eisner. 2016. Weighting Finite-State Transactions With Neural Context. In _Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_, pages 623-633.
* Sennrich et al. (2018) Rico Sennrich, Orhan Firat, Kyunghyun Cho, Alexandra Birch, Barry Hadlow, Julian Hitschler, Marcin Junczys-Dowmunet, Samuel Laubli, Antonio Valerio Miceli Barone, Jozef Mokry, and Maria Nadejde.



2017. Nematus: a toolkit for neural machine translation. _CoRR_, abs/1703.04357.
* Wicentowski (2002) Richard Wicentowski. 2002. _Modeling and learning multilingual inflectional morphology in a minimally supervised framework_. Ph.D. thesis, Johns Hopkins University.

## Appendix A Lematus Training

Lematus is implemented using the _Nematus_ machine translation toolkit11. We use default training parameters of Lematus as specified by Bergmanis and Goldwater (2018) except for early stopping with patience Prechelt (1998) which we increase to 20. Similar to Bergmanis and Goldwater (2018) we use the first epochs as a burn-in period, after which we validate the current model by its lemmatization exact match accuracy on the _first 3k instances_ of development set and save this model if it performs better than the previous best model. We choose a burn-in period of 20 and validation interval of 5 epochs for models that we train on datasets up to 2k instances and a burn-in period of 10 and validation interval of 2 epochs for others. As we work with considerably smaller datasets than Bergmanis and Goldwater (2018) we reduce the effective model size and increase the rate of convergence by tying the input embeddings of the encoder, the decoder and the softmax output embeddings Press and Wolf (2017).

Footnote 11: [https://github.com/EdinburghNLP/nematus](https://github.com/EdinburghNLP/nematus)

## Appendix B Data Preparation

Wikipedia database dumps contain XML structured articles that are formatted using the _wikitext_ markup language. To obtain wordforms in their sentence context we 1) use _WikiExtractor12_ to extract plain text from Wikipedia database dumps, followed by scripts from _Moses_ statistical machine translation system13Koehn et al. (2007) to 2) split text into sentences (_split-sentences.perl_), and 3) extract separate tokens (_tokenizer.perl_). Finally, we shuffle the extracted sentences to encourage homogeneous type distribution across the entire text.

 



## Appendix C Result Breakdown by Language

\begin{table}
\begin{tabular}{c c r r r r} \hline  & **Type accuracy:** & **Ambig.** & **Unseen** & **All** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **64.3** & 39.3 & 47.2 \\  & _AE Aug Baseline_ & 49.2 & 60.3 & 63.3 \\  & _HMM_ & 41.4 & **63.8** & **67.4** \\  & _Lematus 0-ch_ & 49.2 & 59.2 & 64.2 \\  & _Lematus 20-ch_ & 53.3 & 61.7 & 66.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 40.3 & 31.2 & 34.2 \\  & _AE Aug Baseline_ & 42.5 & 63.6 & 63.6 \\  & _HMAM_ & 42.5 & **64.9** & **66.6** \\  & _Lematus 0-ch_ & 38.9 & 58.7 & 60.9 \\  & _Lematus 20-ch_ & **53.3** & 61.7 & 66.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **58.1** & 24.1 & 34.4 \\  & _AE Aug Baseline_ & 41.4 & 42.6 & 47.4 \\  & _HAM_ & 47.9 & 43.8 & 51.4 \\  & _Lematus 0-ch_ & 48.1 & 45.2 & 52.5 \\  & _Lematus 20-ch_ & 45.4 & **46.3** & **52.9** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 46.3 & 21.3 & 27.4 \\  & _AE Aug Baseline_ & 44.3 & 43.3 & 45.5 \\  & _HMM_ & 45.6 & 55.7 & 59.3 \\  & _Lematus 0-ch_ & 47.1 & 55.2 & 59.3 \\  & _Lematus 0-ch_ & **49.2** & **56.6** & **60.3** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 45.4 & 25.6 & 33.7 \\  & _AE Aug Baseline_ & 38.8 & 52.2 & 54.9 \\  & _HMM_ & 42.7 & 52.7 & 56.9 \\  & _Lematus 0-ch_ & 45.2 & 51.8 & 56.4 \\  & _Lematus 20-ch_ & **48.6** & **56.3** & **59.2** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **46.3** & 26.6 & 35.4 \\  & _AE Aug Baseline_ & 37.5 & 62.7 & 64.8 \\  & _IHAM_ & 37.4 & 62.0 & 66.4 \\  & _Lematus 0-ch_ & 45.3 & 62.3 & 67.1 \\  & _Lematus 20-ch_ & 38.1 & **66.9** & **70.3** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 37.7 & 34.9 & 43.3 \\  & _AE Aug Baseline_ & 42.6 & 53.2 & 57.0 \\  & _HMM_ & 48.3 & **57.3** & 62.7 \\  & _Lematus 0-ch_ & **51.1** & 57.0 & **62.8** \\  & _Lematus 20-ch_ & 49.0 & 55.9 & 61.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 44.4 & 34.7 & 40.6 \\  & _AE Aug Baseline_ & 42.6 & 65.7 & 67.1 \\  & _HMM_ & 43.2 & 66.1 & 68.3 \\  & _Lematus 0-ch_ & 38.7 & 64.6 & 67.3 \\  & _Lematus 20-ch_ & **50.3** & **67.6** & **70.4** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **78.4** & 42.8 & 54.2 \\  & _AE Aug Baseline_ & 58.4 & 64.8 & 70.3 \\  & _HMM_ & 53.5 & 68.9 & 73.8 \\  & _Lematus 0-ch_ & 48.8 & **70.9** & **75.4** \\  & _Lematus 20-ch_ & 56.4 & 69.7 & 74.8 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 59.9 & 26.6 & 35.5 \\  & _AE Aug Baseline_ & 58.6 & 66.9 & 69.9 \\  & _HMM_ & 56.1 & 67.0 & 69.4 \\  & _Lematus 0-ch_ & 54.1 & 65.2 & 67.8 \\  & _Lematus 20-ch_ & **62.9** & **70.6** & **73.7** \\ \hline \end{tabular}
\end{table}
Table 6: Individual type level lemmatization accuracy for all 10 languages on development set, trained on **1k UDT types (no augmentation)** with contexts from Wikipedia. The numerically highest scores for each language are bold. For the summary of results see Table 3.

\begin{table}
\begin{tabular}{r l r r r} \hline  & **Type accuracy:** & **Ambig.** & **Unseen** & **All** \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **63.5** & 39.3 & 45.0 \\  & _AE Aug Baseline_ & - & - & - \\  & _HMM_ & 50.7 & **61.0** & **63.5** \\  & _Lematus 0-ch_ & 45.9 & 51.3 & 55.7 \\  & _Lematus 20-ch_ & 41.6 & 47.2 & 52.1 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 38.1 & 31.2 & 33.0 \\  & _AE Aug Baseline_ & - & - & - \\  & _HamAM_ & **45.2** & **66.8** & **66.7** \\  & _Lematus 0-ch_ & 40.7 & 59.9 & 60.1 \\  & _Lematus 20-ch_ & 40.1 & 58.3 & 58.6 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **51.0** & 24.1 & 32.0 \\  & _AE Aug Baseline_ & - & - & - \\  & _HamAM_ & 39.9 & 41.2 & 46.2 \\  & _Lematus 0-ch_ & 38.0 & **42.8** & **47.6** \\  & _Lematus 20-ch_ & 47.8 & 39.9 & 45.9 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 46.4 & 21.3 & 26.1 \\  & _AE Aug Baseline_ & - & - & - \\  & _HAMAM_ & **44.7** & **48.0** & **50.4** \\  & _Lematus 0-ch_ & 44.4 & 41.5 & 44.9 \\  & _Lematus 20-ch_ & 44.6 & 43.0 & 46.0 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 42.4 & 25.6 & 31.6 \\  & _AE Aug Baseline_ & - & - & - \\  & _HamAM_ & 44.0 & **52.6** & **55.6** \\  & _Lematus 0-ch_ & **47.1** & 51.8 & 55.2 \\  & _Lematus 20-ch_ & 43.1 & 52.1 & 55.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **42.9** & 26.6 & 33.3 \\  & _AE Aug Baseline_ & - & - & - \\  & _Hermatus 0-ch_ & 43.1 & 52.1 & 55.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **42.9** & 26.6 & 33.3 \\  & _AE Aug Baseline_ & - & - & - \\  & _Lematus 0-ch_ & 43.1 & 52.1 & 55.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & **42.9** & 26.6 & 33.3 \\  & _AE Aug Baseline_ & - & - & - \\  & _Lematus 0-ch_ & 40.9 & 60.4 & **62.6** \\  & _Lematus 20-ch_ & 35.5 & 59.7 & 62.2 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 27.6 & 34.9 & 40.0 \\  & _AE Aug Baseline_ & - & - & - \\  & _LEAug Baseline_ & - & - & - \\  & _Lematus 0-ch_ & 44.8 & **55.1** & **57.9** \\  & _Lematus 0-ch_ & 44.6 & 50.2 & 54.9 \\ \hline \multirow{6}{*}{**CBT**} & _Baseline_ & 43.0 & 34.9 & 39.0 \\  & _AE Aug Baseline_ & - & - & - \\  & _Lem



\begin{table}
\begin{tabular}{c c r r r r} \hline  & **Type accuracy:** & **Ambig.** & **Unseen** & **All** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **67.2\%** & 39.3\% & 50.0\% \\  & _AE Aug Baseline_ & 47.9\% & 62.6\% & 65.0\% \\  & _HMM_ & 44.3\% & **68.2\%** & **72.1\%** \\  & _Lematus 0-ch_ & 43.1\% & 67.0\% & 71.1\% \\  & _Lematus 20-ch_ & 50.4\% & 65.9\% & 70.0\% \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 43.0\% & 31.2\% & 36.8\% \\  & _AE Aug Baseline_ & 43.2\% & 66.9\% & 66.6\% \\  & _HMAM_ & 41.0\% & 61.9\% & 64.7\% \\  & _Lematus 0-ch_ & 39.5\% & 61.6\% & 64.4\% \\  & _Lematus 20-ch_ & **42.6\%** & **68.4\%** & **69.7\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 62.9\% & 24.1\% & 37.1\% \\  & _AE Aug Baseline_ & 43.1\% & 40.3\% & 45.3\% \\  & _HMM_ & 48.0\% & 44.9\% & 53.3\% \\  & _Lematus 0-ch_ & 51.3\% & 45.2\% & 53.5\% \\  & _Lematus 20-ch_ & **48.6\%** & **49.7\%** & **56.3\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 49.4\% & 21.3\% & 30.3\% \\  & _AE Aug Baseline_ & 42.5\% & 44.9\% & 47.6\% \\  & _HMM_ & 44.0\% & 58.4\% & 62.5\% \\  & _Lematus 0-ch_ & 45.9\% & 60.8\% & 64.7\% \\  & _Lematus 20-ch_ & **52.5\%** & **61.9\%** & **65.5\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **45.6\%** & 25.6\% & 35.9\% \\  & _AE Aug Baseline_ & 39.6\% & 53.4\% & 55.3\% \\  & _HMAM_ & 45.2\% & 52.3\% & 57.6\% \\  & _Lematus 0-ch_ & 43.8\% & 54.5\% & 59.1\% \\  & _Lematus 20-ch_ & 44.7\% & **57.6\%** & **61.1\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **50.4\%** & 26.6\% & 39.2\% \\  & _AE Aug Baseline_ & 38.8\% & 64.1\% & 66.2\% \\  & _HMM_ & 41.6\% & 62.3\% & 68.4\% \\  & _Lematus 0-ch_ & 43.3\% & 65.2\% & 70.7\% \\  & _Lematus 20-ch_ & 40.3\% & **69.7\%** & **73.4\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 44.3\% & 34.9\% & 47.9\% \\  & _AE Aug Baseline_ & 41.3\% & 54.9\% & 58.4\% \\  & _HMM_ & 50.2\% & 58.4\% & 65.6\% \\  & _Lematus 0-ch_ & 51.4\% & 60.8\% & 67.2\% \\  & _Lematus 20-ch_ & **47.9\%** & **62.6\%** & **67.7\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 48.5\% & 34.7\% & 44.4\% \\  & _AE Aug Baseline_ & 42.1\% & 65.5\% & 66.5\% \\  & _HMM_ & 46.4\% & 65.5\% & 69.7\% \\  & _Lematus 0-ch_ & 40.5\% & 64.4\% & 68.5\% \\  & _Lematus 20-ch_ & **42.7\%** & **71.1\%** & **73.8\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **80.6\%** & 42.8\% & 58.0\% \\  & _AE Aug Baseline_ & 58.7\% & 67.3\% & 71.4\% \\  & _HMM_ & 51.9\% & **72.6\%** & **77.7\%** \\ \cline{1-1}  & _Lematus 0-ch_ & 49.1\% & 71.4\% & **76.2\%** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 61.8\% & 26.6\% & 37.9\% \\  & _AE Aug Baseline_ & 62.8\% & 68.5\% & 71.2\% \\  & _HMM_ & 54.2\% & 63.6\% & 65.7\% \\  & _Lematus 0-ch_ & 53.6\% & 63.9\% & 65.5\% \\  & _Lematus 20-ch_ & **67.1\%** & **74.6\%** & **77.2\%** \\ \hline \end{tabular}
\end{table}
Table 7: Individual type level lemmatization accuracy for all 10 languages on development set, trained on **1k UDT types plus 5k UM types** with contexts from Wikipedia. The numerically highest scores for each language are bold. For the summary of results see Table 3.

\begin{table}
\begin{tabular}{r l r r r} \hline  & **Type accuracy:** & **Ambig.** & **Unseen** & **All** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **66.2** & 39.7 & 51.2 \\  & _AE Aug Baseline_ & 48.1 & 62.8 & 65.4 \\  & _HHAM_ & 42.7 & **70.6** & **74.2** \\  & _Lematus 0-ch_ & 44.8 & 67.4 & 71.4 \\  & _Lematus 20-ch_ & 50.6 & 68.4 & 72.5 \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 43.2 & 31.5 & 38.2 \\  & _AE Aug Baseline_ & 44.9 & 68.0 & 68.1 \\  & _HWAM_ & 41.1 & 61.7 & 64.7 \\  & _Lematus 0-ch_ & 38.1 & 61.9 & 64.6 \\  & _Lematus 20-ch_ & **42.7** & **68.7** & **70.1** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **62.0** & 24.3 & 37.8 \\  & _AE Aug Baseline_ & 45.8 & 41.0 & 45.8 \\  & _HMM_ & 48.9 & 45.4 & 53.7 \\  & _Lematus 0-ch_ & 46.6 & 45.7 & 53.8 \\  & _Lematus 20-ch_ & 44.9 & **51.3** & **57.5** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 49.3 & 21.9 & 32.7 \\  & _AE Aug Baseline_ & 41.6 & 46.0 & 48.5 \\  & _HMM_ & 45.0 & 59.2 & 62.7 \\  & _Lematus 0-ch_ & 43.2 & 62.8 & 66.2 \\  & _Lematus 20-ch_ & **49.4** & **63.8** & **67.0** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 46.7 & 25.8 & 36.9 \\  & _AE Aug Baseline_ & 41.6 & 52.0 & 54.6 \\  & _HMM_ & 44.6 & 53.8 & 59.0 \\  & _Lematus 0-ch_ & 42.6 & 55.3 & 59.7 \\  & _Lematus 20-ch_ & **47.7** & **60.6** & **64.0** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & **48.7** & 27.0 & 42.1 \\  & _AE Aug Baseline_ & 36.8 & 64.3 & 65.4 \\  & _HMM_ & 44.0 & 60.9 & 66.4 \\  & _Lematus 0-ch_ & 46.2 & 67.2 & 72.4 \\  & _Lematus 20-ch_ & 42.0 & **71.2** & **75.1** \\ \hline \multirow{4}{*}{**channel**} & _Baseline_ & 43.7 & 35.5 & 49.6 \\  & _AE Aug Baseline_ & 41.0 & 54.3 & 57.2 \\  & _HMM_ & 45.6 & 56.8 & 63.7 \\  & _Lematus 0-ch_ & 50.3



\begin{table}
\begin{tabular}{l l c c c c c c} \hline  & \multicolumn{5}{c}{**Type level accuracy:**} \\  & \multicolumn{1}{c}{**Training data**} & \multicolumn{1}{c}{**Ambig.**} & \multicolumn{1}{c}{**Unseen**} & \multicolumn{1}{c}{**All**} & \multicolumn{1}{c}{**Ambig.**} & \multicolumn{1}{c}{**Unseen**} & \multicolumn{1}{c}{**All**} \\ \hline
**Bulgarian** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDP tok. + 10k UM types \\ \end{tabular} & 
\begin{tabular}{c} **62.3** \\ 62.2 \\ \end{tabular} & 75.7 & 80.1 & 72.3 & 75.7 & 89.5 \\
**Czech** & 
\begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & 49.7 & 76.4 & 77.8 & **80.7** & 77.7 & 88.3 \\
**Estonian** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} **52.4** \\ **65.9** \\ \end{tabular} & \begin{tabular}{c} **78.3** \\ **63.4** \\ \end{tabular} & \begin{tabular}{c} **80.4** \\ **80.0** \\ \end{tabular} & 
\begin{tabular}{c} 80.0 \\ **89.6** \\ \end{tabular} \\ \hline
**Finnish** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 65.3 \\ **65.9** \\ \end{tabular} & \begin{tabular}{c} 54.0 \\ **63.4** \\ \end{tabular} & \begin{tabular}{c} 64.5 \\ **72.6** \\ \end{tabular} & \begin{tabular}{c} 80.1 \\ **81.5** \\ \end{tabular} & \begin{tabular}{c} 54.3 \\ **64.2** \\ \end{tabular} & 
\begin{tabular}{c} 76.8 \\ **82.4** \\ \end{tabular} \\ \hline
**Finnish** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} **60.7** \\ 57.8 \\ \end{tabular} & \begin{tabular}{c} 60.1 \\ **63.7** \\ \end{tabular} & \begin{tabular}{c} 66.5 \\ **69.4** \\ \end{tabular} & \begin{tabular}{c} **73.8** \\ 70.3 \\ \end{tabular} & \begin{tabular}{c} 62.4 \\ **66.0** \\ \end{tabular} & 
\begin{tabular}{c} 78.2 \\ **79.8** \\ \end{tabular} \\ \hline
**Latvian** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 57.5 \\ **58.9** \\ \end{tabular} & \begin{tabular}{c} 70.9 \\ **73.6** \\ \end{tabular} & \begin{tabular}{c} 75.6 \\ **77.8** \\ \end{tabular} & \begin{tabular}{c} 69.2 \\ **70.2** \\ \end{tabular} & \begin{tabular}{c} 70.5 \\ **73.8** \\ \end{tabular} & 
\begin{tabular}{c} 82.6 \\ **84.4** \\ \end{tabular} \\ \hline
**Polish** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} **59.8** \\ 57.4 \\ \end{tabular} & \begin{tabular}{c} 78.7 \\ **81.2** \\ \end{tabular} & \begin{tabular}{c} 83.6 \\ **86.1** \\ \end{tabular} & \begin{tabular}{c} **76.5** \\ 71.3 \\ \end{tabular} & \begin{tabular}{c} 78.8 \\ **81.4** \\ \end{tabular} & 
\begin{tabular}{c} 89.5 \\ **90.9** \\ \end{tabular} \\ \hline
**Romanian** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 51.7 \\ **57.1** \\ \end{tabular} & \begin{tabular}{c} 61.1 \\ **68.2** \\ \end{tabular} & \begin{tabular}{c} 66.6 \\ **74.2** \\ \end{tabular} & \begin{tabular}{c} 54.1 \\ **60.7** \\ \end{tabular} & \begin{tabular}{c} 60.6 \\ **68.2** \\ \end{tabular} & 
\begin{tabular}{c} 79.1 \\ **83.9** \\ \end{tabular} \\ \hline
**Russian** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} **64.4** \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 80.5 \\ **82.6** \\ \end{tabular} & \begin{tabular}{c} 83.5 \\ **85.9** \\ \end{tabular} & \begin{tabular}{c} **65.9** \\ 59.9 \\ \end{tabular} & \begin{tabular}{c} 80.8 \\ **82.7** \\ \end{tabular} & 
\begin{tabular}{c} 88.5 \\ **89.8** \\ \end{tabular} \\ \hline
**Swedish** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 63.2 \\ **65.1** \\ \end{tabular} & \begin{tabular}{c} 74.9 \\ **78.4** \\ \end{tabular} & \begin{tabular}{c} 80.9 \\ **83.7** \\ \end{tabular} & \begin{tabular}{c} 78.5 \\ **79.0** \\ \end{tabular} & \begin{tabular}{c} 73.6 \\ **75.9** \\ \end{tabular} & 
\begin{tabular}{c} 89.6 \\ **90.4** \\ \end{tabular} \\ \hline
**Turkish** & \begin{tabular}{c} 10k UDT tok. \\ 10k UDT tok. + 10k UM types \\ \end{tabular} & \begin{tabular}{c} 64.2 \\ **82.9** \\ \end{tabular} & \begin{tabular}{c} 82.1 \\ **87.3** \\ \end{tabular} & \begin{tabular}{c} 87.1 \\ **76.9** \\ \end{tabular} & \begin{tabular}{c} 73.1 \\ **82.7** \\ \end{tabular} & 
\begin{tabular}{c} 81.8 \\ **91.5** \\ \end{tabular} \\ \hline \end{tabular}
\end{table}
Table 9: Individual type and token level lemmatization accuracy for all 10 languages on development set for Lematus 20-ch models trained on **10k UDT tokens** and **10k UDT tokens plus 10k UM types** with contexts from Wikipedia. The numerically highest scores for each language are bold. For the summary of results see Table 4.