From 19335a3ca7cf93112c9f2da5ac69a81b63d9e8ec Mon Sep 17 00:00:00 2001 From: maggie <mjk488@drexel.edu> Date: Sat, 20 Apr 2024 13:15:43 -0400 Subject: [PATCH] python tutorial code --- main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/main.py b/main.py index e69de29..d6e9d7f 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,17 @@ +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) + -- GitLab