Format all code.
This commit is contained in:
@@ -9,11 +9,11 @@ _analyzer = SentimentIntensityAnalyzer()
|
||||
def get_sentiment_score(text):
|
||||
"""
|
||||
Analyzes a piece of text and returns its sentiment score.
|
||||
|
||||
|
||||
The 'compound' score is a single metric that summarizes the sentiment.
|
||||
It ranges from -1 (most negative) to +1 (most positive).
|
||||
"""
|
||||
# The polarity_scores() method returns a dictionary with 'neg', 'neu', 'pos', and 'compound' scores.
|
||||
# We are most interested in the 'compound' score.
|
||||
scores = _analyzer.polarity_scores(text)
|
||||
return scores['compound']
|
||||
return scores["compound"]
|
||||
|
Reference in New Issue
Block a user