Format all code.

This commit is contained in:
2025-07-25 23:22:37 +02:00
parent f940470de3
commit 56e0965a5f
19 changed files with 850 additions and 353 deletions

View File

@@ -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"]