AhBoh commited on
Commit
f43e7e5
·
verified ·
1 Parent(s): 1dd206d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -19,7 +19,7 @@ LANGUAGE_CODES = {
19
 
20
  def analyze_text(text):
21
  if not text.strip():
22
- return {"error": "No text provided"}, {"error": "No text provided"}
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="Enter text"),
59
  outputs=[
60
  gr.JSON(label="Language Detection & Translation"),
61
  gr.JSON(label="Hate Speech Detection")
62
  ],
63
- title="Detect language, translate, and check for offensive speech",
64
- description="Enter text..."
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