Anthology of Computers and the Humanities · Volume 4

Des émotions au fil du récit :
fabula, un package pour analyser les textes francophones par Transformers

Florian Cafiero1,2 and Alexandre Lionnet3

  • 1 LRE, Ecole Pour l’Informatique et les Techniques Avancées (EPITA), Paris, France
  • 2 École nationale des chartes, Université Paris Sciences & Lettres (PSL), Paris, France
  • 3 École Pratique des Hautes Études, Université Paris Sciences & Lettres (PSL), Paris, France

Permanent Link: https://doi.org/10.63744/hHyKtxX4Iu6S

Published: 21 May 2025

Keywords: python, sentiment analysis, emotion detection, BERT, computational literary studies

Mots clés : python, analyse de sentiments, détection d’émotions, BERT, études littéraires computationnelles

Abstract

Computational emotion analysis has become an established tool in computational literary studies for describing and comparing narratives. However, the solutions currently available for French remain limited and often rely on fixed lexicons that are not very robust to context, such as polysemy, negation, or irony, and that are difficult to relate back to the text in a fine-grained way. We present here fabula-fr, a Python package designed for emotion analysis in Francophone narratives. It is based on Transformer models while retaining a simple and reproducible pipeline. fabula offers several segmentation and smoothing strategies, an “in-context” mode to stabilize the analysis of long texts, preservation of probabilistic distributions, configurable smoothed arcs, and procedures providing a minima explainability for classification choices. Our article situates these design choices within the state of the art and proposes an agenda for validation and extension.