Skip to main content

Sentiment Analysis with 'syuzhet' using R

This lesson introduces you to the syuzhet sentiment analysis algorithm, written by Matthew Jockers using the R programming language, and applies it to a single narrative text to demonstrate its research potential. The term ‘syuzhet’ is Russian (сюже́т) and translates roughly as ‘plot’, or the order in which events in the narrative are presented to the reader, which may be different than the actual time sequence of events (the ‘fabula’). The syuzhet package similarly considers sentiment analysis in a time-series-friendly manner, allowing you to explore the developing sentiment in a text across the pages.

To make the lesson useful for scholars working with non-English texts, this tutorial uses a Spanish-language novel, Miau by Benito Pérez Galdós (1888) as its case study. This allows you to learn the steps necessary to work with everything from accented characters to thinking through the intellectual problems of applying English language algorithms to non-English texts. You do not need to know Spanish to follow the lesson (though you will if you want to read the original novel). Some steps in the following instructions may not be necessary if you are working with English-language texts, but those steps should be self-evident.

Reviewed by:

  • Riva Quiroga

Translated by:

  • Adam Crymble

Translation reviewed by:

  • Shuang Du
  • Andrew Janco

Learning outcomes

After completing this lesson, you will be able to:

  • Develop appropriate research questions that apply sentiment analysis to literary or narrative texts
  • Use the R programming language, RStudio, and the syuzhet package with the NRC Word-Emotion Association Lexicon to generate sentiment scores for words in texts of various languages
  • Critically interpret the results of your sentiment analysis
  • Visualise the results through a range of graphs (bar, word cloud) to aid interpretation
Interested in learning more?

Check out this lesson on Programming Historian's website

Go to this resource

Cite as

Jennifer Isasi (2023). Sentiment Analysis with 'syuzhet' using R. Version 1.0.0. Edited by Maria José Afanador-Llach and Rolando Rodriguez. ProgHist Ltd. [Training module]. https://doi.org/10.46430/phen0110

Reuse conditions

Resources hosted on DARIAH-Campus are subjects to the DARIAH-Campus Training Materials Reuse Charter

Full metadata

Title:
Sentiment Analysis with 'syuzhet' using R
Authors:
Jennifer Isasi
Domain:
Social Sciences and Humanities
Language:
en
Published to DARIAH-Campus:
11/7/2024
Originally published:
3/23/2023
Content type:
Training module
Licence:
CCBY 4.0
Sources:
Programming Historian
Topics:
Data visualisation
Version:
1.0.0