Update modules/ui/ui.py
Browse files- modules/ui/ui.py +11 -10
modules/ui/ui.py
CHANGED
@@ -618,20 +618,21 @@ def display_semantic_analysis_interface(nlp_models, lang_code):
|
|
618 |
# Realizar el análisis
|
619 |
analysis_result = perform_semantic_analysis(text_content, nlp_models[lang_code], lang_code)
|
620 |
|
621 |
-
# Mostrar
|
622 |
-
with st.expander(t['
|
623 |
-
|
624 |
-
|
625 |
-
st.markdown(f"Contexto: *{entity['context']}*")
|
626 |
-
|
627 |
# Mostrar conceptos clave
|
628 |
with st.expander(t['key_concepts'], expanded=True):
|
629 |
for concept, freq in analysis_result['key_concepts']:
|
630 |
st.markdown(f"- {concept}: {freq}")
|
631 |
-
|
632 |
-
# Mostrar
|
633 |
-
with st.expander(t['
|
634 |
-
|
|
|
|
|
|
|
635 |
|
636 |
# Guardar el resultado del análisis
|
637 |
if store_semantic_result(st.session_state.username, text_content, analysis_result):
|
|
|
618 |
# Realizar el análisis
|
619 |
analysis_result = perform_semantic_analysis(text_content, nlp_models[lang_code], lang_code)
|
620 |
|
621 |
+
# Mostrar el gráfico de relaciones semánticas
|
622 |
+
with st.expander(t['semantic_relations'], expanded=True):
|
623 |
+
st.pyplot(analysis_result['relations_graph'])
|
624 |
+
|
|
|
|
|
625 |
# Mostrar conceptos clave
|
626 |
with st.expander(t['key_concepts'], expanded=True):
|
627 |
for concept, freq in analysis_result['key_concepts']:
|
628 |
st.markdown(f"- {concept}: {freq}")
|
629 |
+
|
630 |
+
# Mostrar entidades identificadas
|
631 |
+
with st.expander(t['identified_entities'], expanded=True):
|
632 |
+
entities_text = ""
|
633 |
+
for entity in analysis_result['entities']:
|
634 |
+
entities_text += f"[[{entity['text']} ({entity['label']}) - Contexto: {entity['context']}]] "
|
635 |
+
st.markdown(entities_text)
|
636 |
|
637 |
# Guardar el resultado del análisis
|
638 |
if store_semantic_result(st.session_state.username, text_content, analysis_result):
|