Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# modules/studentact/current_situation_interface
|
2 |
|
3 |
import streamlit as st
|
4 |
import logging
|
@@ -63,7 +63,7 @@ TEXT_TYPES = {
|
|
63 |
}
|
64 |
####################################
|
65 |
|
66 |
-
def display_current_situation_interface(lang_code, nlp_models,
|
67 |
"""
|
68 |
Interfaz simplificada con gráfico de radar para visualizar métricas.
|
69 |
"""
|
@@ -87,7 +87,7 @@ def display_current_situation_interface(lang_code, nlp_models, t):
|
|
87 |
with input_col:
|
88 |
# Text area con manejo de estado
|
89 |
text_input = st.text_area(
|
90 |
-
|
91 |
height=400,
|
92 |
key="text_area",
|
93 |
value=st.session_state.text_input,
|
@@ -100,13 +100,13 @@ def display_current_situation_interface(lang_code, nlp_models, t):
|
|
100 |
st.session_state.show_results = False
|
101 |
|
102 |
if st.button(
|
103 |
-
|
104 |
type="primary",
|
105 |
disabled=not text_input.strip(),
|
106 |
use_container_width=True,
|
107 |
):
|
108 |
try:
|
109 |
-
with st.spinner(
|
110 |
doc = nlp_models[lang_code](text_input)
|
111 |
metrics = analyze_text_dimensions(doc)
|
112 |
|
@@ -126,7 +126,7 @@ def display_current_situation_interface(lang_code, nlp_models, t):
|
|
126 |
|
127 |
except Exception as e:
|
128 |
logger.error(f"Error en análisis: {str(e)}")
|
129 |
-
st.error(
|
130 |
|
131 |
# Mostrar resultados en la columna derecha
|
132 |
with results_col:
|
|
|
1 |
+
# modules/studentact/current_situation_interface.py
|
2 |
|
3 |
import streamlit as st
|
4 |
import logging
|
|
|
63 |
}
|
64 |
####################################
|
65 |
|
66 |
+
def display_current_situation_interface(lang_code, nlp_models, situation_t):
|
67 |
"""
|
68 |
Interfaz simplificada con gráfico de radar para visualizar métricas.
|
69 |
"""
|
|
|
87 |
with input_col:
|
88 |
# Text area con manejo de estado
|
89 |
text_input = st.text_area(
|
90 |
+
situation_t.get('input_prompt', "Escribe o pega tu texto aquí:"),
|
91 |
height=400,
|
92 |
key="text_area",
|
93 |
value=st.session_state.text_input,
|
|
|
100 |
st.session_state.show_results = False
|
101 |
|
102 |
if st.button(
|
103 |
+
situation_t.get('analyze_button', "Analizar mi escritura"),
|
104 |
type="primary",
|
105 |
disabled=not text_input.strip(),
|
106 |
use_container_width=True,
|
107 |
):
|
108 |
try:
|
109 |
+
with st.spinner(situation_t.get('processing', "Analizando...")):
|
110 |
doc = nlp_models[lang_code](text_input)
|
111 |
metrics = analyze_text_dimensions(doc)
|
112 |
|
|
|
126 |
|
127 |
except Exception as e:
|
128 |
logger.error(f"Error en análisis: {str(e)}")
|
129 |
+
st.error(situation_t.get('analysis_error', "Error al analizar el texto"))
|
130 |
|
131 |
# Mostrar resultados en la columna derecha
|
132 |
with results_col:
|