Skip to content
Snippets Groups Projects
Commit d34395ee authored by Christy Tran's avatar Christy Tran
Browse files

python

parent 9fe11a58
Branches
No related tags found
No related merge requests found
# Mission: Create a sentiment analysis extention that will take the users text and determine whether or not it is inclusive.
Depending on the users inclusivity it will display an approving/disapproving image.
# Depending on the users inclusivity it will display an approving/disapproving image.
#
Steps:
Research Sentimental Analysis
-Textblob
Create a Sentimental analysis program using Python
# Steps:
# Research Sentimental Analysis
# -Textblob
# Create a Sentimental analysis program using Python
#
Research articles, hatespeech, etc... to use to train AI to determine what will be considered inclusive and exclusive.
Use Libaray to train AI
# Research articles, hatespeech, etc... to use to train AI to determine what will be considered inclusive and exclusive.
# Use Libaray to train AI
#
#
Pseudocode
Ask user for input (text from file/article/active typing)
Import libraries (TextBlob)
Libary (TextBlob) has API for tagging certain phrases
Check whether or not the text includes tagged phrase
If text includes tagged phrase, decrease the score
If text includes no tagged phrases, increase the score
Calculate the overall score of the user (difference)
If score is positive then display image of happy cat
If score is negitive then display image of angry cat
If score is neutral (zero) then display image of middle cat
# Pseudocode
# Ask user for input (text from file/article/active typing)
# Import libraries (TextBlob)
# Libary (TextBlob) has API for tagging certain phrases
# Check whether or not the text includes tagged phrase
# If text includes tagged phrase, decrease the score
# If text includes no tagged phrases, increase the score
#
# Calculate the overall score of the user (difference)
# If score is positive then display image of happy cat
# If score is negitive then display image of angry cat
# If score is neutral (zero) then display image of middle cat
#
from textblob import TextBlob
from newspaper import Article
......@@ -37,3 +40,4 @@ print(text)
blob = TextBlob(text)
sentiment = blob.sentiment.polarity_# -1 to 1
print(sentiment)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment