<<

How low is too low? A monolingual take on lemmatisation in Indian languages

Kumar Saunack∗, Kumar Saurav∗, Pushpak Bhattacharyya IIT Bombay {krsaunack, krsrv, pb}@cse.iitb.ac.in

Abstract are limited by resource availability. This is a relevant point for Indian languages. For in- Lemmatization aims to reduce the sparse stance, as many as 197 Indian languages are data problem by relating the inflected in the UNESCO’s Atlas of the ”World’s Lan- forms of a to its dictionary form. Most prior work on ML based lemmati- guages in Danger, 2010”. Even among the 22 zation has focused on high resource lan- scheduled languages of India, there is a wide guages, where data sets (word forms) are disparity in resource availability, for example, readily available. For languages which for Konkani and Kashmiri (Rajan et al., 2020; have no linguistic work available, espe- Islam et al., 2018). cially on morphology or in languages where the computational realization of linguistic Techniques like Porter stemmer are indeed rules is complex and cumbersome, machine quick solutions, but they are suited only for learning based lemmatizers are the way to alphabetic script languages, like English, and go. In this paper, we devote our attention not abugida, like Bengali (Ali et al., 2017), or to lemmatisation for low resource, morpho- abjad, like Urdu (Kansal et al., 2012), script logically rich scheduled Indian languages languages. Moreover, creating stemmers re- using neural methods. Here, low resource quires different language specific al- means only a small number of word forms gorithms. This requirement of language spe- are available. We perform tests to analyse the variance in monolingual models’ perfor- cific measures comes in the way of scaling the mance on varying the corpus size and con- enterprise of creating stemmers for the hun- textual morphological tag data for train- dreds and thousands of languages that exist ing. We show that monolingual approaches in the world. One might think of ML for with data augmentation can give competi- stemming- for example, training a neural net tive accuracy even in the low resource set- with stems and word forms; but almost none ting, which augurs well for NLP in low re- of the 22 scheduled Indian languages, which is source setting. just a subset of the numerous languages spo- 1 Introduction ken and written in India, have resources suffi- cient for training deep models (Bhattacharyya Natural Language Processing (NLP) has seen et al., 2019). For a majority of Indian lan- remarkable growth in all its sub-areas like ma- guages, the absence of dictionaries compounds chine translation, summarization, question an- the problem. swering and so on. For all these tasks, though, Most of the current approaches for morpho- morphemes remain the most basic form of in- logical analysis use the idea of cross-lingual formation (Otter et al., 2020). Morpheme transfer learning from a higher resource lan- identification (lemma and affixes) can assist guage to the low resource language (McCarthy these very useful large applications by solving et al., 2019) of interest. We show that even the data sparsity problem. monolingual models can consistently perform Good lemmatisers are invaluable tools for with high accuracy with even as little as 500 handling large vocabulary in morphologically samples, without cross-lingual training of neu- rich languages and thereby boosting perfor- ral models and without structured informa- mance in downstream tasks, but techniques tion like dictionaries. We further demonstrate *These authors contributed equally to this work good performance in extremely low resource 4088

Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational : Human Language Technologies, pages 4088–4094 June 6–11, 2021. ©2021 Association for Computational Linguistics setting with as few as 100 training examples Neubig (2019) for more details and explana- samples to train on and show a competitive tions about the two-step attention process and performance against cross-lingual models in Cohn et al. (2016) for more details regarding the same setting. structural bias.

