Elamur Research⌕
☰
home / papers / 2022 / GUCT at Arabic Hate Speech 2022: Towards a Better Isotropy for Hatespeech Detection

GUCT at Arabic Hate Speech 2022: Towards a Better Isotropy for Hatespeech Detection

Paper · 2022 · Nehal Elkaref and Mervat Abu-Elkheir

Summary

The authors took part in sub-task A of the OSACT 2022 shared task on Fine-grained Hate Speech Detection, a binary decision on whether a dialectal Arabic tweet is offensive. Tweets are short and give a language model little context, so the authors try to improve the input representations rather than the classifier. They first show that MARBERT's contextual embedding space is highly anisotropic: vectors crowd into a narrow cone, and rare words drift away from the origin. Its isotropy score is about 2.88e-08. They then apply the cluster-based post-processing of Rajaee and Pilehvar: K-means the vectors, centre each cluster, and project out a few dominant directions per cluster. This raises isotropy to roughly 0.97. Both raw and processed MARBERT vectors are fed to a biLSTM classifier. The isotropic version reaches 81.2% accuracy and 79.1% macro-F1 on the development set, against 77.2% F1 for raw vectors. On the test set it scores 76.5% accuracy and about 74.2% F1. The work suggests that cheap geometric post-processing of frozen embeddings can help downstream classification.

Key points

  • Data: about 8.5K training and 1.2K development tweets from the OSACT5 dataset (Mubarak et al., 2022). Mentions, URLs, diacritics, elongations and non-Arabic characters were removed.
  • Isotropy measurement: isotropy is computed as the ratio of the minimum to the maximum of a partition function taken over the eigenvectors of the embedding matrix. MARBERT scores 2.88e-08. After processing, scores are 0.9564 with k=1, 0.9743 with k=10 and 0.9767 with k=20.
  • Setup: 10 clusters, with 8 directions removed per cluster (embedding dimension divided by 100). The biLSTM has two hidden layers of size 102 and is trained with AdamW at a learning rate of 3e-5 for 10 epochs. The best checkpoint is kept by macro-F1.
  • Development results: macro-F1 was 79.1% with isotropic vectors and 77.2% with raw vectors. The confusion matrix shows 766 of 898 non-offensive and 271 of 368 offensive tweets classified correctly.
  • Test results: 76.5% accuracy. The paper reports F1 as 74.2% in some places and 74.5% in others.
  • Ablations: k=2, 10 and 20 give nearly identical scores. Removing 16 or 30 directions also changes little, which the authors attribute either to losing useful semantics or to the scarcity of high-frequency words in tweets.

Interesting ideas

  • I1. Before trusting a pretrained encoder, the authors compute a single isotropy number for its embedding space, giving a cheap diagnostic of representation degeneration.
  • I2. Instead of fine-tuning, they post-process frozen vectors by clustering them and removing each cluster's top principal directions, a training-free fix that restores spread.
  • I3. The authors note that an anisotropic space inflates cosine similarity between unrelated items, so raw similarity scores are misleading.
  • I4. They plot the embedding space with points coloured by word frequency, which visually exposes rare words clustering away from the origin.
  • I5. Their ablations sweep the number of clusters and directions and find a flat plateau, showing the gain is not tied to one fragile setting.

For Mova

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

  • I1 (tree): gparse could log the isotropy of its transformer token vectors per layer, so that a degenerate encoder is flagged before parser training starts.
  • I2 (tree): this could be tried as a lightweight feature transform on gparse's encoder outputs before the arc and label scorers, with the change in LAS measured.
  • I3 (world): any embedding-based matching of mentions to WordNet/Wikidata ontology entries should centre the vectors and remove dominant directions first, so similarity reflects meaning rather than a shared offset.
  • I4 (learn): frequency-coloured projections of silver-data token vectors could reveal whether rare lemmas are poorly represented and need extra teacher-labelled examples.
  • I5 (learn): Mova's evaluation could routinely include such hyperparameter sweeps alongside negative controls, so that a reported improvement holds across a range of settings.

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

 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 3Research subjects and languages the work is about.Sentiment & emotion · 972 worksSemitic languages · 2,908 worksBias, fairness & safety · 517 works

Cite

