Skip to content

This repository contains Python scripts for performing sentiment analysis on text using the TextBlob library. The code includes two different examples:

Notifications You must be signed in to change notification settings

alexanderstahl93/Simple-Sentiment-Text-Analysis-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple Sentiment Analysis for URL & local text files

This repository contains Python scripts for performing sentiment analysis on text using the TextBlob library. The code includes two different examples:

1. mainURL.py: This script demonstrates how to analyze the sentiment of an article obtained from a given URL.

Instructions:

  • Install the required libraries by running "pip install textblob newspaper3k".
  • Replace the url variable with the URL of the article you want to analyze.
  • Run the script using "python mainURL.py".

The script will download the article, extract the summarized text, perform sentiment analysis, and display the sentiment polarity.

2. mytext.py: This script shows how to analyze the sentiment of text stored in a file.

Instructions:

  • Install the required library by running "pip install textblob".
  • Create a text file named mytext.txt in the same directory as the script.
  • Write the text you want to analyze in the mytext.txt file.
  • Run the script using "python mytext.py".
The script will read the contents of the mytext.txt file, perform sentiment analysis, and display the sentiment polarity.

Please note that the instructions assume you have Python and the required libraries already installed on your system.
Learned from @NeuralNine: https://youtu.be/tXuvh5_Xyrw

About

This repository contains Python scripts for performing sentiment analysis on text using the TextBlob library. The code includes two different examples:

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages