Spaces:
Sleeping
Sleeping
Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
|
@@ -1,8 +1,16 @@
|
|
| 1 |
# modules/studentact/current_situation_interface.py
|
| 2 |
|
|
|
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
import logging
|
| 5 |
from ..utils.widget_utils import generate_unique_key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
logger = logging.getLogger(__name__)
|
| 8 |
|
|
@@ -70,7 +78,31 @@ def display_current_situation_interface(lang_code, nlp_models, t):
|
|
| 70 |
logger.error(f"Error en an谩lisis de situaci贸n actual: {str(e)}")
|
| 71 |
st.error(t.get('analysis_error', "Error al procesar el an谩lisis"))
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
def show_recommendations(feedback, t):
|
| 76 |
"""
|
|
|
|
| 1 |
# modules/studentact/current_situation_interface.py
|
| 2 |
|
| 3 |
+
# modules/studentact/current_situation_interface.py
|
| 4 |
+
|
| 5 |
import streamlit as st
|
| 6 |
import logging
|
| 7 |
from ..utils.widget_utils import generate_unique_key
|
| 8 |
+
from .current_situation_analysis import (
|
| 9 |
+
analyze_text_dimensions,
|
| 10 |
+
create_vocabulary_network,
|
| 11 |
+
create_syntax_complexity_graph,
|
| 12 |
+
create_cohesion_heatmap
|
| 13 |
+
)
|
| 14 |
|
| 15 |
logger = logging.getLogger(__name__)
|
| 16 |
|
|
|
|
| 78 |
logger.error(f"Error en an谩lisis de situaci贸n actual: {str(e)}")
|
| 79 |
st.error(t.get('analysis_error', "Error al procesar el an谩lisis"))
|
| 80 |
|
| 81 |
+
def display_current_situation_visual(doc, metrics):
|
| 82 |
+
"""Visualizaci贸n de resultados"""
|
| 83 |
+
try:
|
| 84 |
+
with st.container():
|
| 85 |
+
st.subheader("Riqueza de Vocabulario")
|
| 86 |
+
vocabulary_graph = create_vocabulary_network(doc)
|
| 87 |
+
if vocabulary_graph:
|
| 88 |
+
st.pyplot(vocabulary_graph)
|
| 89 |
+
plt.close(vocabulary_graph)
|
| 90 |
+
|
| 91 |
+
st.subheader("Estructura de Oraciones")
|
| 92 |
+
syntax_graph = create_syntax_complexity_graph(doc)
|
| 93 |
+
if syntax_graph:
|
| 94 |
+
st.pyplot(syntax_graph)
|
| 95 |
+
plt.close(syntax_graph)
|
| 96 |
+
|
| 97 |
+
st.subheader("Cohesi贸n del Texto")
|
| 98 |
+
cohesion_map = create_cohesion_heatmap(doc)
|
| 99 |
+
if cohesion_map:
|
| 100 |
+
st.pyplot(cohesion_map)
|
| 101 |
+
plt.close(cohesion_map)
|
| 102 |
+
|
| 103 |
+
except Exception as e:
|
| 104 |
+
logger.error(f"Error mostrando visualizaciones: {str(e)}")
|
| 105 |
+
st.error("Error al generar visualizaciones")
|
| 106 |
|
| 107 |
def show_recommendations(feedback, t):
|
| 108 |
"""
|