Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -56,10 +56,11 @@ def predict_sentiment(sentence = "Volim ti"):
|
|
56 |
torch.unsqueeze(batch["attention_mask"], 0),)
|
57 |
|
58 |
print(tokenizer.decode(batch["input_ids"],skip_special_tokens=True))
|
|
|
59 |
prediction =torch.max(classifier_output.logits, axis=1)
|
60 |
predictions.append(prediction.indices.item())
|
61 |
|
62 |
-
print("
|
63 |
return id2label[predictions[0]]
|
64 |
|
65 |
|
@@ -67,7 +68,7 @@ interface = gr.Interface(
|
|
67 |
fn=predict_sentiment,
|
68 |
inputs='text',
|
69 |
outputs=['label'],
|
70 |
-
title='Sentiment Analysis',
|
71 |
description='Get the positive/neutral/negative sentiment for the given input.'
|
72 |
)
|
73 |
|
|
|
56 |
torch.unsqueeze(batch["attention_mask"], 0),)
|
57 |
|
58 |
print(tokenizer.decode(batch["input_ids"],skip_special_tokens=True))
|
59 |
+
print("logits:",classifier_output.logits)
|
60 |
prediction =torch.max(classifier_output.logits, axis=1)
|
61 |
predictions.append(prediction.indices.item())
|
62 |
|
63 |
+
print("predictions:", predictions[0] , id2label[predictions[0]] )
|
64 |
return id2label[predictions[0]]
|
65 |
|
66 |
|
|
|
68 |
fn=predict_sentiment,
|
69 |
inputs='text',
|
70 |
outputs=['label'],
|
71 |
+
title='Croatian News Sentiment Analysis 1.0',
|
72 |
description='Get the positive/neutral/negative sentiment for the given input.'
|
73 |
)
|
74 |
|