gdalbo commited on
Commit
b0d46d5
·
1 Parent(s): 9b51d43

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -135,7 +135,7 @@ def get_prediction(sentence):
135
 
136
  output = Dcnn(inputs, training=False)
137
 
138
- return output
139
 
140
  def translate(sent):
141
  translator = Translator()
@@ -150,9 +150,9 @@ def predict(text):
150
  return prediction
151
 
152
  inputs = gr.inputs.Textbox(lines = 5, label = 'Como está se sentindo?')
153
- outputs = gr.outputs.Label(num_top_classes = 1, labels = lambda x: f'Probabilidade de suicídio: {x[0]:.2%}')
154
 
155
- app = gr.Interface(fn = predict, inputs = inputs, outputs = outputs, title = 'IA para classificação de risco de suicídio - Versão 0.0.1')
156
 
157
  app.launch()
158
 
 
135
 
136
  output = Dcnn(inputs, training=False)
137
 
138
+ return "Probabilidade de suicídio: {:.2%}".format(output[0][0])
139
 
140
  def translate(sent):
141
  translator = Translator()
 
150
  return prediction
151
 
152
  inputs = gr.inputs.Textbox(lines = 5, label = 'Como está se sentindo?')
153
+ #outputs = gr.outputs.Label(num_top_classes = 1, labels = lambda x: f'Probabilidade de suicídio: {x[0]:.2%}')
154
 
155
+ app = gr.Interface(fn = predict, inputs = inputs, outputs = 'text', title = 'IA para classificação de risco de suicídio - Versão 0.0.1')
156
 
157
  app.launch()
158