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