This repository contains Python code demonstrating sentiment analysis using NLTK's VADER (Valence Aware Dictionary and sEntiment Reasoner) on a collection of Shakespeare's poems.
To run the sentiment analysis on these poems, follow these steps:
-
Use Google Colab: Upload all five Shakespeare poems in the
sample_data
folder within your Google Colab environment. Be mindful of file names, especially avoiding characters like apostrophes ('
) in file names due to potential issues with file paths. -
Install Dependencies: Ensure you have the necessary libraries installed by running the following commands in your Colab notebook:
-
Run the Code: Copy and paste the provided Python code cells into your Colab notebook and execute them to perform sentiment analysis on the Shakespeare poems.
The goal of this project is to analyze the sentiment expressed in five Shakespearean poems using NLTK's VADER sentiment analysis tool. The sentiment analysis will calculate overall sentiment scores for each poem and rank them from most positive to most negative based on these scores.
After running the sentiment analysis code, the poems are ranked based on their sentiment scores. A brief analysis is provided for each poem to explain the sentiment score in context.
- Shakespeare_Juliets Soliloquy: Reflects sadness and fear as Juliet contemplates her fate, resulting in a negative sentiment score.
- Shakespeare_Sonnet 130: Uses humor and irony to describe love, resulting in a positive sentiment score.
- Shakespeare_A Fair Song: Portrays admiration for the fairy queen, with a moderately positive sentiment score.
- Shakespeare_Blow, Blow, Thou Winter Wind: Conveys a negative outlook on winter and love, with a relatively positive sentiment score.
- Shakespeare_Fear No More: Reflects on mortality and acceptance, leaning towards a negative sentiment.