quocviethere
commited on
Commit
•
b17ec8a
1
Parent(s):
c0a1bfb
Update app.py
Browse files
app.py
CHANGED
@@ -6,10 +6,13 @@ sentiment = pipeline("sentiment-analysis")
|
|
6 |
def get_sentiment(input_text):
|
7 |
return sentiment(input_text)
|
8 |
|
|
|
|
|
|
|
9 |
iface = gr.Interface(fn = get_sentiment,
|
10 |
inputs = "text",
|
11 |
outputs = ['text'],
|
12 |
-
title='Sentiment Analysis',
|
13 |
-
description = "Creating safe AGI that benefits all of humanity")
|
14 |
|
15 |
iface.launch(inline = False)
|
|
|
6 |
def get_sentiment(input_text):
|
7 |
return sentiment(input_text)
|
8 |
|
9 |
+
def format_model_output(output):
|
10 |
+
return f"I am {output['score']*100:.2f}% sure that the review is {output['label']}"
|
11 |
+
|
12 |
iface = gr.Interface(fn = get_sentiment,
|
13 |
inputs = "text",
|
14 |
outputs = ['text'],
|
15 |
+
title='RoBERTa Sentiment Analysis',
|
16 |
+
description = ''' "Creating safe AGI that benefits all of humanity" ''')
|
17 |
|
18 |
iface.launch(inline = False)
|