Elamur Research⌕
☰
home / papers / 2024 / English offensive text detection using CNN based Bi-GRU model

English offensive text detection using CNN based Bi-GRU model

Paper · 2024 · Tonmoy Roy, Md Robiul Islam, Asif Ahammad Miazee et al.

Summary

The paper addresses automatic detection of offensive English text on social media, motivated by the scale of abusive posts that cannot be moderated by hand. The authors use a Twitter collection of 31,962 tweets, split 80:20 into training and test sets. Cleaning removes numbers, punctuation, URLs, emojis, hashtags and mentions, then applies NLTK tokenization and stop-word removal. The proposed network stacks nine layers: an embedding, a 1D convolution with max pooling, two bidirectional GRU layers, and dense layers with dropout. It is built in Keras/TensorFlow and trained for 100 epochs on a Colab GPU. Classic classifiers using count-vector and TF-IDF features serve as baselines. The headline claim is 96.97% accuracy, compared against earlier multilingual hate-speech studies reported at 76.90%. The evaluation is thin, though. The baseline table is garbled, the dataset class counts are missing, and the cross-paper comparison mixes different datasets. The work matters mainly as a compact, reproducible CNN+Bi-GRU recipe for binary toxicity filtering.

Key points

  • Data: 31,962 English tweets labelled offensive vs. not offensive, with an 80/20 train/test split.
  • Architecture order: Input → Embedding → Conv1D → MaxPooling → Bi-GRU → Bi-GRU → Dense → Dropout → Dense, ending in a probability for the offensive class.
  • Baselines are Logistic Regression, Random Forest, MultinomialNB, KNeighbors and Linear SVC, plus Naive Bayes, SVM and AdaBoost, over count vectors and TF-IDF.
  • The baseline table shows Logistic Regression at 96.86% accuracy but only 51.27% recall, so accuracy hides weak minority-class detection.
  • The proposed model reports 96.97% accuracy. Training and validation accuracy, loss, recall and AUC curves are tracked over 100 epochs.

Interesting ideas

  • I1. Putting a convolution with pooling before the recurrent layers lets cheap local n-gram detectors compress the sequence before a bidirectional pass adds left and right context, which is a sensible split between local and global evidence.
  • I2. The paper's own numbers show a classifier with very high accuracy whose recall is near 50%, a reminder to always report per-class recall and precision on skewed labels.
  • I3. Logging validation recall and AUC every epoch, not just loss, makes it visible when a model gets better overall while still missing the target class.
  • I4. Stripping URLs, mentions, hashtags and emojis is a fixed normalisation step that removes platform noise before modelling.
  • I5. Offensive-vs-hate is treated as a distinct, often confused distinction (slurs vs. incitement toward a group).

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (tree): gparse could use a light Conv1D front end over subword embeddings to capture local morphology cues before its contextual encoder, possibly cutting cost on long sentences.
  • I2 (learn): evaluation of rare phenomena (irony, insults, rare UD relations) should report per-class recall next to overall scores, so a "mostly correct" model that misses the rare class is caught.
  • I3 (learn): training dashboards for parsers and frame labellers could track per-epoch recall on the rarest labels as a stopping or rollback signal.
  • I4 (tokens): crate en could tag such social-media tokens as explicit typed placeholders (rather than deleting them), keeping trees clean while preserving them for the world model.
  • I5 (frames): prag could model this as separate speech-act frames: an insult act that needs only a degrading term, and incitement that needs a target group plus an encouraged hostile action, each explainable from the tree.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

Also on the byline: Northern University Bangladesh · Uttara University.

 Fields, topics and concepts

📚 Shelves 2The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 works

🧭 Topics 1Research subjects and languages the work is about.English · 2,263 works

Cite

Cite as Tonmoy Roy, Md Robiul Islam, Asif Ahammad Miazee, Anika Antara, Al Amin and Sunjim Hossain. 2024. English offensive text detection using CNN based Bi-GRU model. arXiv:2409.15652.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2409.15652 · arXiv 2409.15652

@misc{roy2024english,
  title = {{English offensive text detection using CNN based Bi-GRU model}},
  author = {Tonmoy Roy, Md Robiul Islam, Asif Ahammad Miazee, Anika Antara, Al Amin and Sunjim Hossain},
  year = {2024},
  doi = {10.48550/arxiv.2409.15652},
  eprint = {2409.15652},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2409.15652}
}

References

