Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def predict_sentiment(text, model):
|
|
13 |
if model == "finiteautomata/bertweet-base-sentiment-analysis":
|
14 |
pipe = pipeline("text-classification", model="finiteautomata/bertweet-base-sentiment-analysis")
|
15 |
out = pipe(text, return_all_scores=True)
|
16 |
-
return {pred["label"]: pred["score"] for pred in out}
|
17 |
elif model == "vader":
|
18 |
nltk.download('vader_lexicon')
|
19 |
sia = SentimentIntensityAnalyzer()
|
|
|
13 |
if model == "finiteautomata/bertweet-base-sentiment-analysis":
|
14 |
pipe = pipeline("text-classification", model="finiteautomata/bertweet-base-sentiment-analysis")
|
15 |
out = pipe(text, return_all_scores=True)
|
16 |
+
return {pred["label"]: pred["score"] for pred in out[0]}
|
17 |
elif model == "vader":
|
18 |
nltk.download('vader_lexicon')
|
19 |
sia = SentimentIntensityAnalyzer()
|