2 Related work 4 Experiments In Zeman et al. (2018), lemmatisation was 4.1 Data performed for small exploiting the From the SIGMORPHON 2019 shared task, common annotation standard across all lan- we collect language data from the multi- guages, and the same task was implicit in lingual morphological inflection task for Ben- Nivre et al. (2017). Recently, there has been a gali, Hindi, Kannada, Sanskrit, Telugu, and shift to extremely low resource settings with Urdu. Out of these, Telugu is the only one the SIGMORPHON 2019 shared task (Mc- that does not have a large data set (inflected Carthy et al., 2019) focusing on cross-lingual word forms). We use the same task categoriza- learning. However, their task focuses on the tion of high or low resource languages as SIG- reverse direction: given a lemma and a set of MORPHON. Each training sample is a triplet: morphological features, generate a target in- (inflected word, lemma, tag), where tag flected form. refers to the set of morphological features for the inflected word. 3 Models A detailed description of the dataset that A two-step attention process (Anastasopoulos we use for training is provided in Table 1. and Neubig, 2019) similar to the SIGMOR- PHON 2019 morphological inflection task (Mc- Language Total High Low Carthy et al., 2019) has been adapted for the Bengali (bn) 3,394 3,394 100 setup, which consists of four components: en- Hindi (hi) 10,000 10,000 100 coder for morphological tags, encoder charac- Kannada (kn) 3,506 3,506 100 ter sequence, attention and a decoder. Sanskrit (sa) 10,000 10,000 100 The inputs to the model are inflected Telugu (te) 61 - 61 and morphological tags, and we use self- Urdu (ur) 10,000 10,000 100 attention single layer bidirectional LSTM with- Table 1: Number of inflected-word lemma pairs out positional embeddings as encoders. At available for each language. Total - original each time step, during decoding, two context number of samples, High and Low - training vectors are created via two different attention dataset size in high and low resource settings. matrices over the output from the encoding of inflected word and morphological tag. We create the smaller data sets from the At the decoder, we use a two-step process: high-resource data sets using the sampling first we create a tag-informed state by attend- method based on probability distributions ing over tags using the output from the de- mentioned in Cotterell et al. (2018). During coder at the previous time step. Second, we training for smaller data sets, we use augmen- use this to attend over the source characters tation from Cotterell et al. (2016). This par- to produce the state vector for the decoder at ticular augmentation method relies on substi- that time step, which is used for producing tuting stems in a word with random sequences the output character for that time step using of characters while preserving its length. a fully connected layer followed by a softmax. We also annotate data sets with tag informa- We also add structural bias to the atten- tion to create multiple data sets for analysing tion model that encourages Markov assump- the effects of data set size and the importance tion over alignments, that is, if the i-th source of tag information on the accuracy of the mod- character is aligned to the j-th target one, els. alignments from the (i+1)-th or ith to (j +1)- th character are preferred. 4.2 Training We refer the reader to Anastasopoulos and The model runs in two phases: 4089 (a) Complete tag data (b) Zero tag data

Figure 1: Accuracy when differing amounts of morphological data are used for training the models. Number of samples used in training are on X-axis (100-aug represents training dataset of 100 augmented to reach 10,000).

Warm-up Phase For each triple (X, Y, T) tures, (2) basic PoS tag data, and (3) all mor- in the original data, we create two new tu- phological features. We report accuracies over ples (X, X, [COPY]) and (Y, Y, T) and train complete string matching for our experiments. the model on the new tuples (Anastasopou- Figure 1 shows the graphs for accuracy ver- los and Neubig, 2019). This helps the model sus data. When the complete set of morpho- learn a monotonic alignment in the attention logical features is included in training, most model, which is effective for character level languages achieve extremely high accuracy (at transduction tasks (Wu and Cotterell, 2019) least 95%, except for Kannada), even when while avoiding any explicit modelling of such data set sizes are as small as 1000. When the a structural bias. The training switches to the data set size is 500, the accuracy drop to the next phase when accuracy on the validation range 80-90% but are still competitive wrt rule- set exceeds 75%. based lemmatisers across languages (Bhat- (X, Y, T) triplet example for Hindi: (तू रहेगी, tacharyya et al., 2014) like Sanskrit(Raulji and रहना, V;V.PTCP;PST). A Spanish example Saini, 2019), Hindi(Paul et al., 2013), Ben- would be (bailaba, bailar, V;V.PTCP;PRS). gali(Shakib et al., 2019), Urdu(Gupta et al., 2015) and Kannada(Prathibha and Padma, Main Phase The training tuple (X, Y, T) is 2015). However, the performance drops dras- fed into the system, and the model is allowed tically when the data set size is reduced to to learn the distribution over the data. A cool 100. Performance on the augmented data sets down period is also used while training to im- shows a marked increase in accuracy over the prove the accuracy of the model. We also em- unaugmented 100 training samples, but is still ploy early stopping with a higher threshold below the performance of models trained on than the cool down period so that the train- 500 samples. ing stops when no further progress is possible. Telugu is not included in Figure 1 due to Hyperparameters for our models are dis- the lack of training samples. We train only cussed in appendix A.1. We also release all one model over the available 61 samples (aug- our code online for reproducibility and further mented to 10,000). The model achieves an ac- research. * curacy of 80% on the SIGMORPHON Task 1 test set for Telugu. 5 Results and Discussions 5.2 Variation with morphological 5.1 Variation with number of training information word-pairs Comparing Figure 1(a) and 1(b), we see that We create three models for each training set tag data does not provide substantial addi- size. They contain (1) no morphological fea- tional information to the model when the data *https://github.com/krsrv/lemmatisation set size exceeds 2000, barring the case for San- 4090 2000 1000 500 100 100-aug No tag PoS No tag PoS No tag PoS No tag PoS No tag PoS bn -3.60 0.00 -5.72 -2.74 -3.49 1.89 12.77 50.00 2.13 17.02 hi 2.44 9.97 -8.97 2.61 -6.65 -5.10 -5.17 -27.59 -30.77 -3.85 kn -4.70 4.04 -18.15 -3.08 -7.47 -1.87 97.60 33.33 -4.76 -11.90 sa -11.30 -4.86 -5.52 -5.52 -4.32 -40.16 40.91 -22.73 -9.52 14.29 ur -2.93 -0.40 -1.73 -1.53 -8.41 -0.22 141.53 82.20 -36.84 -21.05

Table 2: Each column represents the percentage change in accuracy compared to the accuracy when all morph tags were used. No tag - no morph tag, PoS - basic PoS tag data as inputs. The topmost row represents the number of samples. skrit. At 500, there is a spike in accuracy for Avg bn hi kn sa ur mono Sanskrit which is probably explained by the cross fact that Sanskrit is a morphologically and se- bn - 60 59 57 59 58.8 55 mantically systematic language with very few hi 45 - 45 45 45 45 26 ambiguities (evident from its linguistic and kn 52 53 - 44 48 49.3 42 grammar text Aṣṭādhyāyī by Pāṇini), and thus sa 70 68 74 - 70 70.5 72 is the language with highest responsiveness ur 24 23 20 10 - 19.3 38 to augmentation with tag data. Below 4000, the morphological tag data substantially im- Table 3: Accuracy of the cross-lingual model on different language pairs. Columns: high resource proves the accuracy. Sanksrit and Kannada languages, Rows: low resource languages. both show worse results compared to other lan- (Accuracy is measured via a complete string guages, which is likely due to the complex in- match.) flection patterns in both languages.

The gains from including tag information 5.3 Comparison with cross-lingual are better visualised in Table 2. A negative models value in the table indicates that the model’s We also train cross models using the same performance decreases in absence of tag data. method as monolingual training and incor- In general, we see that full-tag informed mod- porate the training procedure described by els perform the best, followed by basic PoS tag Artetxe et al. (2020) (the hyperparameters are informed models and finally models without listed in appendix A.2). We simulate a low tag information. resource language by choosing 100 samples at The table also shows that the importance of random and use all the other languages as high tag data increases considerably with decrease resource languages. Macro averaged accuracy in the training set size. However, an anomaly for a simulated low resource language shows occurs with 100 training samples, when the that monolingual models give comparable ac- absence of tag information improves the per- curacies when compared to cross-lingual mod- formance. A possible explanation is that the els, with the exception of Hindi. Performance number of training samples is too low and the of Sanskrit and Urdu, especially Urdu, seem model is not able to learn what to focus on to be better when the mono-lingual models are effectively. This anomaly disappears when we used. augment the data before training the model. The complete list of accuracies for the cross- Note that achieving 100% accuracy on lingual models are listed in Table 3. The lemmatization without any tag information is macro-averaged difference between the cross- not possible with any data set size. Some lingual and monolingual model is -2 in the words can have multiple lemmas and require cross-lingual models’ favor. context for disambiguation: (kee) can map क 6 Conclusion to either करना (karana) or का (kaa) depending on whether it is used as a postposition or a We have given a methodology for lemmatiza- verb. tion of low resource (i.e., availability of small 4091 number of word forms) in this paper. For most equitable distribution of technology and qual- languages, a monolingual model trained on ap- ity of life across the globe. proximately 1000 training samples gives com- petitive accuracy, while training on 500 sam- ples gives results at par with rule-based linguis- References tic systems. For extremely-low resource set- Mubashir Ali, Shehzad Khalid, and Muham- tings as well, monolingual models perform well mad Haseeb Aslam. 2017. Pattern based com- prehensive urdu stemmer and short text classifi- with the help of data augmentation. Even in cation. IEEE Access, 6:7374–7389. these scenarios, monolingual models can give competitive results compared to cross-lingual Antonios Anastasopoulos and Graham Neubig. models, a result that is supported by research 2019. Pushing the limits of low-resource morphological inflection. arXiv preprint in other tasks such as morphological inflection arXiv:1908.05838. (Anastasopoulos and Neubig, 2019). Additionally, in the low resource setting, ad- Mikel Artetxe, Sebastian Ruder, and Dani Yo- gatama. 2020. On the cross-lingual transfer- ditional features are an important source of in- ability of monolingual representations. In Pro- formation. Even PoS tags benefit the training ceedings of the 58th Annual Meeting of the As- process. sociation for Computational Linguistics, pages 4623–4637, Online. Association for Computa- 6.1 Areas of improvement tional Linguistics. The model currently does not exploit any lin- Pushpak Bhattacharyya, Ankit Bahuguna, Lavita guistic knowledge available to improve its per- Talukdar, and Bornali Phukan. 2014. Facilitat- ing multi-lingual sense annotation: Human me- formance. Incorporating morphological rules diated lemmatizer. In Proceedings of the Sev- or using bilingual knowledge to create trans- enth Global Wordnet Conference, pages 224–231. fer models could grant accuracy gains (Ge- Pushpak Bhattacharyya, Hema Murthy, Surangika breselassie et al., 2020; Faruqui et al., 2015). Ranathunga, and Ranjiva Munasinghe. 2019. In- Moreover, transformers have been shown to dic language computing. Communications of the improve performance on character level tasks ACM, 62(11):70–75. which would be applicable method here (Wu Trevor Cohn, Cong Duy Vu Hoang, Ekaterina Vy- et al., 2020). Another potential area of im- molova, Kaisheng Yao, Chris Dyer, and Gho- provement could be the usage of different data lamreza Haffari. 2016. Incorporating struc- hallucination techniques like in Shcherbakov tural alignment biases into an attentional neural et al. (2016), which uses phonetics instead of translation model. In Proceedings of the 2016 Conference of the North American Chapter of relying on characters for predictions. the Association for Computational Linguistics: Human Language Technologies, pages 876–885, 7 Ethical Considerations San Diego, California. Association for Computa- tional Linguistics. The work in this paper can be useful for ex- panding the power of language understand- Ryan Cotterell, Christo Kirov, John Sylak- Glassman, Géraldine Walther, Ekaterina Vylo- ing to ethnic/local languages. This can conse- mova, Arya D. McCarthy, Katharina Kann, Sab- quently bring these low-resource language do- rina J. Mielke, Garrett Nicolai, Miikka Silfver- mains within the umbrella of widespread NLP berg, David Yarowsky, Jason Eisner, and Mans applications in edge computing devices. By Hulden. 2018. The CoNLL–SIGMORPHON 2018 shared task: Universal morphological re- focusing on low-resource domains, we under- inflection. In Proceedings of the CoNLL– stand how lightweight models fare in these set- SIGMORPHON 2018 Shared Task: Universal tings, thereby leading to potential trimming Morphological Reinflection, pages 1–27, Brussels. down of model sizes, training time, compute Association for Computational Linguistics. costs etc., which is a significant step towards Ryan Cotterell, Christo Kirov, John Sylak- maintaining energy and carbon costs. Glassman, David Yarowsky, Jason Eisner, and Such developments also spur the progress of Mans Hulden. 2016. The sigmorphon 2016 shared task—morphological reinflection. In Pro- languages and the civilisations associated with ceedings of the 14th SIGMORPHON Work- them by bringing them into the advanced tech- shop on Computational Research in Phonetics, nological manifolds, and thereby bring more Phonology, and Morphology, pages 10–22. 4092 Manaal Faruqui, Yulia Tsvetkov, Graham Neubig, RJ Prathibha and MC Padma. 2015. Design of rule and Chris Dyer. 2015. Morphological inflection based lemmatizer for kannada inflectional words. generation using character sequence to sequence In 2015 International Conference on Emerging learning. arXiv preprint arXiv:1512.06110. Research in Electronics, Computer Science and Technology (ICERECT), pages 264–269. IEEE. Tewodros Gebreselassie, Amanuel Mersha, and Michael Gasser. 2020. A translation-based ap- Annie Rajan, Ambuja Salgaonkar, and Ramprasad proach to morphology learning for low resource Joshi. 2020. A survey of konkani nlp resources. languages. In Proceedings of the The Fourth Computer Science Review, 38:100299. Widening Natural Language Processing Work- shop, pages 36–40. Jaideepsinh K Raulji and Jatinderkumar R Saini. 2019. Sanskrit lemmatizer for improvisation of Vaishali Gupta, Nisheeth Joshi, and Iti Mathur. morphological analyzer. Journal of Statistics 2015. Design & development of rule based in- and Management Systems, 22(4):613–625. flectional and derivational urdu stemmer ‘usal’. MD Shahidul Salim Shakib, Tanim Ahmed, and In 2015 International conference on futuristic KM Azharul Hasan. 2019. Designing a bangla trends on computational analysis and knowledge stemmer using rule based approach. In 2019 management (ABLAZE), pages 7–12. IEEE. International Conference on Bangla Speech and Language Processing (ICBSLP), pages 1–4. Saiful Islam, Abhijit Paul, Bipul Shyam IEEE. Purkayastha, and Ismail Hussain. 2018. Con- struction of english-bodo parallel Andrei Shcherbakov, Ekaterina Vylomova, and for statistical . Interna- Nick Thieberger. 2016. Phonotactic modeling tional Journal on Natural Language Computing of extremely low resource languages. In Proceed- (IJNLC) Vol, 7. ings of the Australasian Language Technology As- sociation Workshop 2016, pages 84–93. Rohit Kansal, Vishal Goyal, and Gurpreet Singh Lehal. 2012. Rule based urdu stemmer. In Pro- Shijie Wu and Ryan Cotterell. 2019. Exact hard ceedings of COLING 2012: Demonstration Pa- monotonic attention for character-level trans- pers, pages 267–276. duction. In Proceedings of the 57th Annual Meet- ing of the Association for Computational Lin- Arya D. McCarthy, Ekaterina Vylomova, Shi- guistics, pages 1530–1537, Florence, Italy. Asso- jie Wu, Chaitanya Malaviya, Lawrence Wolf- ciation for Computational Linguistics. Sonkin, Garrett Nicolai, Christo Kirov, Miikka Silfverberg, Sabrina J. Mielke, Jeffrey Heinz, Shijie Wu, Ryan Cotterell, and Mans Hulden. 2020. Ryan Cotterell, and Mans Hulden. 2019. The Applying the transformer to character-level SIGMORPHON 2019 shared task: Morphologi- transduction. arXiv preprint arXiv:2005.10213. cal analysis in context and cross-lingual transfer for inflection. In Proceedings of the 16th Work- Daniel Zeman, Jan Hajic, Martin Popel, Martin shop on Computational Research in Phonetics, Potthast, Milan Straka, Filip Ginter, Joakim Phonology, and Morphology, pages 229–244, Flo- Nivre, and Slav Petrov. 2018. Conll 2018 shared rence, Italy. Association for Computational Lin- task: Multilingual from raw text to guistics. . In Proceedings of the CoNLL 2018 Shared Task: Multilingual parsing Joakim Nivre, Lars Ahrenberg ˇZeljko Agic, et al. from raw text to universal dependencies, pages 2017. Universal dependencies 2.0–conll 2017 1–21. shared task development and test data. LIN- DAT/CLARIN digital library at the Institute of A Appendix Formal and Applied Linguistics, Charles Univer- sity. All our models were trained on a single 12 GB Nvidia GeForceGTX TitanXGPU and finished Daniel W Otter, Julian R Medina, and Jugal K training within an hour. Kalita. 2020. A survey of the usages of deep learning for natural language processing. IEEE A.1 Hyperparameters Transactions on Neural Networks and Learning Systems. We use the Adam optimiser with the default parameters except for learning rate. The train- Snigdha Paul, Mini Tandon, Nisheeth Joshi, and ing time for each model was between 1 to 3 Iti Mathur. 2013. Design of a rule based hindi lemmatizer. In Proceedings of Third Interna- hours. We list out the hyperparameters used tional Workshop on Artificial Intelligence, Soft by use during training: Computing and Applications, Chennai, India, pages 67–74. Citeseer. • Batch size: 10 4093 • Training epochs: 10

• Activation function: Squish

• Learning rate: 10e-3

All the hyperparameters were tuned using the validation set over all languages over a uniform distribution and the best models were selected based on accuracy.

A.2 Cross-lingual models The cross-lingual method that we use corre- sponds to the method described by Artexte et al. (2019) and so there are 4 phases of training. We list out the hyperparameters as comma sep- arated values:

• Batch size: 10

• Training epochs: 10,10,10,10

• Activation function: Squish

• Learning rate: 10e-3,10e-3,10e-3,10e-3

The 4 phases refer to the following:

• P1 : training on high resource language, with same output and input (copying phase for high resource language)

• P2 : training on low resource language, with same output and input (copying phase for low resource language)

• P3 : training on high resource language, with expected input (inflected word + tag) and output (lemma)

• P4 : training on low resource language, with expected input (inflected word + tag) and output (lemma)

4094