evannh commited on
Commit
8555957
·
verified ·
1 Parent(s): 9d7081c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -92,20 +92,20 @@ def gradio_process(audio_file_path):
92
  texte, ents, aligned_json, meta_json = process_pipeline(audio_file_path)
93
  return texte, ents, aligned_json, meta_json
94
  except Exception as e:
95
- return f"\u274c Erreur : {str(e)}", [], None, None
96
 
97
  with gr.Blocks() as demo:
98
- gr.Markdown("## \ud83c\udf99\ufe0f Transcription + Diarisation + NER en fran\u00e7ais (sans SpaCy)")
99
- gr.Markdown("- Le texte brut\n- Les entit\u00e9s nomm\u00e9es d\u00e9tect\u00e9es\n- Les fichiers JSON g\u00e9n\u00e9r\u00e9s")
100
  with gr.Row():
101
- audio_input = gr.File(label="S\u00e9lectionnez un fichier audio", type="filepath")
102
  run_button = gr.Button("Lancer")
103
  with gr.Row():
104
- punctuated_output = gr.Textbox(label="\ud83d\udcdd Texte brut", lines=10)
105
- entities_output = gr.JSON(label="\ud83c\udfe0 Entit\u00e9s nomm\u00e9es")
106
  with gr.Row():
107
- aligned_output = gr.File(label="\ud83d\udcc0 Aligned JSON")
108
- meta_output = gr.File(label="\ud83d\udcc4 Meta JSON")
109
  run_button.click(
110
  gradio_process,
111
  inputs=[audio_input],
@@ -113,4 +113,4 @@ with gr.Blocks() as demo:
113
  )
114
 
115
  if __name__ == "__main__":
116
- demo.launch()
 
92
  texte, ents, aligned_json, meta_json = process_pipeline(audio_file_path)
93
  return texte, ents, aligned_json, meta_json
94
  except Exception as e:
95
+ return f"Erreur : {str(e)}", [], None, None
96
 
97
  with gr.Blocks() as demo:
98
+ gr.Markdown("## Transcription + Diarisation + NER en français")
99
+ gr.Markdown("- Le texte brut\n- Les entités nommées détectées\n- Les fichiers JSON générés")
100
  with gr.Row():
101
+ audio_input = gr.File(label="Sélectionnez un fichier audio", type="filepath")
102
  run_button = gr.Button("Lancer")
103
  with gr.Row():
104
+ punctuated_output = gr.Textbox(label="Texte brut", lines=10)
105
+ entities_output = gr.JSON(label="Entités nommées")
106
  with gr.Row():
107
+ aligned_output = gr.File(label="Aligned JSON")
108
+ meta_output = gr.File(label="Meta JSON")
109
  run_button.click(
110
  gradio_process,
111
  inputs=[audio_input],
 
113
  )
114
 
115
  if __name__ == "__main__":
116
+ demo.launch(share=True)