From Local to Global: Navigating Linguistic Diversity in the African Context
Paper · 2023 · Rashmi Margani and Nelson Ndugu
Summary
The paper looks at sentiment analysis for African local dialects, which have little NLP support. Its case study is TUNIZI, Tunisian Arabic written in Latin letters and digits, as it appears in social media comments. Pre-trained embeddings and standard tools often fit such code-switched, low-resource text poorly. The authors start from a TUNIZI corpus gathered through the iCompass platform and add freshly scraped posts. They clean the text by removing links, emoji and punctuation, then apply tokenization, stop-word removal and stemming. Each comment gets one of three labels: negative, neutral or positive. Text vectors come from FastText, and other embedding methods are also compared. A LightGBM classifier makes the predictions. Because positive comments outnumber the other classes, they test several class-balancing strategies. With grid search and cross-validation, the baseline configuration reaches an F1 of about 0.81. The authors present this as a cheap, practical way for banks, insurers and other businesses to track customer opinion in dialects that mainstream NLP neglects.
Key points
- Data: TUNIZI social-media comments collected via iCompass, plus newly web-scraped posts. The label distribution is skewed: positive is the largest class, then negative, then neutral.
- Pipeline: embedding function feeding a classifier (FastText → LightGBM). Prediction takes the class with the highest probability rather than a tuned threshold.
- Imbalance remedies discussed: random under- and oversampling, SMOTE, ADASYN and cost-sensitive learning.
- Setup: 70/30 train/test split and grid search with 5-fold CV. The search covered 50 parameter combinations, or 250 fits. The best F1 for the nominal model was 0.8065.
- It ran on modest hardware: Core i7, 16 GB RAM, GTX 1050Ti. The listed difficulties are annotation quality, ambiguity such as "hlib" meaning bread or slang for money, and deployment.
Interesting ideas
- I1. When it is unclear which representation suits an unfamiliar language variety, the authors compare several embedding methods and keep the best, rather than assuming one up front. This is a cheap way to avoid a bad default.
- I2. Check the label distribution before training, try several rebalancing methods, and score with F1 so that minority classes count.
- I3. The paper uses a minimal pair with the same evaluative words but swapped targets ("sandwich good, service bad" vs the reverse). It shows that the overall label depends on which word attaches to which thing.
- I4. A single word can shift meaning with register, as with "hlib" (food vs money), so its sense has to come from context.
- I5. Annotation reliability is handled with multiple annotators and quality-control checks rather than trusting one labeler.
For Mova
How these ideas could serve Mova, our small open language model — its files, stages and tests:
- I1 (learn): when a tagger or parser feature set is chosen for a new English register, run a small benchmark of candidate variants and record why the winner was kept.
- I2 (learn): silver treebanks are probably dominated by frequent deprels and frame roles, so per-label counts and per-class scores should be reported to expose weak rare relations.
- I3 (world): build contrastive test pairs where an evaluation must attach to the correct entity in the text world, which tests structure rather than word presence.
- I4 (world): ontology lookups from WordNet/Wikidata should keep informal or slang senses as candidates and choose among them using the surrounding frame.
- I5 (learn): this mirrors agreement among witness parsers, and disagreement can be logged as a quality signal that routes items to the LLM teacher tier.
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 9,085 worksArtificial Intelligence · 8,888 worksArts and Humanities · 9,296 worksLanguage and Linguistics · 9,206 works
🧭 Topics 1Research subjects and languages the work is about.Semitic languages · 1,485 works
Cite
Cite as Rashmi Margani and Nelson Ndugu. 2023. From Local to Global: Navigating Linguistic Diversity in the African Context. arXiv:2305.01427.
@misc{margani2023local,
title = {{From Local to Global: Navigating Linguistic Diversity in the African Context}},
author = {Rashmi Margani and Nelson Ndugu},
year = {2023},
doi = {10.48550/arxiv.2305.01427},
eprint = {2305.01427},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2305.01427}
}References
- A. Abbasi, A. Hassan, and M. Dhar. Benchmarking Twitter sentiment analysis tools. In Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC’14), pages 823–829, Reykjavik, Iceland, May 2014. European Language Resources Association (ELRA). find
- I. Adebara and M. Abdul-Mageed. Towards afrocentric nlp for african languages: Where we are and where we can go, 2022. find
- I. Adebara and M. Abdul-Mageed. Towards afrocentric NLP for African languages: Where we are and where we can go. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 3814–3841, Dublin, Ireland, May 2022. Association for Computational Linguistics. find
- L. Ao, R. Bansal, N. Pruthi, and M. B. Khaskheli. Impact of social media influencers on customer engagement and purchase intention: A meta-analysis. Sustainability, 15(3), 2023. ↗
- G. Barbier and H. Liu. Data Mining in Social Media, pages 327–352. Springer US, Boston, MA, 2011. find
- G. E. A. P. A. Batista, R. C. Prati, and M. C. Monard. A study of the behavior of several methods for balancing machine learning training data. SIGKDD Explor. Newsl., 6(1):20–29, jun 2004. ↗
- R. M. Beck. Urban languages in africa. Africa Spectrum, 45(3):11–41, 2010. ↗
- A. Bilgihan, J. Kandampully, and T. C. Zhang. Towards a unified customer experience in online shopping environments: Antecedents and outcomes. International Journal of Quality and Service Sciences, 8(1):102–119, 2016. ↗
- J. Blommaert. 4. Linguistic diversity: Africa, pages 123– 150. 2007. find
- J. Blommaert. Linguistics diversity: Africa, pages 123–149. 10 2007. find
- P. Bojanowski, E. Grave, A. Joulin, and T. Mikolov. Enriching word vectors with subword information. Transactions of the Association for Computational Linguistics, 5:135–146, 2017. ↗
- S. Boughorbel, F. Jarray, and M. El-Anbari. Optimal classifier for imbalanced data using matthews correlation coefficient metric. PloS one, 12(6):e0177678, 2017. ↗
- C. Broyden, R. Fletcher, and D. Goldfarb. Nonlinear programming. Proceedings of the Institution of Electrical Engineers, 117(12):2157–2163, 1970. find
- C. P. Chai. Comparison of text preprocessing methods. Natural Language Engineering, page 1–45, 2022. ↗
- N. V. Chawla, K. W. Bowyer, L. O. Hall, and W. P. Kegelmeyer Jr. Smote: Synthetic minority over-sampling technique. Journal of Artificial Intelligence Research, 16:321–357, 2002.
- C. Drummond and R. Holte. C4.5, class imbalance, and cost sensitivity: Why under-sampling beats over-sampling. In Workshop on Learning from Imbalanced Datasets II, pages 1–8, 2003. find
- G. Duffett, Rodney. Influence of social media marketing communications on young consumers’ attitudes. Young Consumers, 18(3):19–39, 2017. ↗
- C. Fourati, A. Messaoudi, and H. Haddad. Tunizi: a tunisian arabizi sentiment analysis dataset. ArXiv, abs/2004.14303, 2020. ↗
- C. Fourati, A. Messaoudi, and H. Haddad. Tunizi: a tunisian arabizi sentiment analysis dataset. In AfricaNLP Workshop, Putting Africa on the NLP Map. ICLR 2020, Virtual Event, volume arXiv:3091079, 2020. ↗
- E. Grave, P. Bojanowski, P. Gupta, A. Joulin, and T. Mikolov. Learning word vectors for 157 languages. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation (LREC 2018), Miyazaki, Japan, May 2018. European Language Resources Association (ELRA).
- H. He, Y. Bai, E. A. Garcia, and S. Li. Adasyn: Adaptive synthetic sampling approach for imbalanced learning. In 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), pages 1322–1328, 2008. find
- H. He and E. A. Garcia. Learning from imbalanced data. IEEE Transactions on Knowledge and Data Engineering, 21(9):1263–1284, 2009. ↗
- A. Joulin, E. Grave, P. Bojanowski, and T. Mikolov. Bag of tricks for efficient text classification. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pages 427–431, Valencia, Spain, Apr. 2017. Association for Computational Linguistics. find
- G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T.-Y. Liu. Lightgbm: A highly efficient gradient boosting decision tree. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. find
- C. S. Lee and L. Ma. News sharing in social media: The effect of gratifications and prior experience. Computers in Human Behavior, 28(2):331–339, 2012. ↗
- S. W. Litvin, R. E. Goldsmith, and B. Pan. Electronic word-of-mouth in hospitality and tourism management. Tourism Management, 29(3):458–468, 2008. ↗
- M. C. Mafunda, M. Schuld, K. Durrheim, and S. Mazibuko. A word embedding trained on south african news data. The African Journal of Information and Communication (AJIC), (30), Dec. 2022. ↗
- T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space, 2013. ↗
- M. M. . S. E. G. Muntinga, D. G. Introducing cobras: Exploring motivations for brand-related social media use. International Journal of Advertising, 30(1):13–46, 2011. find
- W. Nekoto, V. Marivate, T. Matsila, T. Fasubaa, T. Kolawole, T. Fagbohungbe, S. O. Akinola, S. H. Muhammad, S. Kabongo, S. Osei, S. Freshia, R. A. Niyongabo, R. Macharm, P. Ogayo, O. Ahia, M. Meressa, M. Adeyemi, M. Mokgesi-Selinga, L. Okegbemi, L. J. Martinus, K. Tajudeen, K. Degila, K. Ogueji, K. Siminyu, J. Kreutzer, J. Webster, J. T. Ali, J. Abbott, I. Orife, I. Ezeani, I. A. Dangana, H. Kamper, H. Elsahar, G. Duru, G. Kioko, E. Murhabazi, E. van Biljon, D. Whitenack, C. Onyefuluchi, C. Emezue, B. Dossou, B. Sibanda, B. I. Bassey, A. Olabiyi, A. Ramkilowan, A. Öktem, A. Akinfaderin, and A. Bashir. Participatory research for low-resourced machine translation: A case study in african languages, 2020.
- D. Nurse, T. J. Hinnebusch, and G. Philippson. Swahili and sabaki: A linguistic history. 1993. find
- K. Ogueji, Y. Zhu, and J. Lin. Small data? no problem! exploring the viability of pretrained multilingual language models for low-resourced languages. In Proceedings of the 1st Workshop on Multilingual Representation Learning, pages 116–126, Punta Cana, Dominican Republic, Nov. 2021. Association for Computational Linguistics.
- V. O. A. Okolo, K. P. Ikpo, and C. O. Obikeze. Influence of customer feedback on customer retention in deposit money banks in south-eastern nigeria. British Journal of Management and Marketing Studies, 4(1):1–16, 2021. find
- T. Olagunju, O. Oyebode, and R. Orji. Exploring key issues affecting african mobile ecommerce applications using sentiment and thematic analysis. IEEE Access, 8:114475– 114486, 2020. ↗
- J. Palmer, K. Revis, and Y. Romain. How social media analytics can save businesses. SSRN Electronic Journal, October 2020. ↗
- J. Pennington, R. Socher, and C. Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar, Oct. 2014. Association for Computational Linguistics.
- Y. Sasaki. The truth of the f-measure. Journal of Machine Learning Research, 8:1001–1015, 2007. find
- B. Sutrisno and Y. Ariesta. Beyond the use of code mixing by social media influencers in instagram. Advances in Language and Literary Studies, 2019. ↗
- Y. Wang, X. Zhao, and J. Wu. How customer reviews affect purchasing decisions in online insurance markets. Journal of Business Research, 115:1–11, 2020. find
- A. Wong, S. Ho, O. Olusanya, M. V. Antonini, and D. Lyness. The use of social media and online communications in times of pandemic covid-19. Journal of the Intensive Care Society, 22(3):255–260, 2021. PMID: 34422109. ↗
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/margani-2023-local-global-navigating-linguistic-diversity/