Skip to content

Project for analyzing emotional intensity in movie subtitles using a transformer-based text classification model. The scripts extract emotions from subtitles and generate visualizations to represent emotional trends over time.

Notifications You must be signed in to change notification settings

kirillsimin/movie-subtitles-emotions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Movie Subtitle Emotion Analysis

This is a project for analyzing emotional intensity in movie subtitles. Using a transformer-based text classification model, the script extracts emotions from subtitles and generates visualizations to represent emotional trends over time.

The analysis is powered by the j-hartmann/emotion-english-distilroberta-base model from Hugging Face, which classifies text into various emotional categories using a fine-tuned DistilRoBERTa transformer model.

Files:

  • chart.py: This script processes subtitles and generates emotion graphs for a single movie.
  • heatmap.py: This script generates a heatmap comparing emotional intensity trends across multiple movies.

How to Use:

  1. Install dependencies:
    pip install -r requirements.txt
  2. Download .srt files into the data/ folder. For example from https://www.opensubtitles.org
  3. Run chart.py with an .srt subtitle file as input:
    python chart.py ./data/subtitles.srt
  4. Run heatmap.py to generate a heatmap of emotional intensity across movies in ./data folder:
    python heatmap.py

Results Examples:

25 Movies top movies combined

25-best-movies

Interstellar (2014)

interstellar

About

Project for analyzing emotional intensity in movie subtitles using a transformer-based text classification model. The scripts extract emotions from subtitles and generate visualizations to represent emotional trends over time.

Resources

Stars

Watchers

Forks

Languages