IDEAS home Printed from https://ideas.repec.org/a/gam/jmathe/v12y2024i13p2123-d1430103.html

OLF-ML: An Offensive Language Framework for Detection, Categorization, and Offense Target Identification Using Text Processing and Machine Learning Algorithms

Author

Listed:
  • MD. Nahid Hasan

    (Department of Computer Science and Engineering, School of Data and Sciences, Brac University, Dhaka 1212, Bangladesh)

  • Kazi Shadman Sakib

    (Department of Computer Science and Engineering, University of Dhaka, Dhaka 1000, Bangladesh)

  • Taghrid Tahani Preeti

    (Department of Computer Science and Engineering, School of Data and Sciences, Brac University, Dhaka 1212, Bangladesh)

  • Jeza Allohibi

    (Department of Mathematics, Taibah University, Madinah 42353, Saudi Arabia)

  • Abdulmajeed Atiah Alharbi

    (Department of Mathematics, Taibah University, Madinah 42353, Saudi Arabia)

  • Jia Uddin

    (Artificial Intelligence and Big Data Department, Endicott College, Woosong University, Daejeon 34606, Republic of Korea)

Abstract

The pervasiveness of offensive language on social media emphasizes the necessity of automated systems for identifying and categorizing content. To ensure a more secure online environment and improve communication, effective identification and categorization of this content is essential. However, existing research encounters challenges such as limited datasets and biased model performance, hindering progress in this domain. To address these challenges, this research presents a comprehensive framework that simplifies the utilization of support vector machines (SVM), random forest (RF) and artificial neural networks (ANN). The proposed methodology yields notable gains in offensive language detection, automatic categorization of offensiveness, and offense target identification tasks by utilizing the Offensive Language Identification Dataset (OLID). The simulation results indicate that SVM performs exceptionally well, exhibiting excellent accuracy scores (77%, 88%, and 68%), precision scores (76%, 87%, and 67%), F1 scores (57%, 88%, and 68%), and recall rates (45%, 88%, and 68%), proving to be practically successful in identifying and moderating offensive content on social media. By applying sophisticated preprocessing and meticulous hyperparameter tuning, our model outperforms some earlier research in detecting and categorizing offensive language tasks.

