Bigshot commited on
Commit
71f8630
1 Parent(s): 5683a70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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.5:
37
  return "That's Negative! (" + str(round(round(1-prediction[0],2)*100,1)) + "% confidence)", prediction[0]
38
- if prediction[0]>0.5:
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,