Bigshot commited on
Commit
63da01c
1 Parent(s): 55effaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -31,7 +31,10 @@ def use(input_text):
31
  prediction = model.predict(sequences)[0]
32
 
33
  # Print the prediction
34
- return round(prediction[0])
 
 
 
35
 
36
 
37
  iface = gr.Interface(fn=use, inputs="text", outputs="text")
 
31
  prediction = model.predict(sequences)[0]
32
 
33
  # Print the prediction
34
+ if prediction[0]<0.5:
35
+ return "That's mean! (" + str(round(1-prediction[0],2)*100) + "% confidence)"
36
+ if prediction[0]>0.5:
37
+ return "That's nice! (" + str(round(prediction[0],2)*100) + "% confidence)"
38
 
39
 
40
  iface = gr.Interface(fn=use, inputs="text", outputs="text")