Limit content length to 500 characters in sentiment computation for improved analysis accuracy
Browse files- controllers/utils.py +1 -1
controllers/utils.py
CHANGED
@@ -178,7 +178,7 @@ def sentiment_computation(content):
|
|
178 |
}
|
179 |
sentiment_score = 0
|
180 |
maximum_value = 0
|
181 |
-
raw_sentiment = analyzer(content[:
|
182 |
sentiment_label = None
|
183 |
for sentiment_dict in raw_sentiment:
|
184 |
value = sentiment_dict["score"]
|
|
|
178 |
}
|
179 |
sentiment_score = 0
|
180 |
maximum_value = 0
|
181 |
+
raw_sentiment = analyzer(content[:500], top_k=None)
|
182 |
sentiment_label = None
|
183 |
for sentiment_dict in raw_sentiment:
|
184 |
value = sentiment_dict["score"]
|