Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
@@ -90,7 +90,7 @@ ANALYSIS_DIMENSION_MAPPING = {
|
|
90 |
}
|
91 |
}
|
92 |
|
93 |
-
####################################
|
94 |
|
95 |
def display_current_situation_interface(lang_code, nlp_models, t):
|
96 |
"""
|
@@ -109,295 +109,93 @@ def display_current_situation_interface(lang_code, nlp_models, t):
|
|
109 |
st.session_state.current_metrics = None
|
110 |
|
111 |
try:
|
112 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
with st.container():
|
114 |
-
|
115 |
-
text_base_col, results_base_col, text_iter_col, results_iter_col = st.columns(4)
|
116 |
|
117 |
# Columna 1: Texto Base
|
118 |
with text_base_col:
|
119 |
st.markdown("### Texto Base")
|
120 |
-
|
121 |
-
"
|
122 |
height=400,
|
123 |
-
key="
|
124 |
-
value=st.session_state.
|
125 |
-
help="Este texto servirá como línea base"
|
126 |
)
|
127 |
|
128 |
-
|
129 |
-
"
|
130 |
-
|
131 |
-
disabled=not text_input.strip(),
|
132 |
-
use_container_width=True
|
133 |
-
)
|
134 |
-
|
135 |
-
# Columna 2: Resultados Base
|
136 |
-
with results_base_col:
|
137 |
-
if baseline_button and text_input:
|
138 |
-
with st.spinner("Analizando línea base..."):
|
139 |
-
doc = nlp_models[lang_code](text_input)
|
140 |
metrics = analyze_text_dimensions(doc)
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
# Columna 3: Texto Iteración
|
145 |
with text_iter_col:
|
146 |
-
st.markdown("###
|
147 |
-
|
148 |
-
"Nueva versión
|
149 |
height=400,
|
150 |
-
key="
|
151 |
-
|
|
|
152 |
)
|
153 |
|
154 |
-
|
155 |
"Analizar Iteración",
|
156 |
type="primary",
|
157 |
-
|
158 |
-
|
159 |
-
)
|
160 |
-
|
161 |
-
# Columna 4: Resultados Iteración
|
162 |
-
with results_iter_col:
|
163 |
-
if iterate_button and iteration_text:
|
164 |
with st.spinner("Analizando iteración..."):
|
165 |
-
doc = nlp_models[lang_code](
|
166 |
metrics = analyze_text_dimensions(doc)
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
|
|
|
|
|
|
|
177 |
)
|
178 |
-
|
179 |
-
except Exception as e:
|
180 |
-
logger.error(f"Error en interfaz principal: {str(e)}")
|
181 |
-
st.error("Ocurrió un error al cargar la interfaz")
|
182 |
-
|
183 |
-
|
184 |
-
###################################
|
185 |
-
|
186 |
-
def display_metrics_column(metrics, title):
|
187 |
-
"""Muestra columna de métricas con formato consistente"""
|
188 |
-
# st.markdown(f"#### Métricas {title}")
|
189 |
-
|
190 |
-
for dimension in ['vocabulary', 'structure', 'cohesion', 'clarity']:
|
191 |
-
value = metrics[dimension]['normalized_score']
|
192 |
-
if value < 0.6:
|
193 |
-
status = "⚠️ Por mejorar"
|
194 |
-
color = "inverse"
|
195 |
-
elif value < 0.8:
|
196 |
-
status = "📈 Aceptable"
|
197 |
-
color = "off"
|
198 |
-
else:
|
199 |
-
status = "✅ Óptimo"
|
200 |
-
color = "normal"
|
201 |
-
|
202 |
-
st.metric(
|
203 |
-
dimension.title(),
|
204 |
-
f"{value:.2f}",
|
205 |
-
status,
|
206 |
-
delta_color=color
|
207 |
-
)
|
208 |
-
|
209 |
-
###################################
|
210 |
-
|
211 |
-
def display_baseline_interface(lang_code, nlp_models, t):
|
212 |
-
"""Interfaz para establecer línea base"""
|
213 |
-
try:
|
214 |
-
st.markdown("### Establecer Línea Base")
|
215 |
-
|
216 |
-
text_input = st.text_area(
|
217 |
-
"Texto para línea base",
|
218 |
-
height=300,
|
219 |
-
help="Este texto servirá como punto de referencia para medir tu progreso"
|
220 |
-
)
|
221 |
-
|
222 |
-
if st.button("Establecer como línea base", type="primary"):
|
223 |
-
with st.spinner("Analizando texto base..."):
|
224 |
-
# Analizar el texto
|
225 |
-
doc = nlp_models[lang_code](text_input)
|
226 |
-
metrics = analyze_text_dimensions(doc)
|
227 |
-
|
228 |
-
# Guardar como línea base
|
229 |
-
success = store_writing_baseline(
|
230 |
-
username=st.session_state.username,
|
231 |
-
metrics=metrics,
|
232 |
-
text=text_input
|
233 |
-
)
|
234 |
-
|
235 |
-
if success:
|
236 |
-
st.success("Línea base establecida con éxito")
|
237 |
-
# Mostrar el gráfico radar inicial
|
238 |
-
metrics_config = prepare_metrics_config(metrics)
|
239 |
-
display_radar_chart(metrics_config, TEXT_TYPES['student_essay']['thresholds'])
|
240 |
-
else:
|
241 |
-
st.error("Error al guardar la línea base")
|
242 |
-
|
243 |
-
except Exception as e:
|
244 |
-
logger.error(f"Error en interfaz de línea base: {str(e)}")
|
245 |
-
st.error("Error al establecer línea base")
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
###################################
|
250 |
-
|
251 |
-
def display_comparison_interface(lang_code, nlp_models, t):
|
252 |
-
"""Interfaz para comparar progreso"""
|
253 |
-
try:
|
254 |
-
# Obtener línea base
|
255 |
-
baseline = get_writing_baseline(st.session_state.username)
|
256 |
-
|
257 |
-
if not baseline:
|
258 |
-
st.warning("Primero debes establecer una línea base")
|
259 |
-
return
|
260 |
-
|
261 |
-
# Crear dos columnas
|
262 |
-
col1, col2 = st.columns(2)
|
263 |
|
264 |
-
with col1:
|
265 |
-
st.markdown("### Línea Base")
|
266 |
-
st.text_area(
|
267 |
-
"Texto original",
|
268 |
-
value=baseline['text'],
|
269 |
-
disabled=True,
|
270 |
-
height=200
|
271 |
-
)
|
272 |
-
|
273 |
-
with col2:
|
274 |
-
st.markdown("### Nuevo Texto")
|
275 |
-
current_text = st.text_area(
|
276 |
-
"Ingresa el nuevo texto a comparar",
|
277 |
-
height=200
|
278 |
-
)
|
279 |
-
|
280 |
-
if st.button("Analizar progreso", type="primary"):
|
281 |
-
with st.spinner("Analizando progreso..."):
|
282 |
-
# Analizar texto actual
|
283 |
-
doc = nlp_models[lang_code](current_text)
|
284 |
-
current_metrics = analyze_text_dimensions(doc)
|
285 |
-
|
286 |
-
# Mostrar comparación
|
287 |
-
display_comparison_results(
|
288 |
-
baseline_metrics=baseline['metrics'],
|
289 |
-
current_metrics=current_metrics
|
290 |
-
)
|
291 |
-
|
292 |
-
# Opción para guardar progreso
|
293 |
-
if st.button("Guardar este progreso"):
|
294 |
-
success = store_writing_progress(
|
295 |
-
username=st.session_state.username,
|
296 |
-
metrics=current_metrics,
|
297 |
-
text=current_text
|
298 |
-
)
|
299 |
-
|
300 |
-
if success:
|
301 |
-
st.success("Progreso guardado exitosamente")
|
302 |
-
else:
|
303 |
-
st.error("Error al guardar el progreso")
|
304 |
-
|
305 |
except Exception as e:
|
306 |
-
logger.error(f"Error en interfaz
|
307 |
-
st.error("Error al
|
308 |
-
|
309 |
-
###################################
|
310 |
-
|
311 |
-
def display_comparison_results(baseline_metrics, current_metrics):
|
312 |
-
"""Muestra comparación entre línea base y métricas actuales"""
|
313 |
-
|
314 |
-
# Crear columnas para métricas y gráfico
|
315 |
-
metrics_col, graph_col = st.columns([1, 1.5])
|
316 |
-
|
317 |
-
with metrics_col:
|
318 |
-
for dimension in ['vocabulary', 'structure', 'cohesion', 'clarity']:
|
319 |
-
baseline = baseline_metrics[dimension]['normalized_score']
|
320 |
-
current = current_metrics[dimension]['normalized_score']
|
321 |
-
delta = current - baseline
|
322 |
-
|
323 |
-
st.metric(
|
324 |
-
dimension.title(),
|
325 |
-
f"{current:.2f}",
|
326 |
-
f"{delta:+.2f}",
|
327 |
-
delta_color="normal" if delta >= 0 else "inverse"
|
328 |
-
)
|
329 |
-
|
330 |
-
# Sugerir herramientas de mejora
|
331 |
-
if delta < 0:
|
332 |
-
suggest_improvement_tools(dimension)
|
333 |
-
|
334 |
-
with graph_col:
|
335 |
-
display_radar_chart_comparison(
|
336 |
-
baseline_metrics,
|
337 |
-
current_metrics
|
338 |
-
)
|
339 |
-
|
340 |
-
###################################
|
341 |
-
def suggest_improvement_tools(dimension):
|
342 |
-
"""Sugiere herramientas basadas en la dimensión"""
|
343 |
-
suggestions = []
|
344 |
-
for analysis, mapping in ANALYSIS_DIMENSION_MAPPING.items():
|
345 |
-
if dimension in mapping['primary']:
|
346 |
-
suggestions.extend(mapping['tools'])
|
347 |
-
|
348 |
-
st.info(f"Herramientas sugeridas para mejorar {dimension}:")
|
349 |
-
for tool in suggestions:
|
350 |
-
st.write(f"- {tool}")
|
351 |
-
|
352 |
-
###################################
|
353 |
-
|
354 |
-
def prepare_metrics_config(metrics, text_type='student_essay'):
|
355 |
-
"""
|
356 |
-
Prepara la configuración de métricas en el mismo formato que display_results.
|
357 |
-
Args:
|
358 |
-
metrics: Diccionario con las métricas analizadas
|
359 |
-
text_type: Tipo de texto para los umbrales
|
360 |
-
Returns:
|
361 |
-
list: Lista de configuraciones de métricas
|
362 |
-
"""
|
363 |
-
# Obtener umbrales según el tipo de texto
|
364 |
-
thresholds = TEXT_TYPES[text_type]['thresholds']
|
365 |
-
|
366 |
-
# Usar la misma estructura que en display_results
|
367 |
-
return [
|
368 |
-
{
|
369 |
-
'label': "Vocabulario",
|
370 |
-
'key': 'vocabulary',
|
371 |
-
'value': metrics['vocabulary']['normalized_score'],
|
372 |
-
'help': "Riqueza y variedad del vocabulario",
|
373 |
-
'thresholds': thresholds['vocabulary']
|
374 |
-
},
|
375 |
-
{
|
376 |
-
'label': "Estructura",
|
377 |
-
'key': 'structure',
|
378 |
-
'value': metrics['structure']['normalized_score'],
|
379 |
-
'help': "Organización y complejidad de oraciones",
|
380 |
-
'thresholds': thresholds['structure']
|
381 |
-
},
|
382 |
-
{
|
383 |
-
'label': "Cohesión",
|
384 |
-
'key': 'cohesion',
|
385 |
-
'value': metrics['cohesion']['normalized_score'],
|
386 |
-
'help': "Conexión y fluidez entre ideas",
|
387 |
-
'thresholds': thresholds['cohesion']
|
388 |
-
},
|
389 |
-
{
|
390 |
-
'label': "Claridad",
|
391 |
-
'key': 'clarity',
|
392 |
-
'value': metrics['clarity']['normalized_score'],
|
393 |
-
'help': "Facilidad de comprensión del texto",
|
394 |
-
'thresholds': thresholds['clarity']
|
395 |
-
}
|
396 |
-
]
|
397 |
|
398 |
-
|
399 |
|
400 |
-
def
|
401 |
"""
|
402 |
Muestra los resultados del análisis: métricas verticalmente y gráfico radar.
|
403 |
"""
|
@@ -474,7 +272,34 @@ def display_results(metrics, text_type=None):
|
|
474 |
logger.error(f"Error mostrando resultados: {str(e)}")
|
475 |
st.error("Error al mostrar los resultados")
|
476 |
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
|
479 |
def display_radar_chart(metrics_config, thresholds, baseline_metrics=None):
|
480 |
"""
|
@@ -573,4 +398,59 @@ def display_radar_chart(metrics_config, thresholds, baseline_metrics=None):
|
|
573 |
logger.error(f"Error mostrando gráfico radar: {str(e)}")
|
574 |
st.error("Error al mostrar el gráfico")
|
575 |
|
576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
}
|
92 |
|
93 |
+
#Función principal ####################################
|
94 |
|
95 |
def display_current_situation_interface(lang_code, nlp_models, t):
|
96 |
"""
|
|
|
109 |
st.session_state.current_metrics = None
|
110 |
|
111 |
try:
|
112 |
+
# 1. Selector de tipo de texto
|
113 |
+
text_type = st.selectbox(
|
114 |
+
"Tipo de texto",
|
115 |
+
options=list(TEXT_TYPES.keys()),
|
116 |
+
format_func=lambda x: TEXT_TYPES[x]['name'],
|
117 |
+
help="Selecciona el tipo de texto para ajustar los criterios de evaluación"
|
118 |
+
)
|
119 |
+
|
120 |
+
# Guardar en estado
|
121 |
+
st.session_state.current_text_type = text_type
|
122 |
+
|
123 |
+
# 2. Container principal con 4 columnas
|
124 |
with st.container():
|
125 |
+
text_base_col, metrics_base_col, text_iter_col, metrics_iter_col = st.columns([1,1,1,1])
|
|
|
126 |
|
127 |
# Columna 1: Texto Base
|
128 |
with text_base_col:
|
129 |
st.markdown("### Texto Base")
|
130 |
+
text_base = st.text_area(
|
131 |
+
"Texto original",
|
132 |
height=400,
|
133 |
+
key="text_base",
|
134 |
+
value=st.session_state.get('base_text', ''),
|
|
|
135 |
)
|
136 |
|
137 |
+
if st.button("Analizar Base", type="primary", use_container_width=True):
|
138 |
+
with st.spinner("Analizando texto base..."):
|
139 |
+
doc = nlp_models[lang_code](text_base)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
metrics = analyze_text_dimensions(doc)
|
141 |
+
|
142 |
+
# Guardar en estado
|
143 |
+
st.session_state.base_text = text_base
|
144 |
+
st.session_state.base_metrics = metrics
|
145 |
+
st.session_state.show_base = True
|
146 |
+
|
147 |
+
# Columna 2: Métricas Base
|
148 |
+
with metrics_base_col:
|
149 |
+
if st.session_state.get('show_base'):
|
150 |
+
display_metrics_and_suggestions(
|
151 |
+
st.session_state.base_metrics,
|
152 |
+
text_type,
|
153 |
+
"Base"
|
154 |
+
)
|
155 |
+
|
156 |
# Columna 3: Texto Iteración
|
157 |
with text_iter_col:
|
158 |
+
st.markdown("### Iteración")
|
159 |
+
text_iter = st.text_area(
|
160 |
+
"Nueva versión",
|
161 |
height=400,
|
162 |
+
key="text_iter",
|
163 |
+
value=st.session_state.get('iter_text', ''),
|
164 |
+
disabled=not st.session_state.get('show_base')
|
165 |
)
|
166 |
|
167 |
+
if st.button(
|
168 |
"Analizar Iteración",
|
169 |
type="primary",
|
170 |
+
use_container_width=True,
|
171 |
+
disabled=not st.session_state.get('show_base')
|
172 |
+
):
|
|
|
|
|
|
|
|
|
173 |
with st.spinner("Analizando iteración..."):
|
174 |
+
doc = nlp_models[lang_code](text_iter)
|
175 |
metrics = analyze_text_dimensions(doc)
|
176 |
+
|
177 |
+
# Guardar en estado
|
178 |
+
st.session_state.iter_text = text_iter
|
179 |
+
st.session_state.iter_metrics = metrics
|
180 |
+
st.session_state.show_iter = True
|
181 |
+
|
182 |
+
# Columna 4: Métricas Iteración
|
183 |
+
with metrics_iter_col:
|
184 |
+
if st.session_state.get('show_iter'):
|
185 |
+
display_metrics_and_suggestions(
|
186 |
+
st.session_state.iter_metrics,
|
187 |
+
text_type,
|
188 |
+
"Iteración",
|
189 |
+
show_suggestions=True
|
190 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
except Exception as e:
|
193 |
+
logger.error(f"Error en interfaz: {str(e)}")
|
194 |
+
st.error("Error al cargar la interfaz")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
|
196 |
+
#Funciones de visualización ##################################
|
197 |
|
198 |
+
def display_metrics_analysis(metrics, text_type=None):
|
199 |
"""
|
200 |
Muestra los resultados del análisis: métricas verticalmente y gráfico radar.
|
201 |
"""
|
|
|
272 |
logger.error(f"Error mostrando resultados: {str(e)}")
|
273 |
st.error("Error al mostrar los resultados")
|
274 |
|
275 |
+
def display_comparison_results(baseline_metrics, current_metrics):
|
276 |
+
"""Muestra comparación entre línea base y métricas actuales"""
|
277 |
+
|
278 |
+
# Crear columnas para métricas y gráfico
|
279 |
+
metrics_col, graph_col = st.columns([1, 1.5])
|
280 |
+
|
281 |
+
with metrics_col:
|
282 |
+
for dimension in ['vocabulary', 'structure', 'cohesion', 'clarity']:
|
283 |
+
baseline = baseline_metrics[dimension]['normalized_score']
|
284 |
+
current = current_metrics[dimension]['normalized_score']
|
285 |
+
delta = current - baseline
|
286 |
+
|
287 |
+
st.metric(
|
288 |
+
dimension.title(),
|
289 |
+
f"{current:.2f}",
|
290 |
+
f"{delta:+.2f}",
|
291 |
+
delta_color="normal" if delta >= 0 else "inverse"
|
292 |
+
)
|
293 |
+
|
294 |
+
# Sugerir herramientas de mejora
|
295 |
+
if delta < 0:
|
296 |
+
suggest_improvement_tools(dimension)
|
297 |
+
|
298 |
+
with graph_col:
|
299 |
+
display_radar_chart_comparison(
|
300 |
+
baseline_metrics,
|
301 |
+
current_metrics
|
302 |
+
)
|
303 |
|
304 |
def display_radar_chart(metrics_config, thresholds, baseline_metrics=None):
|
305 |
"""
|
|
|
398 |
logger.error(f"Error mostrando gráfico radar: {str(e)}")
|
399 |
st.error("Error al mostrar el gráfico")
|
400 |
|
401 |
+
#Funciones auxiliares ##################################
|
402 |
+
def suggest_improvement_tools(dimension):
|
403 |
+
"""Sugiere herramientas basadas en la dimensión"""
|
404 |
+
suggestions = []
|
405 |
+
for analysis, mapping in ANALYSIS_DIMENSION_MAPPING.items():
|
406 |
+
if dimension in mapping['primary']:
|
407 |
+
suggestions.extend(mapping['tools'])
|
408 |
+
|
409 |
+
st.info(f"Herramientas sugeridas para mejorar {dimension}:")
|
410 |
+
for tool in suggestions:
|
411 |
+
st.write(f"- {tool}")
|
412 |
+
|
413 |
+
def prepare_metrics_config(metrics, text_type='student_essay'):
|
414 |
+
"""
|
415 |
+
Prepara la configuración de métricas en el mismo formato que display_results.
|
416 |
+
Args:
|
417 |
+
metrics: Diccionario con las métricas analizadas
|
418 |
+
text_type: Tipo de texto para los umbrales
|
419 |
+
Returns:
|
420 |
+
list: Lista de configuraciones de métricas
|
421 |
+
"""
|
422 |
+
# Obtener umbrales según el tipo de texto
|
423 |
+
thresholds = TEXT_TYPES[text_type]['thresholds']
|
424 |
+
|
425 |
+
# Usar la misma estructura que en display_results
|
426 |
+
return [
|
427 |
+
{
|
428 |
+
'label': "Vocabulario",
|
429 |
+
'key': 'vocabulary',
|
430 |
+
'value': metrics['vocabulary']['normalized_score'],
|
431 |
+
'help': "Riqueza y variedad del vocabulario",
|
432 |
+
'thresholds': thresholds['vocabulary']
|
433 |
+
},
|
434 |
+
{
|
435 |
+
'label': "Estructura",
|
436 |
+
'key': 'structure',
|
437 |
+
'value': metrics['structure']['normalized_score'],
|
438 |
+
'help': "Organización y complejidad de oraciones",
|
439 |
+
'thresholds': thresholds['structure']
|
440 |
+
},
|
441 |
+
{
|
442 |
+
'label': "Cohesión",
|
443 |
+
'key': 'cohesion',
|
444 |
+
'value': metrics['cohesion']['normalized_score'],
|
445 |
+
'help': "Conexión y fluidez entre ideas",
|
446 |
+
'thresholds': thresholds['cohesion']
|
447 |
+
},
|
448 |
+
{
|
449 |
+
'label': "Claridad",
|
450 |
+
'key': 'clarity',
|
451 |
+
'value': metrics['clarity']['normalized_score'],
|
452 |
+
'help': "Facilidad de comprensión del texto",
|
453 |
+
'thresholds': thresholds['clarity']
|
454 |
+
}
|
455 |
+
]
|
456 |
+
|