Spaces:
Build error
Build error
Upload app.py
Browse files
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 =
|
| 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 |
|