Skip to main content

Towards the Detection of Hateful Sentiment in Social Networks

  • Conference paper
  • First Online:
New Trends in Disruptive Technologies, Tech Ethics and Artificial Intelligence (DiTTEt 2022)

Abstract

Hate speech in social networks is affected and therefore increased thanks to anonymity. The use of opinion mining and Natural Language Processing (NLP) have increased their activity during the last few years because they provide an approach to analyze people's opinion, attitude ratings and emotions in the evolution of web 2.0.

This article shows the analysis of hateful sentiment in social networks, specifically on Twitter. For this purpose, the tweets have been obtained through the source of information provided by the Tweepy API, thus forming a corpus with tweets that will be labeled as hate and non-hate, as the input of the analysis. To carry it out, a series of tasks are performed: preprocessing, feature extraction, vectorization, training of the Naive Bayes classification algorithm and validation of the algorithm along several metrics.

We conclude the validity of the method, which could be used to make a more precise specification of hate speech, with the aim of identifying social biases, such as gender or racial discrimination, among others.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://www.nltk.org/.

  2. 2.

    https://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/.

  3. 3.

    https://www.tweepy.org/.

  4. 4.

    https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.CountVectorizer.html.

  5. 5.

    https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html.

  6. 6.

    https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.MultinomialNB.html.

  7. 7.

    https://scikit-learn.org/stable.

References

  1. Bird, S., Klein, E., Loper, E.: Natural Language Processing With Python (2019)

    Google Scholar 

  2. Aggarwal, C.C.: Opinion mining and sentiment analysis. In: Machine Learning For Text, pp. 491–514. Springer, Cham (2022)

    Google Scholar 

  3. Sanjinés, D.E., López, V.F., Gil, A.B., Moreno, M.N.: Opinion mining to detect irony in twitter messages in Spanish. In: International Workshop on Soft Computing Models in Industrial and Environmental Applications, pp. 513–522. Springer, Cham (2019)

    Google Scholar 

  4. Solon, B., Moritz, H., Arvind, N. Fairness and machine learning. Fairmlbook.Org. (2019)

    Google Scholar 

  5. Cabo Isasi, A., García, Juanatey, A.: El Discurso De Odio En Las Redes Sociales: Un Estado De La Cuestión (2017)

    Google Scholar 

  6. Harrag, F., Gueliani, S.: Event Based On Deep Learning In Food Hazard Arabic Texts (2020)

    Google Scholar 

  7. Li, Y., Xu, L.: Word embedding revisited: a new representation learning and explicit matrix factorization perspective. In: Int'l J. Conf. On Artificial Intelligence (Ijcai) (2015)

    Google Scholar 

  8. Alpaydin, E.: Introduction To Machine Learning. Mit Press. (2020)

    Google Scholar 

  9. Angwin, J., Larson, J., Mattu, S.: And Kirchner. Propublica, L. Machine Bias (2016)

    Google Scholar 

  10. Lipton, Z.C.: From Ai To Ml To Ai: On Swirling Nomenclature & Slurried Thought (2018)

    Google Scholar 

  11. Barocas, S., Selbst, A.D.: Big Data's Disparate Impact 104 Calif Law Rev 671 (2016)

    Google Scholar 

  12. Zuiderveen, F.: Discrimination, Artificial Intelligence, And Algorithmic Decision-Making. Council Of Europe, Directorate General Of Democracy (2016)

    Google Scholar 

  13. Park, J.H., Shin, J., Fung, P.: Reducing gender bias in abusive language detection. In: Empirical Methods Of Natural Language Processing. Emnlp‘18 (2018)

    Google Scholar 

  14. Bolukbasi, T., Chang, K.W., Zou, J.Y., Saligrama, V., Kalai, A.T.: Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In: Advances in Neural Information Processing Systems (2019)

    Google Scholar 

  15. Angwin, J. et al., Machine Bias. Pro Publica (2016)

    Google Scholar 

  16. Burns, K. Hendricks, L.A., Darrell, T., Rohrbach, A., And Saenko, K.: Women Also Snowboard: Overcoming Bias in Captioning Models. In: European Conference On Computer Vision. Eecv’18 (2018)

    Google Scholar 

  17. Crawford, K.: The Trouble with Bias. In: Keynote At Neural Information Processing Systems. Nips‘17 (2017)

    Google Scholar 

  18. Douglas, L.: Ai Is Not Just Learning Our Biases; It Is Amplifying Them (2017)

    Google Scholar 

Download references

Acknowledgements

This research has been supported by the project “Project Monitoring and tracking systems for the improvement of intelligent mobility and behavior analysis (SiMoMIAC)”, Reference: PID2019-108883RB-C21/AEI/https://doi.org/10.13039/501100011033, financed by the Spanish State Research Agency (AEI).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Ana-Belén Gil-González .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

González, S.G., Gil-González, AB., López-Batista, V.F. (2023). Towards the Detection of Hateful Sentiment in Social Networks. In: de la Iglesia, D.H., de Paz Santana, J.F., López Rivero, A.J. (eds) New Trends in Disruptive Technologies, Tech Ethics and Artificial Intelligence. DiTTEt 2022. Advances in Intelligent Systems and Computing, vol 1430. Springer, Cham. https://doi.org/10.1007/978-3-031-14859-0_13

Download citation

Publish with us

Policies and ethics