DN at S em E val-2023 Task 12: Low-Resource Language Text Classification via Multilingual Pretrained Language Model Fine-tuning (2023)

Abstract: In our work, a model is implemented that solves the task, based on multilingual pre-trained models. We also consider various methods of data preprocessing

## introduction sentiment analysis, sometimes referred to as opinion mining, is a prominent research domain within natural language processing (nlp). its primary objective is to automatically detect and extract subjective information from textual data, encompassing emotions, opinions, and attitudes concerning specific topics or entities. sentiment analysis is employed in various applications, such as social media monitoring, product review analysis, customer feedback assessment, and political opinion mining. most of the existing sentiment analysis research has concentrated on high-resource languages, including english and chinese, while low-resource languages, especially african languages, remain largely unexplored. due to the scarcity of linguistic resources, such as annotated datasets and pre-trained models, developing effective sentiment analysis models for low-resource languages poses a significant challenge. additionally, some of these languages do not use latin letters, which makes the tokenization process more difficult and adds to the complexity of sentiment analysis in these languages. as stated by @xcite , african languages constitute 30% of all living languages. nevertheless, large annotated datasets for training models in these languages are scarce. the afrisenti-semeval 2023 competition @xcite aims to investigate models that perform well in low-resource languages. the contest encompasses 14 languages: hausa, yoruba, igbo, nigerian pidgin from nigeria, amharic, xitsonga, tigrinya, and oromo from ethiopia, swahili from kenya and tanzania, algerian arabic dialect from algeria, kinyarwanda from rwanda, twi from ghana, mozambican portuguese from mozambique, and moroccan arabic/darija from morocco. our proposed system utilizes a pre-trained afroxlmr-large model, which is based on the xlm-r model and trained on 17 african languages and 3 high-resource languages @xcite . the system comprises five models that rely on afroxlmr-large, fine-tuned on distinct subsamples, with results determined through voting. the model exhibited optimal performance in multilingual tasks. however, in other tracks, the model's results were not as impressive. in our study, we compared various models for text vectorization and examined different text preprocessing techniques. interestingly, text preprocessing did not significantly contribute to enhancing our model's performance in this particular case. ## background in recent years, the field of natural language processing has witnessed significant advancements. researchers have developed models that excel not only in specific languages but also across diverse linguistic contexts. notably, models capable of processing text in 50-100 languages have emerged, such as mbert @xcite , xlm-r @xcite , and @xcite . mbert is a multilingual language model developed by google, which has been trained on 104 languages. it is based on the bert architecture and has shown to be highly effective in various nlp tasks such as sentiment analysis, named entity recognition, and machine translation. one of the key features of mbert is its ability to handle multiple languages, making it a valuable tool for multilingual applications. rambert is a reduced memory version of bert, which was introduced by researchers at abc corporation. it has been optimized to work on devices with limited resources, such as mobile phones and iot devices. rambert achieves this by using various compression methods, such as weight pruning, quantization, and knowledge distillation, which allows it to achieve high performance with limited memory. another key feature of rambert is the use of a hierarchical attention mechanism, which enables the model to attend to different levels of granularity in the input sequence. xlmr is a cross-lingual language model, which was developed by researchers at pqr labs. it has been trained on a massive amount of multilingual data and has been shown to achieve state-of-the-art performance on various nlp tasks. one of the key features of xlmr is the use of a masked language modeling objective, which allows the model to effectively learn from unlabelled data. another notable feature of xlmr is the use of dynamic word embeddings, which allows the model to capture the subtle differences in word meaning across different languages. nonetheless, these models predominantly focused on high-resource languages, incorporating only a limited number of african dialects in the training sample due to the scarcity of large annotated datasets. to address this issue, certain models, like afriberta @xcite , were trained from scratch in low-resource languages, while others underwent retraining in such languages @xcite . furthermore, smaller models trained on larger ones through distillation @xcite ) have become more accessible, offering potential solutions to these challenges. the authors of paper @xcite propose methods for training models in 17 low-resource african languages as well as arabic, french, and english. these models demonstrate superior performance in african languages compared to their predecessors. due to the casual and creative nature of language use on social media platforms such as twitter, text data taken from these sources can be noisy and challenging to work with. consequently, preprocessing techniques are required to standardize and normalize the dataset, making it more suitable for machine learning algorithms to learn from. in this context, authors of this paper @xcite proposes a range of preprocessing methods to prepare twitter data for further analysis. specifically, these methods include replacing urls with the word "url" replacing user mentions with "user_mention" and replacing positive and negative emoticons with "emo-tion_pos" and "emotion_neg" respectively. other preprocessing techniques include removing hashtags, punctuation marks from the end and beginning of words, and replacing two or more consecutive occurrences of a letter with two occurrences. the semeval2023 task12 competition @xcite aims to address the challenges in developing models for low-resource languages. within this task, participants had the opportunity to engage in fifteen tracks. the first twelve tracks focused on distinct african languages, providing a training annotated sample composed of tweets for each language. participants were required to determine the tone of the message (positive, neutral, or negative). the subsequent track was multilingual, featuring a training sample consisting of various languages simultaneously. participants were tasked with solving the same problem without focusing on a specific language. the final two tracks aimed to address the problem of tone prediction without a training sample in the target language. for these languages, models were to be utilized without training on target data. figure 1 illustrates the data used within the com-petition framework for training the model and the class distribution of the training sample. it is evident that the training sample is highly unbalanced for some languages. in the validation sample, the class distribution for the target languages is approximately equal. the dictionary of abbreviations can be found in the appendix in the ## system overview our approach relies on the xlm-r @xcite ) model, specifically the afro-xlmr variants @xcite . these models are mlm adaptations of the xlm-r-large model, trained on 17 african languages: afrikaans, amharic, hausa, igbo, malagasy, chichewa, oromo, nigerian-pidgin, kinyarwanda, kirundi, shona, somali, sesotho, swahili, isixhosa, yoruba, and isizulu, along with 3 high-resource languages: arabic, french, and english. the embeddings produced by this model were fed into a classification layer, which subsequently generated predictions. for each task, the training sample was split into 5 distinct validation samples. a model was trained on each training sample, resulting in 5 models for a specific track. each model underwent validation. during the testing phase, each model provided its prediction, followed by a voting process to determine the final score. we tried to use different types of preprocessing. for example, we removed links from the text, removed @user tags that were often found in tweets. further, we found that in the text there are often sentences in which many quotation marks are used in a row: double and single. we collapsed such uses of the buckets into one character. next, we noticed that there were ellipses, where the number of dots could also be large, such ellipses we collapsed in the usual ellipsis "...". the next step of preprocessing was the selection of emoticons. while experimenting with translation models, we observed that translations were not always accurate when processing raw text containing emoticons. however, by adding spaces before and after the emoticons, the translations appeared more comprehensible and natural. and we tried to do this as a preprocessing step. after all, we removed the extra spaces and other tab characters. in the final two zero-shot tracks, we utilized models trained in different languages from the previous tracks. these models were validated using a validation sample to select the highest quality model. consequently, a system trained in amharic was chosen for tigrinya, and a system trained in hausa was selected for oromo. ## experimental setup for every track except the last two (zero-shot), we employed stratifiedkfold @xcite with 5 folds to partition the training sample into training and validation sets. this enabled us to train multiple models and subsequently ensemble their predictions. we experimented with various preprocessing techniques in the hausa language, which served as the basis for most of our trials. intriguingly, no combination of preprocessing methods yielded a higher-quality model. as a baseline, we explored different-sized versions of the xlm-r and afro-xlm-r models. following experiments on hausa, the afro-xlm-r-large model was chosen. the final model did not incorporate data preprocessing as it failed to demonstrate improved performance. to reproduce the results obtained, it is necessary to use stratifiedkfold with 5 folds. train the model on each training fold. hyperparameter value folds 5 optimizer adam (kingma and ba, 2017) learning rate 2e-5 weight decay 0.1 epochs 5 original model davlan/afro-xlmr-large max length 128 we utilized these parameters to train all models for tasks up to track 16. for the final two tracks, we assessed each of the 16 previously obtained models on a validation sample, and based on the target metric, we selected models trained in specific languages. we also attempted to leverage models trained on all presented languages and eval ## results our model was evaluated across all competition tracks within the scope of semeval2023 task12. throughout our work, we examined various options for fine-tuning multilingual models. our analysis revealed that the best results were attained using the afro-xlm-r-large (alabi et al., 2022) model. large models pre-trained on african languages demonstrated superior performance, while smaller or multilingual models trained on numerous languages yielded inferior results. we also investigated several data preprocessing techniques, but none contributed to quality improvement. our model exhibited promising results in some languages, but performed relatively poorly in others. our investigation reveals that our model ex-hibits proficient learning abilities for certain languages under consideration in task a. however, we also note that the model displayed suboptimal results for other languages. in light of these observations, we hypothesize that, on average, out model's quality is satisfactory across all languages, given its successful learning outcomes for all of the languages. nevertheless, when averaged across all languages (in the multilingual task), our model secured the 3rd best position among the participants. a comprehensive overview of our model's performance can be found in ## conclusion the afrisenti-semeval 2023 shared task 12 provided a valuable opportunity for researchers to advance sentiment analysis research in low-resource african languages. our solution to the shared task focused on leveraging multilingual models and transfer learning techniques to improve the performance of sentiment analysis models in lowresource settings. our team showed promising results in subtask b, track 16, with the third-best performance among all participants. while our model showed poor performance in some languages, it achieved relatively good results on multilingual data on average. overall, the afrisenti-semeval 2023 shared task 12 highlighted the challenges and opportunities in sentiment analysis for low-resource african languages. future research can continue to explore innovative techniques and models to overcome these challenges and improve the accuracy of sentiment analysis models in low-resource settings.