Spaces:
Runtime error
Runtime error
rohanphadke
commited on
Commit
•
f005442
1
Parent(s):
88318eb
Update app.py
Browse files
app.py
CHANGED
@@ -9,12 +9,13 @@ threshold = 0.5
|
|
9 |
|
10 |
labels = {0: 'people', 1: 'planet', 2:'profit'}
|
11 |
return_labels = {'people': 0.25, 'planet':0.5, 'profit':0.75}
|
|
|
12 |
|
13 |
def greet(name):
|
14 |
return "Hello " + name + "!!"
|
15 |
|
16 |
def predict_text(text):
|
17 |
-
return return_labels
|
18 |
|
19 |
-
demo = gr.Interface(fn=predict_text, inputs="text", outputs="label")
|
20 |
demo.launch()
|
|
|
9 |
|
10 |
labels = {0: 'people', 1: 'planet', 2:'profit'}
|
11 |
return_labels = {'people': 0.25, 'planet':0.5, 'profit':0.75}
|
12 |
+
return_sentiment = {'positive': 0.25, 'neutral':0.5, 'negative':0.75}
|
13 |
|
14 |
def greet(name):
|
15 |
return "Hello " + name + "!!"
|
16 |
|
17 |
def predict_text(text):
|
18 |
+
return return_labels, return_sentiment
|
19 |
|
20 |
+
demo = gr.Interface(fn=predict_text, inputs="text", outputs=["label","label"])
|
21 |
demo.launch()
|