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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maggie Kocorowski
Sentiment Text Analysis
Commits
41b6a3c0
Commit
41b6a3c0
authored
Apr 21, 2024
by
Christy Tran
Browse files
Options
Downloads
Patches
Plain Diff
message
parent
b568d09c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.html
+1
-1
1 addition, 1 deletion
main.html
main.py
+32
-11
32 additions, 11 deletions
main.py
mytext.txt
+2
-0
2 additions, 0 deletions
mytext.txt
with
35 additions
and
12 deletions
main.html
+
1
−
1
View file @
41b6a3c0
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<div
class=
"description"
>
<div
class=
"description"
>
<h2>
Christy Tran
</h2>
<h2>
Christy Tran
</h2>
<p>
Developer
</p>
<p>
Developer
</p>
<p>
Computer Science
</p>
<p>
Software Engineerings
</p>
<p>
ctt57@drexel.edu
</p>
<p>
ctt57@drexel.edu
</p>
</div>
</div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
main.py
+
32
−
11
View file @
41b6a3c0
...
@@ -24,20 +24,41 @@
...
@@ -24,20 +24,41 @@
# If score is neutral (zero) then display image of middle cat
# If score is neutral (zero) then display image of middle cat
#
#
from
textblob
import
TextBlob
from
newspaper
import
Article
url
=
"
FIXME
"
article
=
Article
(
url
)
article
.
download
()
from
textblob
import
TextBlob
article
.
parse
()
article
.
nlp
()
text
=
article
.
summary
print
(
text
)
with
open
(
'
mytext.txt
'
,
'
r
'
)
as
f
:
text
=
f
.
read
()
blob
=
TextBlob
(
text
)
blob
=
TextBlob
(
text
)
sentiment
=
blob
.
sentiment
.
polarity
_
# -1 to
1
sentiment
=
blob
.
sentiment
.
polarity
#-1-
1
print
(
sentiment
)
print
(
sentiment
)
#simple sentiment text analysis (https://www.youtube.com/watch?v=tXuvh5_Xyrw&t=610s)
#if sentmient>1:
# figure out how to get images to appear
# elif sentiment<1:
# figure out how to get image to appear
# else:
# last image
#from textblob import TextBlob
#from newspaper import Article
#url = "FIXME"
#article = Article(url)
#article.download()
#article.parse()
#article.nlp()
#text = article.summary
#print(text)
#blob = TextBlob(text)
#sentiment = blob.sentiment.polarity_# -1 to 1
#print(sentiment)
This diff is collapsed.
Click to expand it.
mytext.txt
0 → 100644
+
2
−
0
View file @
41b6a3c0
I hate hate hate lots of things
I am so negitive!!
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
sign in
to comment