24 references, 0 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. C. Nobata, J. Tetreault, A. Thomas, Y. Mehdad, and Y. Chang, “Abusive language detection in online user content,” in Proceedings of the 25th international conference on world wide web, pp. 145–153, 2016. *Figure 5: Training and Validation Recall* *Figure 6: Training and Validation AUC* find
  2. P. Fortuna and S. Nunes, “A survey on automatic detection of hate speech in text,” ACM Computing Surveys (CSUR), vol. 51, no. 4, pp. 1–30, 2018. ↗
  3. S. Hinduja and J. W. Patchin, “Bullying, cyberbullying, and suicide,” Archives of suicide research, vol. 14, no. 3, pp. 206–221, 2010. ↗
  4. “United nations.” [Online]. Available: https://www.un.org/en/genocideprevention/documents/ [Accessed: 14/05/2024]. ↗
  5. A. Gaydhani, V. Doma, S. Kendre, and L. Bhagwat, “Detecting hate speech and offensive language on twitter using machine learning: An ngram and tfidf based approach,” arXiv preprint arXiv:1809.08651, 2018. ↗
  6. B. Hu, B. Liu, N. Z. Gong, D. Kong, and H. Jin, “Protecting your children from inappropriate content in mobile apps: An automatic maturity rating framework,” in Proceedings of the 24th ACM International on Conference on Information and Knowledge Management, pp. 1111– 1120, 2015. find
  7. “Time spend on smartphones.” [Online]. Available: https:https://explodingtopics.com/blog/smartphone-usage-stats [Accessed: 15/05/2024]. ↗
  8. M. O. Ibrohim and I. Budi, “Hate speech and abusive language detection in indonesian social media: Progress and challenges,” Heliyon, 2023. ↗
  9. E. M. Alshari, A. Azman, S. Doraisamy, N. Mustapha, and M. Alkeshr, “Effective method for sentiment lexical dictionary enrichment based on word2vec for sentiment analysis,” in 2018 fourth international conference on information retrieval and knowledge management (CAMP), pp. 1–5, IEEE, 2018. find
  10. Y. Pandey, M. Sharma, M. K. Siddiqui, and S. S. Yadav, “Hate speech detection model using bag of words and naı̈ve bayes,” in Advances in Data and Information Sciences: Proceedings of ICDIS 2021, pp. 457– 470, Springer, 2022. find
  11. K. Kumari, J. P. Singh, Y. K. Dwivedi, and N. P. Rana, “Multi-modal aggression identification using convolutional neural network and binary particle swarm optimization,” Future Generation Computer Systems, vol. 118, pp. 187–197, 2021. ↗
  12. G. Kovács, P. Alonso, and R. Saini, “Challenges of hate speech detection in social media: Data scarcity, and leveraging external resources,” SN Computer Science, vol. 2, no. 2, p. 95, 2021. ↗
  13. O. Oriola and E. Kotzé, “Evaluating machine learning techniques for detecting offensive and hate speech in south african tweets,” IEEE Access, vol. 8, pp. 21496–21509, 2020. ↗
  14. N. Vashistha and A. Zubiaga, “Online multilingual hate speech detection: experimenting with hindi and english social media,” Information, vol. 12, no. 1, p. 5, 2020. ↗
  15. A. Jiang and A. Zubiaga, “Cross-lingual capsule network for hate speech detection in social media,” in Proceedings of the 32nd ACM conference on hypertext and social media, pp. 217–223, 2021. find
  16. N. Deshpande, N. Farris, and V. Kumar, “Highly generalizable models for multilingual hate speech detection,” arXiv preprint arXiv:2201.11294, 2022. ↗
  17. M. Corazza, S. Menini, E. Cabrio, S. Tonelli, and S. Villata, “A multilingual evaluation for online hate speech detection,” ACM Transactions on Internet Technology (TOIT), vol. 20, no. 2, pp. 1–22, 2020. ↗
  18. X. Huang, L. Xing, F. Dernoncourt, and M. J. Paul, “Multilingual twitter corpus and baselines for evaluating demographic bias in hate speech recognition,” arXiv preprint arXiv:2002.10361, 2020. ↗
  19. S. S. Aluru, B. Mathew, P. Saha, and A. Mukherjee, “Deep learning models for multilingual hate speech detection,” arXiv preprint arXiv:2004.06465, 2020. ↗
  20. “Facebook research:laser: Language-agnostic sentence representations.” [Online]. Available: https://github.com/facebookresearch/LASER [Accessed: 18/05/2024]. ↗
  21. “Facebook research:muse: Multilingual unsupervised and supervised embeddings.” [Online]. Available: https://github.com/facebookresearch/MUSE [Accessed: 18/05/2024]. ↗
  22. M. R. Islam, A. Amin, and A. N. Zereen, “Enhancing bangla language next word prediction and sentence completion through extended rnn with bi-lstm model on n-gram language,” arXiv preprint arXiv:2405.01873, 2024. ↗
  23. M. R. Islam, M. M. Islam, M. Afrin, A. Antara, N. Tabassum, A. Amin, et al., “Phishguard: A convolutional neural network based model for detecting phishing urls with explainability analysis,” arXiv preprint arXiv:2404.17960, 2024. ↗
  24. A. Amin, A. Sarkar, M. M. Islam, A. A. Miazee, M. R. Islam, and M. M. Hoque, “Sentiment polarity analysis of bangla food reviews using machine and deep learning algorithms,” arXiv preprint arXiv:2405.06667, 2024. ↗

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/roy-2024-english-offensive-text-detection-using/