[Paper Review] Sentiment Classification in Swahili Language Using Multilingual BERT
This study proposes sentiment classification in Swahili using multilingual BERT (mBERT) on a newly created 8.2k Swahili dataset from social media and ISEAR. Fine-tuned mBERT achieved 87.59% accuracy, demonstrating mBERT's effectiveness for low-resource African languages despite data imbalance and noise.
The evolution of the Internet has increased the amount of information that is expressed by people on different platforms. This information can be product reviews, discussions on forums, or social media platforms. Accessibility of these opinions and peoples feelings open the door to opinion mining and sentiment analysis. As language and speech technologies become more advanced, many languages have been used and the best models have been obtained. However, due to linguistic diversity and lack of datasets, African languages have been left behind. In this study, by using the current state-of-the-art model, multilingual BERT, we perform sentiment classification on Swahili datasets. The data was created by extracting and annotating 8.2k reviews and comments on different social media platforms and the ISEAR emotion dataset. The data were classified as either positive or negative. The model was fine-tuned and achieve the best accuracy of 87.59%.
Motivation & Objective
- To address the lack of sentiment analysis resources for low-resource African languages, particularly Swahili.
- To create a new, manually annotated Swahili sentiment dataset from diverse online platforms including JamiiForum, DW Kiswahili, and social media.
- To evaluate the performance of multilingual BERT (mBERT) on binary sentiment classification in Swahili.
- To investigate the impact of data imbalance and noise on model performance in low-resource NLP settings.
Proposed method
- Constructed a 8.2k Swahili sentiment dataset by extracting and manually annotating reviews and comments from JamiiForum, DW Kiswahili, Twitter, YouTube, and the ISEAR dataset.
- Mapped ISEAR’s seven emotions into binary sentiment labels: joy as positive, others as negative.
- Pre-processed data by removing usernames, URLs, and special characters to reduce noise.
- Fine-tuned the multilingual BERT (mBERT) model using HuggingFace’s PyTorch library with a batch size of 16 and sequence length of 64.
- Used Adam optimizer with a 5e-5 initial learning rate and epsilon of 1e-8, maintaining other hyperparameters from the original BERT paper.
- Split the dataset into 90% training and 10% testing, and evaluated performance using accuracy, precision, recall, and F1-score.
Experimental results
Research questions
- RQ1Can multilingual BERT achieve high performance in sentiment classification for Swahili, a low-resource African language?
- RQ2How does data imbalance affect the performance of mBERT in classifying positive and negative sentiments in Swahili?
- RQ3To what extent do noise and informal language in social media data impact mBERT’s sentiment classification accuracy?
- RQ4How does mBERT compare to other models in handling out-of-vocabulary words and loanwords in Swahili?
- RQ5Can a fine-tuned mBERT model generalize across diverse Swahili social media content from different platforms?
Key findings
- The mBERT model achieved a final accuracy of 87.59% on the Swahili sentiment classification task.
- Negative sentiment classification showed higher precision (88%), recall (94%), and F1-score (91%) compared to positive sentiment.
- Positive sentiment had lower recall (76%) and F1-score (81%), indicating the model struggled more with correctly identifying positive examples.
- The confusion matrix revealed that 68 positive instances were misclassified as negative, reflecting the impact of data imbalance.
- The model demonstrated robustness to out-of-vocabulary words and loanwords due to mBERT’s contextual attention mechanism.
- Despite noise and informal language in social media data, the model maintained strong performance, suggesting mBERT’s suitability for low-resource, noisy text.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.