Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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"
|
| 96 |
|
| 97 |
with gr.Blocks() as demo:
|
| 98 |
-
gr.Markdown("##
|
| 99 |
-
gr.Markdown("- Le texte brut\n- Les
|
| 100 |
with gr.Row():
|
| 101 |
-
audio_input = gr.File(label="
|
| 102 |
run_button = gr.Button("Lancer")
|
| 103 |
with gr.Row():
|
| 104 |
-
punctuated_output = gr.Textbox(label="
|
| 105 |
-
entities_output = gr.JSON(label="
|
| 106 |
with gr.Row():
|
| 107 |
-
aligned_output = gr.File(label="
|
| 108 |
-
meta_output = gr.File(label="
|
| 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)
|