Cite as Nehal Elkaref and Mervat Abu-Elkheir. 2022. GUCT at Arabic Hate Speech 2022: Towards a Better Isotropy for Hatespeech Detection. Proceedinsg of the 5th Workshop on Open-Source Arabic Corpora and Processing Tools with Shared Tasks on Qur'an QA and Fine-Grained Hate Speech Detection.

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{elkaref2022guct,
  title = {{GUCT at Arabic Hate Speech 2022: Towards a Better Isotropy for Hatespeech Detection}},
  author = {Nehal Elkaref and Mervat Abu-Elkheir},
  booktitle = {Proceedinsg of the 5th Workshop on Open-Source Arabic Corpora and Processing Tools with Shared Tasks on Qur'an QA and Fine-Grained Hate Speech Detection},
  year = {2022},
  url = {https://aclanthology.org/2022.osact-1.27/}
}

References

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

  1. Abdul-Mageed, M., Elmadany, A., and Nagoudi, E. M. B. (2020). Arbert & marbert: deep bidirectional transformers for arabic. arXiv preprint arXiv:2101.01785. ↗
  2. Abuzayed, A. and Elsayed, T. (2020). Quick and simple approach for detecting hate speech in arabic tweets. In Proceedings of the 4th workshop on open-source Arabic Corpora and processing tools, with a shared task on offensive language detection, pages 109–114.
  3. Arora, S., Li, Y., Liang, Y., Ma, T., and Risteski, A. (2016). A latent variable model approach to pmi-based word embeddings. Transactions of the Association for Computational Linguistics, 4:385–399. ↗
  4. Church, K. W. (2017). Word2vec. Natural Language Engineering, 23(1):155–162. find
  5. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. ↗
  6. Gao, J., He, D., Tan, X., Qin, T., Wang, L., and Liu, T.-Y. (2019). Representation degeneration problem in training natural language generation models. arXiv preprint arXiv:1907.12009. ↗
  7. Huang, L., Yang, D., Lang, B., and Deng, J. (2018). Decorrelated batch normalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 791–800. find
  8. Husain, F. (2020). Osact4 shared task on offensive language detection: Intensive preprocessing-based approach. arXiv preprint arXiv:2005.07297. ↗
  9. Ioffe, S. and Szegedy, C. (2015). Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR. ↗
  10. Joulin, A., Grave, E., Bojanowski, P., Douze, M., Jégou, H., and Mikolov, T. (2016). Fasttext. zip: Compressing text classification models. arXiv preprint arXiv:1612.03651. ↗
  11. Liang, Y., Cao, R., Zheng, J., Ren, J., and Gao, L. (2021). Learning to remove: Towards isotropic pre-trained bert embedding. In International Conference on Artificial Neural Networks, pages 448–459. Springer. https://github.com/nehalelkaref/Towards-a-Better-Isotropy-to-Detect-Hatespeech. git Mu, J., Bhat, S., and Viswanath, P. (2017). All-but-the-top: Simple and effective postprocessing for word representations. arXiv preprint arXiv:1702.01417. ↗
  12. Mubarak, H., Hassan, S., and Chowdhury, S. A. (2022). Emojis as anchors to detect arabic offensive language and hate speech. arXiv preprint arXiv:2201.06723. ↗
  13. Rajaee, S. and Pilehvar, M. T. (2021a). A cluster-based approach for improving isotropy in contextual embedding space. arXiv preprint arXiv:2106.01183. ↗
  14. Rajaee, S. and Pilehvar, M. T. (2021b). An isotropy analysis in the multilingual bert embedding space. arXiv preprint arXiv:2110.04504. Rajaee, S. and Sheikhi, M. ). Isotropic contextual word representation in bert. ↗
  15. Saeed, H. H., Calders, T., and Kamiran, F. (2020). Osact4 shared tasks: Ensembled stacked classification for offensive and hate speech in arabic tweets. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection, pages 71–75.
  16. Soliman, A. B., Eissa, K., and El-Beltagy, S. R. (2017). Aravec: A set of arabic word embedding models for use in arabic nlp. Procedia Computer Science, 117:256–265. find
  17. Wang, L., Huang, J., Huang, K., Hu, Z., Wang, G., and Gu, Q. (2019). Improving neural language generation with spectrum control. In International Conference on Learning Representations. find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/elkaref-2022-guct-arabic-hate-speech-2022/