Update modules/ui.py
Browse files- modules/ui.py +12 -6
modules/ui.py
CHANGED
@@ -344,21 +344,24 @@ def display_discourse_analysis_interface(nlp_models, lang_code):
|
|
344 |
'file_uploader1': "Cargar archivo de texto 1 (Patrón)",
|
345 |
'file_uploader2': "Cargar archivo de texto 2 (Comparación)",
|
346 |
'analyze_button': "Analizar textos",
|
347 |
-
'
|
|
|
348 |
},
|
349 |
'en': {
|
350 |
'title': "AIdeaText - Discourse Analysis",
|
351 |
'file_uploader1': "Upload text file 1 (Pattern)",
|
352 |
'file_uploader2': "Upload text file 2 (Comparison)",
|
353 |
'analyze_button': "Analyze texts",
|
354 |
-
'
|
|
|
355 |
},
|
356 |
'fr': {
|
357 |
'title': "AIdeaText - Analyse du discours",
|
358 |
'file_uploader1': "Télécharger le fichier texte 1 (Modèle)",
|
359 |
'file_uploader2': "Télécharger le fichier texte 2 (Comparaison)",
|
360 |
'analyze_button': "Analyser les textes",
|
361 |
-
'
|
|
|
362 |
}
|
363 |
}
|
364 |
|
@@ -379,10 +382,13 @@ def display_discourse_analysis_interface(nlp_models, lang_code):
|
|
379 |
text_content2 = uploaded_file2.getvalue().decode('utf-8')
|
380 |
|
381 |
if st.button(t['analyze_button']):
|
382 |
-
|
383 |
|
384 |
-
with st.expander(t['
|
385 |
-
st.pyplot(
|
|
|
|
|
|
|
386 |
|
387 |
##################################################################################################
|
388 |
def get_chatbot_response(input_text):
|
|
|
344 |
'file_uploader1': "Cargar archivo de texto 1 (Patrón)",
|
345 |
'file_uploader2': "Cargar archivo de texto 2 (Comparación)",
|
346 |
'analyze_button': "Analizar textos",
|
347 |
+
'comparison1': "Relaciones Semánticas del Documento 1",
|
348 |
+
'comparison2': "Relaciones Semánticas del Documento 2",
|
349 |
},
|
350 |
'en': {
|
351 |
'title': "AIdeaText - Discourse Analysis",
|
352 |
'file_uploader1': "Upload text file 1 (Pattern)",
|
353 |
'file_uploader2': "Upload text file 2 (Comparison)",
|
354 |
'analyze_button': "Analyze texts",
|
355 |
+
'comparison1': "Semantic Relations of Document 1",
|
356 |
+
'comparison2': "Semantic Relations of Document 2",
|
357 |
},
|
358 |
'fr': {
|
359 |
'title': "AIdeaText - Analyse du discours",
|
360 |
'file_uploader1': "Télécharger le fichier texte 1 (Modèle)",
|
361 |
'file_uploader2': "Télécharger le fichier texte 2 (Comparaison)",
|
362 |
'analyze_button': "Analyser les textes",
|
363 |
+
'comparison1': "Relations Sémantiques du Document 1",
|
364 |
+
'comparison2': "Relations Sémantiques du Document 2",
|
365 |
}
|
366 |
}
|
367 |
|
|
|
382 |
text_content2 = uploaded_file2.getvalue().decode('utf-8')
|
383 |
|
384 |
if st.button(t['analyze_button']):
|
385 |
+
graph1, graph2 = perform_discourse_analysis(text_content1, text_content2, nlp_models[lang_code], lang_code)
|
386 |
|
387 |
+
with st.expander(t['comparison1'], expanded=True):
|
388 |
+
st.pyplot(graph1)
|
389 |
+
|
390 |
+
with st.expander(t['comparison2'], expanded=True):
|
391 |
+
st.pyplot(graph2)
|
392 |
|
393 |
##################################################################################################
|
394 |
def get_chatbot_response(input_text):
|