Jointly Learning to Detect Emotions and Predict Facebook Reactions

  • Lisa GrazianiEmail author
  • Stefano Melacci
  • Marco Gori
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11730)


The growing ubiquity of Social Media data offers an attractive perspective for improving the quality of machine learning-based models in several fields, ranging from Computer Vision to Natural Language Processing. In this paper we focus on Facebook posts paired with “reactions” of multiple users, and we investigate their relationships with classes of emotions that are typically considered in the task of emotion detection. We are inspired by the idea of introducing a connection between reactions and emotions by means of First-Order Logic formulas, and we propose an end-to-end neural model that is able to jointly learn to detect emotions and predict Facebook reactions in a multi-task environment, where the logic formulas are converted into polynomial constraints. Our model is trained using a large collection of unsupervised texts together with data labeled with emotion classes and Facebook posts that include reactions. An extended experimental analysis that leverages a large collection of Facebook posts shows that the tasks of emotion classification and reaction prediction can both benefit from their interaction.


Emotion detection from text Facebook reactions Learning from Constraints 



This project has received funding from the European Union’s Horizon 2020 research and innovation program under grant agreement No 825619.


  1. 1.
    Agrawal, A., An, A.: Unsupervised emotion detection from text using semantic and syntactic relations. In: Proceedings of the International Joint Conferences on Web Intelligence and Intelligent Agent Technology, pp. 346–353. IEEE (2012)Google Scholar
  2. 2.
    Alm, C.: Affect in text and speech. Ph.D. thesis, University of Illinois (2008)Google Scholar
  3. 3.
    Chaffar, S., Inkpen, D.: Using a heterogeneous dataset for emotion analysis in text. In: Butz, C., Lingras, P. (eds.) AI 2011. LNCS (LNAI), vol. 6657, pp. 62–67. Springer, Heidelberg (2011). Scholar
  4. 4.
    Ekman, P., Friesen, W.V.: Constants across cultures in the face and emotion. J. Pers. Soc. Psychol. 17(2), 124 (1971)CrossRefGoogle Scholar
  5. 5.
    Gnecco, G., Gori, M., Melacci, S., Sanguineti, M.: Foundations of support constraint machines. Neural Comput. 27(2), 388–480 (2015)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Gori, M., Melacci, S.: Constraint verification with kernel machines. IEEE Trans. Neural Netw. Learn. Syst. 24(5), 825–831 (2013)CrossRefGoogle Scholar
  7. 7.
    Graziani, L., Melacci, S., Gori, M.: The role of coherence in facial expression recognition. In: Ghidini, C., Magnini, B., Passerini, A., Traverso, P. (eds.) AI*IA 2018. LNCS (LNAI), vol. 11298, pp. 320–333. Springer, Cham (2018). Scholar
  8. 8.
    Herzig, J., Shmueli-Scheuer, M., Konopnicki, D.: Emotion detection from text via ensemble classification using word embeddings. In: Proceedings of the International Conference on Theory of Information Retrieval, pp. 269–272. ACM (2017)Google Scholar
  9. 9.
    Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)CrossRefGoogle Scholar
  10. 10.
    Kim, S.M., Valitutti, A., Calvo, R.A.: Evaluation of unsupervised emotion models to textual affect recognition. In: NAACL HLT Workshop on Computational Approaches to Analysis and Generation of Emotion in Text, pp. 62–70. ACL (2010)Google Scholar
  11. 11.
    Krebs, F., Lubascher, B., Moers, T., Schaap, P., Spanakis, G.: Social emotion mining techniques for Facebook posts reaction prediction. In: Proceedings of the 10th International Conference on Agents and Artificial Intelligence (2018)Google Scholar
  12. 12.
    Mohammad, S.: Portable features for classifying emotional text. In: Proceedings of the Conference of the NAACL HLT, pp. 587–591. ACL (2012)Google Scholar
  13. 13.
    Pool, C., Nissim, M.: Distant supervision for emotion detection using Facebook reactions. In: Proceedings of the Workshop on Computational Modeling of People’s Opinions, Personality, and Emotions in Social Media, pp. 30–39 (2016)Google Scholar
  14. 14.
    Qadir, A., Riloff, E.: Learning emotion indicators from tweets: hashtags, hashtag patterns, and phrases. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 1203–1209 (2014)Google Scholar
  15. 15.
    Raad, B.T., Philipp, B., Patrick, H., Christoph, M.: ASEDS: towards automatic social emotion detection system using Facebook reactions. In: International Conference on High Performance Computing and Communications; on Smart City; on Data Science and Systems (HPCC/SmartCity/DSS), pp. 860–866. IEEE (2018)Google Scholar
  16. 16.
    Scherer, K.R., Wallbott, H.G.: Evidence for universality and cultural variation of differential emotion response patterning. J. Pers. Soc. Psychol. 66(2), 310 (1994)CrossRefGoogle Scholar
  17. 17.
    Schuster, M., Paliwal, K.K.: Bidirectional recurrent neural networks. IEEE Trans. Signal Process. 45(11), 2673–2681 (1997)CrossRefGoogle Scholar
  18. 18.
    Strapparava, C., Mihalcea, R.: SemEval-2007 task 14: affective text. In: Proceedings of the 4th International Workshop on Semantic Evaluations, pp. 70–74 (2007)Google Scholar
  19. 19.
    Strapparava, C., Mihalcea, R.: Learning to identify emotions in text. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1556–1560. ACM (2008)Google Scholar
  20. 20.
    Wang, Y., Pal, A.: Detecting emotions in social media: a constrained optimization approach. In: IJCAI, pp. 996–1002 (2015)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.DINFOUniversity of FlorenceFlorenceItaly
  2. 2.DIISMUniversity of SienaSienaItaly

Personalised recommendations