Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,12 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipe = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest")
|
5 |
|
6 |
-
def get_sentiment(
|
7 |
-
return pipe(
|
8 |
|
9 |
iface = gr.Interface(fn = get_sentiment,
|
10 |
inputs = "text",
|
11 |
-
outputs =
|
12 |
title= 'Sentiment Analysis',
|
13 |
description = 'Get Sentiment Negative/Positive/Neutral for the given input')
|
14 |
|
|
|
3 |
|
4 |
pipe = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest")
|
5 |
|
6 |
+
def get_sentiment(input_text):
|
7 |
+
return pipe(input_text)[0]["label"]
|
8 |
|
9 |
iface = gr.Interface(fn = get_sentiment,
|
10 |
inputs = "text",
|
11 |
+
outputs = 'text',
|
12 |
title= 'Sentiment Analysis',
|
13 |
description = 'Get Sentiment Negative/Positive/Neutral for the given input')
|
14 |
|