Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,10 +33,12 @@ def use(input_text):
|
|
33 |
prediction = model.predict(sequences)[0]
|
34 |
|
35 |
# Print the prediction
|
36 |
-
if prediction[0]<0.
|
37 |
return "That's Negative! (" + str(round(round(1-prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
38 |
-
|
39 |
return "That's Positive! (" + str(round(round(prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
|
|
|
|
40 |
|
41 |
|
42 |
iface = gr.Interface(fn=use,
|
|
|
33 |
prediction = model.predict(sequences)[0]
|
34 |
|
35 |
# Print the prediction
|
36 |
+
if prediction[0]<0.3:
|
37 |
return "That's Negative! (" + str(round(round(1-prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
38 |
+
elif prediction[0]>0.3:
|
39 |
return "That's Positive! (" + str(round(round(prediction[0],2)*100,1)) + "% confidence)", prediction[0]
|
40 |
+
else:
|
41 |
+
return "That's Neutral!", prediction[0]
|
42 |
|
43 |
|
44 |
iface = gr.Interface(fn=use,
|