Logo Lanfrica
  • Home
  • Atlas
  • Insights
  • Docs
  • Sign in

© 2026 Lanfrica. All rights reserved. All copyrights of the resources shown on the Lanfrica website belong to the original copyright holders, unless explicitly stated otherwise.

A Machine Learning Approach to Irony Detection in Text Using TF-IDF and Random Forests

Domain:

natural language processing

Record type:

dataset
Creator:
A. M. J. O.C
Publisher:
IJA
Host:avatar
This paper presents the development of a machine learning model to detect irony in Pidgin English text which is achallenging task due to the unique linguistic features of the language. Social media has transformed global communicationvia text, but detecting irony, where the intended meaning differs from the literal one, remains difficult, especially in nonstandard languages like Pidgin English. Current irony detection models, designed primarily for standard English, struggle inthis context. To address this, we collected a dataset of 58,745 online comments, encompassing ironic statements or comments,hate and neutral comments, from crowdsourced surveys and Kaggle datasets. The final dataset of 6,000 instances, evenlydistributed among the three speech categories, was used for training, validation, and testing. After cleaning and balancing thedata through random undersampling, the Term Frequency-Inverse Document Frequency (TF-IDF) was applied to convert thetext into numerical vectors, while the Random Forest Classifier was used for the text classification. Results revealed that theproposed model achieved an impressive accuracy of 93%, with a precision of 90% and a recall of 91%, proving itseffectiveness in detecting ironic speech. The results demonstrate that machine learning can accurately identify irony even innon-standard languages like Nigerian Pidgin English, which could reduce misinterpretations in social media interactions andpotentially lower the incidence of conflicts caused by irony. This research contributes to the field of natural languageprocessing by emphasizing the importance of language-specific tools for irony detection.

Visit

doi.orgzenodo.org

Tasks

text classification

Languages

Ghanaian Pidgin EnglishPidgin, Nigerian

Licenses

Creative Commons Attribution 4.0 Internationalhttps://creativecommons.org/licenses/by/4.0/legalcode