Tbruand
commited on
Commit
·
924d303
1
Parent(s):
8c88b4b
feat(interface): affichage markdown des scores pour chaque label
Browse files- app/interface.py +3 -8
app/interface.py
CHANGED
@@ -1,17 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from app.handler import predict
|
3 |
-
|
4 |
-
def predict(text: str) -> str:
|
5 |
-
label, score = model.predict(text)
|
6 |
-
return f"{label} ({score*100:.1f}%)"
|
7 |
-
|
8 |
|
9 |
def launch_app():
|
10 |
iface = gr.Interface(
|
11 |
fn=predict,
|
12 |
inputs="text",
|
13 |
-
outputs="
|
14 |
title="🧪 ToxiCheck",
|
15 |
-
description="Entrez un texte pour détecter s'il est toxique. Résultat avec score de confiance."
|
16 |
)
|
17 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from app.handler import predict
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def launch_app():
|
5 |
iface = gr.Interface(
|
6 |
fn=predict,
|
7 |
inputs="text",
|
8 |
+
outputs="markdown",
|
9 |
title="🧪 ToxiCheck",
|
10 |
+
description="Entrez un texte pour détecter s'il est toxique. Résultat avec score de confiance pour chaque label."
|
11 |
)
|
12 |
iface.launch()
|