Skip to main content

Sentiment Analysis

  • Chapter
  • First Online:
Text Analysis with R

Abstract

This chapter describes how to perform sentiment analysis using the syuzhet package developed by Jockers. Readers will learn how to extract sentiment values from a text and compare and visualize the emotional arcs of two novels.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 89.99
Price excludes VAT (USA)
  • Durable hardcover 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

Notes

  1. 1.

    You can watch the lecture on YouTube: https://www.youtube.com/watch?v=oP3c1h8 v2ZQ.

  2. 2.

    In this chapter we explore a lexicon-based approach to sentiment analysis. There are other, more sophisticated, methods for performing sentiment analysis. These other methods employ machine learning algorithms. See, for example, Socher et al. (2013).

  3. 3.

    The word syuzhet comes from the Russian formalist Vladimir Propp who divided narrative into the fabula and the syuzhet. The fabula are the specific elements of a plot, whereas the syuzhet is the manner in which those elements are organized in the linear movement of the narrative.

  4. 4.

    We say “almost certainly” because our research has shown that there is some degree of individual variation in how sentiment is assessed. See, for example, Jockers (2015a); Jockers (2016).

  5. 5.

    That the novels have different lengths will be important to remember when we explore plotting them on the same graph.

  6. 6.

    The get_sentences function implements a sentence splitting function from the textshape package.

  7. 7.

    The syuzhet dictionary was developed in the Nebraska Literary Lab where it was tuned specifically for fiction. The words and values in the default dictionary were extracted from a collection of 165,000 human coded sentences taken from a small corpus of contemporary novels.

  8. 8.

    In this chapter we have only scratched the surface of the features available in the syuzhet package. If you would like to learn more about syuzhet’s capabilities, enter browseVignettes( "syuzhet") in the console and then click the link for the HTML version.

References

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

L. Jockers, M., Thalken, R. (2020). Sentiment Analysis. In: Text Analysis with R. Quantitative Methods in the Humanities and Social Sciences. Springer, Cham. https://doi.org/10.1007/978-3-030-39643-5_14

Download citation

Publish with us

Policies and ethics