Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,9 @@ import gradio as gr
|
|
| 4 |
pipe = pipeline("sentiment-analysis")
|
| 5 |
|
| 6 |
def get_sentiment(input):
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
demo = gr.Interface(
|
| 11 |
fn=get_sentiment,
|
|
|
|
| 4 |
pipe = pipeline("sentiment-analysis")
|
| 5 |
|
| 6 |
def get_sentiment(input):
|
| 7 |
+
label = prediction[0]['label']
|
| 8 |
+
score = prediction[0]['score']
|
| 9 |
+
return f'{label} {score * 100:.2f}%'
|
| 10 |
|
| 11 |
demo = gr.Interface(
|
| 12 |
fn=get_sentiment,
|