Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sentiment Text Analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maggie Kocorowski
Sentiment Text Analysis
Commits
d34395ee
Commit
d34395ee
authored
1 year ago
by
Christy Tran
Browse files
Options
Downloads
Patches
Plain Diff
python
parent
9fe11a58
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+23
-19
23 additions, 19 deletions
main.py
with
23 additions
and
19 deletions
main.py
+
23
−
19
View file @
d34395ee
# 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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment