Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ LANGUAGE_CODES = {
|
|
| 19 |
|
| 20 |
def analyze_text(text):
|
| 21 |
if not text.strip():
|
| 22 |
-
return {"error": "
|
| 23 |
|
| 24 |
# Detect language
|
| 25 |
lang_result = lang_classifier(text)
|
|
@@ -55,13 +55,13 @@ def analyze_text(text):
|
|
| 55 |
# Define the Gradio interface
|
| 56 |
iface = gr.Interface(
|
| 57 |
fn=analyze_text,
|
| 58 |
-
inputs=gr.Textbox(label="
|
| 59 |
outputs=[
|
| 60 |
gr.JSON(label="Language Detection & Translation"),
|
| 61 |
gr.JSON(label="Hate Speech Detection")
|
| 62 |
],
|
| 63 |
-
title="
|
| 64 |
-
description="
|
| 65 |
)
|
| 66 |
|
| 67 |
# Launch the Gradio app
|
|
|
|
| 19 |
|
| 20 |
def analyze_text(text):
|
| 21 |
if not text.strip():
|
| 22 |
+
return {"error": "Nessun testo"}, {"error": "Nessun testo"}
|
| 23 |
|
| 24 |
# Detect language
|
| 25 |
lang_result = lang_classifier(text)
|
|
|
|
| 55 |
# Define the Gradio interface
|
| 56 |
iface = gr.Interface(
|
| 57 |
fn=analyze_text,
|
| 58 |
+
inputs=gr.Textbox(label="Inserisci testo"),
|
| 59 |
outputs=[
|
| 60 |
gr.JSON(label="Language Detection & Translation"),
|
| 61 |
gr.JSON(label="Hate Speech Detection")
|
| 62 |
],
|
| 63 |
+
title="Rileva Lingua, offese e parolaccie",
|
| 64 |
+
description="Inserisci testo"
|
| 65 |
)
|
| 66 |
|
| 67 |
# Launch the Gradio app
|