Skip to content
Snippets Groups Projects
Commit 72a908e6 authored by Maggie Kocorowski's avatar Maggie Kocorowski
Browse files
parents 8cf51273 d34395ee
No related branches found
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. # 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: # Steps:
Research Sentimental Analysis # Research Sentimental Analysis
-Textblob # -Textblob
Create a Sentimental analysis program using Python # 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. # Research articles, hatespeech, etc... to use to train AI to determine what will be considered inclusive and exclusive.
Use Libaray to train AI # Use Libaray to train AI
# #
# #
Pseudocode # Pseudocode
Ask user for input (text from file/article/active typing) # Ask user for input (text from file/article/active typing)
Import libraries (TextBlob) # Import libraries (TextBlob)
Libary (TextBlob) has API for tagging certain phrases # Libary (TextBlob) has API for tagging certain phrases
Check whether or not the text includes tagged phrase # Check whether or not the text includes tagged phrase
If text includes tagged phrase, decrease the score # If text includes tagged phrase, decrease the score
If text includes no tagged phrases, increase 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 # Calculate the overall score of the user (difference)
If score is negitive then display image of angry cat # If score is positive then display image of happy cat
If score is neutral (zero) then display image of middle 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 textblob import TextBlob
from newspaper import Article from newspaper import Article
...@@ -37,3 +40,4 @@ print(text) ...@@ -37,3 +40,4 @@ print(text)
blob = TextBlob(text) blob = TextBlob(text)
sentiment = blob.sentiment.polarity_# -1 to 1 sentiment = blob.sentiment.polarity_# -1 to 1
print(sentiment) print(sentiment)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment