From d34395eea069dcab1a8a805e920cff90c5ef0be6 Mon Sep 17 00:00:00 2001 From: ctt57 <ctt57@drexel.edu> Date: Sat, 20 Apr 2024 19:15:13 -0400 Subject: [PATCH] python --- main.py | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/main.py b/main.py index 60aa99e..af39de3 100644 --- a/main.py +++ b/main.py @@ -1,26 +1,29 @@ -#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. +# 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. # -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) + -- GitLab