Arxiv:2004.00033V2

Arxiv:2004.00033V2

Give your Text Representation Models some Love: the Case for Basque Rodrigo Agerri1∗,Inaki˜ San Vicente2∗, Jon Ander Campos1∗, Ander Barrena1∗, Xabier Saralegi2, Aitor Soroa1, Eneko Agirre1 1 IXA Group, HiTZ Centre, University of the Basque Country (UPV/EHU), 2Elhuyar Foundation {rodrigo.agerri, jonander.campos, ander.barrena, a.soroa, e.agirre}@ehu.eus {i.sanvicente, x.saralegi}@elhuyar.eus Abstract Word embeddings and pre-trained language models allow to build rich representations of text and have enabled improvements across most NLP tasks. Unfortunately they are very expensive to train, and many small companies and research groups tend to use models that have been pre-trained and made available by third parties, rather than building their own. This is suboptimal as, for many languages, the models have been trained on smaller (or lower quality) corpora. In addition, monolingual pre-trained models for non-English languages are not always available. At best, models for those languages are included in multilingual versions, where each language shares the quota of substrings and parameters with the rest of the languages. This is particularly true for smaller languages such as Basque. In this paper we show that a number of monolingual models (FastText word embeddings, FLAIR and BERT language models) trained with larger Basque corpora produce much better results than publicly available versions in downstream NLP tasks, including topic classification, sentiment classification, PoS tagging and NER. This work sets a new state-of-the-art in those tasks for Basque. All benchmarks and models used in this work are publicly available. Keywords: Neural language representation models, Information Extraction, Less-resourced languages 1. Introduction from news outlets (191M tokens). Another important is- sue is subword tokenization. Thus, for some common Word embeddings and pre-trained language models al- Basque words such as etxerantz (to the house) or low to build rich representations of text and have en- medikuarenera (to the doctor), the subword tokeniza- abled improvements across most NLP tasks. The most tion generated by the monolingual BERT we trained will successful models include word embeddings like Fast- substantially differ from the output produced by the multi- Text (Bojanowski et al., 2017), and, more recently, pre- lingual BERT: trained language models which can be used to produce contextual embeddings or directly fine-tuned for each task. mBERT: Et #xer #ant #z Good examples of the later are character-based models ours: Etxera #ntz like Flair (Akbik et al., 2018) and masked language models like BERT (Devlin et al., 2019). In many cases the teams mBERT: Medi #kua #rene #ra that developed the algorithms also release their models, ours: Mediku #aren #era which facilitates both reproducibility and their application in downstream tasks. Given that the models are expensive More specifically, mBERT’s subwords tend to be shorter to train, many companies and research groups tend to use and less interpretable, while our subwords are closer to those models, rather than building their own. This could be linguistically interpretable strings, like mediku (doctor) suboptimal as, for many languages, the models have been arXiv:2004.00033v2 [cs.CL] 2 Apr 2020 aren (’s) and era (to the). trained on easily obtained public corpora, which tends to Furthermore, most of the time the released models have be smaller and/or of lower quality that other existing cor- been thoroughly tested only in English. Alternatively, mul- pora. In addition, pre-trained language models for non- tilingual versions have been tested in transfer learning sce- English languages are not always available. In that case, narios for other languages, where they have not been com- only multilingual versions are available, where each lan- pared to monolingual versions (Devlin et al., 2019). The guage shares the quota of substrings and parameters with goal of this paper is to compare publicly available models the rest of the languages, leading to a decrease in perfor- for Basque with analogous models which have been trained mance (Devlin et al., 2019). The chances for smaller lan- with a larger, better quality corpus. This has been possible guages, as for instance Basque, seem even direr, as easily for the FastText and Flair models. In the case of BERT, available public corpora is very limited, and the quota of only the multilingual version for 104 languages is avail- substrings depends on corpus size. able for Basque. We focus on four downstream NLP tasks, As an illustration of the issues mentioned above, the mul- namely, topic classification, sentiment classification, Part- tilingual BERT which Basque shares with other 103 lan- of-Speech (POS) tagging and Named Entity Recognition guages is based on Wikipedia corpora, where English (NER). amounts to 2.5 thousand million tokens whereas for Basque The main contribution of our work is threefold: (1) We it contains around 35 million tokens. Our corpus uses, show that, in the case of Basque, publicly available mod- in addition to the Basque Wikipedia, corpora crawled els can be outperformed by analogous models trained with appropriate corpora. (2) We improve the state of the art in idea is to be able to generate different word representa- four tasks for Basque. (3) We make all our models publicly tions according to the context in which the word appears. available1. Our results show that this is indeed the case for Examples of such contextual representations are ELMO FastText and Flair models. In the case of BERT, we show (Peters et al., 2018) and Flair (Akbik et al., 2018), which that the monolingual Basque BERTeus model2 outperforms are built upon LSTM-based architectures and trained as the official multilingual BERT by a large margin, with up to language models. More recently, Devlin et al. (2019) in- 10 absolute point improvement. The increases are consis- troduced BERT, a model based on the transformer archi- tent for the three models in all four tasks. Our experiments tecture trained as a masked language model, which has have been performed training models which are analogous obtained very good results on a variety of NLP tasks. to the corresponding existing pre-trained models. This al- The multilingual counterpart of BERT, called mBERT, is lows to make a head-to-head comparison, and to conclude a single language model pre-trained from corpora in more that the training corpus is key. In the case of BERT, training than 100 languages. mBERT enables to perform transfer a monolingual model instead of a multilingual one shared knowledge techniques among languages, so that systems with 103 other languages is also a key factor, so we can can be trained on datasets in languages different to the rule out that it is not any change in the models that cause one used to fine tune them (Heinzerling and Strube, 2019; the better performance. Pires et al., 2019). Although our results set a new state of the art for the four When pre-training mBERT the corpora sizes in different tasks, our goal was not to train and use the systems in the languages are very diverse, with English corpora being most optimal manner. Instead, and as mentioned before, we order of magnitudes larger than that of the minority lan- have focused on head-to-head comparisons. In this sense, guages. The authors alleviate this issue by oversampling better results could be expected using variations of pre- examples of lower resource languages. However, as the pa- trained models that have reported better results for English rameters and vocabulary is shared across the languages, this (Liu et al., 2019), or making an effort in developing better means that each language has to share the quota of sub- adaptations to each of the tasks. strings and parameters with the rest of the languages. As shown in the introduction, this causes tokenization prob- 2. Related work lems for low resource languages. Deep learning methods in NLP rely on the abil- CamemBERT (Martin et al., 2019) is a recent effort to ity to represent words as continuous vectors build custom RoBERTa (Liu et al., 2019) pre-trained lan- on a low dimensional space, called word em- guage models for French, using 138GB of text from beddings. Word2vec (Mikolovetal.,2013) or a monolingual French corpus extracted from Common GloVe (Penningtonetal.,2014) are among the best Crawl. The authors show that CamemBERT obtains signif- models that build word embeddings by analyzing icant improvements on many French tasks compared to the co-occurrence patterns extracted from large corpora. Fast- publicly available multilingual BERT. However, the archi- Text (Bojanowski et al., 2017) proposes an improvement tecture used in CamemBERT is different to BERT, which over those models, consisting on embedding subword makes the comparison among the models less straightfor- units, thereby attempting to introduce morphological ward. In contrast, we try to mimic the BERT architecture information. Rich morphology languages such as Basque and parameters when building our BERTeus models, thus should especially profit from such word representations. allowing a head-to-head comparison among them. In addi- FastText distributes embeddings for more than 150 lan- tion we also report results for FastText and Flair models. guages trained on Common Crawl and Wikipedia. In this 3. Building Basque models paper we build FastText embeddings using a carefully collected corpus in Basque and show that it performs better In order to train accurately word embeddings and language than the officially distributed embeddings in all NLP we modelswe need a corpusas large as possible, but also meet- tested, which stresses the importance of a following a ing certain criteria. Those criteria included clean and cor- carefully designed method when building and collecting rectly structured text (having paragraph and document lim- the corpus. its, specially relevant for training BERT language models).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us