Skip to content

Sentiment Analysis Python script using NLP (NLTK's VADER model) tool that analyses text data and labels them with sentiment scores.

License

Notifications You must be signed in to change notification settings

Kairos-T/NLTK-Sentiment-Analyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sentiment Analysis Script

This is a Python script that analyses sentiment in text data using the VADER (Valence Aware Dictionary and sEntiment Reasoner) sentiment analysis tool from the NLTK library.

Table of Contents

Description

The script reads input data from a text file, analyses the sentiment of each text using VADER sentiment analysis, and outputs the sentiment scores and labels to a CSV file.

Installation

  1. Clone this repository:
git clone https://github.com/Kairos-T/NLTK-Sentiment-Analyser/tree/main
cd NLTK-Sentiment-Analyser
  1. Install the dependencies:
pip install -r requirements.txt

Usage

Run the script with the following command:

python main.py input_data.txt sentiment_scores.csv

Replace input_data.txt with the name of the input data file, and sentiment_scores.csv with the desired name of the output CSV file.

Output

The script will generate a CSV file containing the sentiment analysis results for each input text. The CSV file will have the following columns:

  • Text: The input text.
  • Positive: The positive sentiment score.
  • Neutral: The neutral sentiment score.
  • Negative: The negative sentiment score.
  • Compound: The compound sentiment score.
  • Sentiment Label: The label indicating the overall sentiment.

About

Sentiment Analysis Python script using NLP (NLTK's VADER model) tool that analyses text data and labels them with sentiment scores.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages