Skip to content

cristinamatacuta/SentimentAnalysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis and Keyword Context Extraction

Overview

This Python script performs sentiment analysis on three different books that won the International Arabic Fiction Award, and extracts extended contexts for specific keywords in the text. It utilizes the Natural Language Toolkit (NLTK) library for text processing and the VADER sentiment analysis tool to provide insights into the emotional tone of the text. This code can be used for any book, just make sure you change the name of the book in the code.

Prerequisites

Before running the script, ensure that you have the necessary libraries installed. You can install them via pip:

pip install nltk vaderSentiment

Additionally, make sure you have the book text files available in the same directory as the script and correctly named.

Usage

  1. Place the script in the same directory as the book text files.
  2. Install the required libraries, as mentioned in the Prerequisites section.
  3. Execute the script using Python
python script.py

Results

Upon execution, the script will display the sentiment analysis results for each book. Furthermore, it will provide the extracted contexts surrounding the specified keywords for in-depth analysis.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages