Skip to content

evelynkyl/scifi-sentiment-emotion-classifiction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis and Emotion Classification on Science Fiction (Dystopian Literature)

Using binary sentiment analysis to classify literary texts into positive/negative sentiment, and multi-class emotion classification ten emotion categories: fear, anger, anticipation, trust, surprise, positive, negative, sadness, disgust, joy. This project also performed emotion profiling for the top 3 characters in one of the books (2BR02B by Kurt Vonnegut) in the collection.

It is in fulfilment of the term project of Current Topics in Digital Philology. The goal of this project is to investigate the prominenet sentiments and emotions in this literary genre, thereby exploring the conceptualization of political and social issues in the genre of Dystopian fiction through the lens of sentiment analysis. It is an extension of my previous project of topic modeling in this genre as a means of distant reading.

This repo includes scripts for data preparation, deep learning using RoBERTa for sentiment analysis as well as traditional emotion classification using NRCLex, and evaluation (F1, accuracy).

Dependencies

The libraries/frameworks below are needed to run the scripts.

NRCLex
transformers
pytorch
sklearn
spacy

Dataset of this project

Dataset Size Source Genre Time period
dystro 10 books (Details can be found in data) Project Gutenburg Dystopia 19-20th century

Result

The detailed results and experiments can be found in the notebook in the root directory of this repo.

The entire collection and its subset (2BR02B)

image image image

Characters in the subset (2BR02B)

image image

Evaluation (of the characters)

image

About

Implementation of Distant Reading on Dystopian Literature (2) — Sentiment Analysis and Emotion Classification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published