Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ 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",
|
|
|
3 |
|
4 |
pipe = pipeline("sentiment-analysis", model="cardiffnlp/twitter-roberta-base-sentiment-latest")
|
5 |
|
6 |
+
def get_sentiment(user_text):
|
7 |
+
return pipe(user_text)[0]["label"]
|
8 |
|
9 |
iface = gr.Interface(fn = get_sentiment,
|
10 |
inputs = "text",
|