Skip to content

zeeshankhalid98/NLP_Sentiment_Analysis

Repository files navigation

NLTK VADER Sentiment Analysis for Shakespeare’s Poems

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.

Setup Instructions

To run the sentiment analysis on these poems, follow these steps:

  1. 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.

  2. Install Dependencies: Ensure you have the necessary libraries installed by running the following commands in your Colab notebook:

  3. 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.

Project Description

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.

Results and Analysis

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published