Suggested Citation

  • MD. Nahid Hasan & Kazi Shadman Sakib & Taghrid Tahani Preeti & Jeza Allohibi & Abdulmajeed Atiah Alharbi & Jia Uddin, 2024. "OLF-ML: An Offensive Language Framework for Detection, Categorization, and Offense Target Identification Using Text Processing and Machine Learning Algorithms," Mathematics, MDPI, vol. 12(13), pages 1-18, July.
  • Handle: RePEc:gam:jmathe:v:12:y:2024:i:13:p:2123-:d:1430103
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2227-7390/12/13/2123/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2227-7390/12/13/2123/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Matthias Schonlau & Rosie Yuyan Zou, 2020. "The random forest algorithm for statistical learning," Stata Journal, StataCorp LLC, vol. 20(1), pages 3-29, March.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Becker, Sascha O. & Voth, Hans-Joachim, 2023. "From the Death of God to the Rise of Hitler," CAGE Online Working Paper Series 688, Competitive Advantage in the Global Economy (CAGE).
    2. Chen Xiang & Nur Aulia Bt Rosni & Norafida Ab Ghafar, 2025. "A Landscape Narrative Model for Visitor Satisfaction Prediction in the Living Preservation of Urban Historic Parks: A Machine-Learning Approach," Sustainability, MDPI, vol. 17(12), pages 1-33, June.
    3. Sylvanus Gaku & Jennifer Ifft & Brady Brewer & Luke Byers, 2026. "The Financial Status and Local Credit Market Conditions of U.S. Farms Engaged in Multiple Borrowing," Applied Economic Perspectives and Policy, John Wiley & Sons, vol. 48(1), pages 266-277, March.
    4. Mehmet Ali Köseoglu, 2025. "Integrating Sustainable Development Goals With Entrepreneurial Ecosystems: A Comprehensive Analysis Across Income Levels," Sustainable Development, John Wiley & Sons, Ltd., vol. 33(6), pages 8949-8968, December.
    5. Wang, Feipeng & Wong, Wing-Keung & Wang, Zheng & Albasher, Gadah & Alsultan, Nouf & Fatemah, Ambreen, 2023. "Emerging pathways to sustainable economic development: An interdisciplinary exploration of resource efficiency, technological innovation, and ecosystem resilience in resource-rich regions," Resources Policy, Elsevier, vol. 85(PA).
    6. Benjamin Miranda Tabak & Débora H. Cardoso & Cristiano C. Silva, 2025. "Assessing the Drivers of Financial Vulnerability and Fraud in Brazil: The Critical Role of Financial Planning over Literacy," Sustainability, MDPI, vol. 17(20), pages 1-33, October.
    7. Xiaxuan He & Qifeng Yuan & Yinghong Qin & Junwen Lu & Gang Li, 2024. "Analysis of Surface Urban Heat Island in the Guangzhou-Foshan Metropolitan Area Based on Local Climate Zones," Land, MDPI, vol. 13(10), pages 1-34, October.
    8. Ahmet Faruk Aysan & Bekir Sait Ciftler & Ibrahim Musa Unal, 2024. "Predictive Power of Random Forests in Analyzing Risk Management in Islamic Banking," JRFM, MDPI, vol. 17(3), pages 1-19, March.
    9. Sakiru Adebola Solarin & Muhammed Sehid Gorus & Onder Ozgur, 2024. "Modelling the economic effect of inbound birth tourism: a random forest algorithm approach," Quality & Quantity: International Journal of Methodology, Springer, vol. 58(5), pages 4223-4240, October.
    10. Zhu, Xinyi & Shen, Xiaoyan & Chen, Kailiang & Zhang, Zeqing, 2024. "Research on the prediction and influencing factors of heavy duty truck fuel consumption based on LightGBM," Energy, Elsevier, vol. 296(C).
    11. Radu Andreea-Oana & Ionescu Sergiu-Alexandru, 2025. "Comparison of Supervised Learning Algorithms for Fake News Detection," Proceedings of the International Conference on Business Excellence, Paradigm, vol. 19(1), pages 2139-2148.
    12. Murat Aslan & Onder Ozgur, 2024. "Financial dollarization and its effects on inflation and output in Turkey: a machine learning approach," Quality & Quantity: International Journal of Methodology, Springer, vol. 58(6), pages 5777-5804, December.
    13. Maria A. F. Silva Dias & Yania Molina Souto & Bruno Biazeto & Enzo Todesco & Jose A. Zuñiga Mora & Dylana Vargas Navarro & Melvin Pérez Chinchilla & Carlos Madrigal Araya & Dayanna Arce Fernández & Be, 2024. "Reduction of Wind Speed Forecast Error in Costa Rica Tejona Wind Farm with Artificial Intelligence," Energies, MDPI, vol. 17(22), pages 1-12, November.
    14. Özer Depren & Mustafa Tevfik Kartal & Serpil Kılıç Depren, 2021. "Recent innovation in benchmark rates (BMR): evidence from influential factors on Turkish Lira Overnight Reference Interest Rate with machine learning algorithms," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 7(1), pages 1-20, December.
    15. Tomasz Rymarczyk & Konrad Niderla & Edward Kozłowski & Krzysztof Król & Joanna Maria Wyrwisz & Sylwia Skrzypek-Ahmed & Piotr Gołąbek, 2021. "Logistic Regression with Wave Preprocessing to Solve Inverse Problem in Industrial Tomography for Technological Process Control," Energies, MDPI, vol. 14(23), pages 1-21, December.
    16. Arslan, Ömer & Fiskin, Remzi, 2026. "Understanding the impact of ballast water management deficiencies on ship detentions: A hybrid predictive approach," Reliability Engineering and System Safety, Elsevier, vol. 267(PA).
    17. Jialing Zhang & Zhanxu Chen & An Wang & Zhenzhang Li & Wei Wan, 2023. "Intelligent Personalized Lighting Control System for Residents," Sustainability, MDPI, vol. 15(21), pages 1-12, October.
    18. Mahmut Bağcı & Pınar Kaya Soylu, 2026. "The Optimal Threshold Selection for High-Frequency Pairs Trading via Supervised Machine Learning Algorithms," Computational Economics, Springer;Society for Computational Economics, vol. 67(4), pages 2399-2427, April.
    19. Lamperti, Fabio, 2024. "Unlocking machine learning for social sciences: The case for identifying Industry 4.0 adoption across business restructuring events," Technological Forecasting and Social Change, Elsevier, vol. 207(C).
    20. Yu, Min & Niu, Dongxiao & Gao, Tian & Wang, Keke & Sun, Lijie & Li, Mingyu & Xu, Xiaomin, 2023. "A novel framework for ultra-short-term interval wind power prediction based on RF-WOA-VMD and BiGRU optimized by the attention mechanism," Energy, Elsevier, vol. 269(C).

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jmathe:v:12:y:2024:i:13:p:2123-:d:1430103. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager The email address of this maintainer does not seem to be valid anymore. Please ask MDPI Indexing Manager to update the entry or send us the correct address (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.