-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added feature sentiment analysis. Breaking Change!
- Loading branch information
Showing
5 changed files
with
48 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" Sentiment Analysis Module """ | ||
import asent # pylint: disable=unused-import | ||
import spacy | ||
|
||
def getSentiment(text): | ||
""" Sentiment analysis result """ | ||
# load spacy pipeline | ||
nlp = spacy.load("en_core_web_lg") | ||
# add the rule-based sentiment model | ||
nlp.add_pipe("asent_en_v1") | ||
sentiment = nlp(text) | ||
#print(f"totale: {doc._.polarity.compound}") | ||
|
||
return sentiment._.polarity.compound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ feedparser | |
Misskey.py | ||
python-dotenv | ||
schedule | ||
asent | ||
pip-review |