Spaces:
Sleeping
Sleeping
umsee
commited on
Commit
·
1821cd3
1
Parent(s):
1e6209d
fixed app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ classifier = pipeline('sentiment-analysis',model=model,tokenizer=tokenizer,top_k
|
|
8 |
|
9 |
def classify(statement):
|
10 |
preds = classifier(statement)
|
11 |
-
return{i['
|
12 |
|
13 |
demo = gr.Interface(fn=classify,inputs='text',outputs=gr.Label())
|
14 |
demo.launch()
|
|
|
8 |
|
9 |
def classify(statement):
|
10 |
preds = classifier(statement)
|
11 |
+
return{i['label']:float(i['score']) for i in preds[0]}
|
12 |
|
13 |
demo = gr.Interface(fn=classify,inputs='text',outputs=gr.Label())
|
14 |
demo.launch()
|