Margaret commited on
Commit
b742362
1 Parent(s): 3b5753d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(user_text):
7
- return pipe(user_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
 
 
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