AIdeaText commited on
Commit
b787e4e
·
verified ·
1 Parent(s): ed40f09

Update modules/studentact/current_situation_interface.py

Browse files
modules/studentact/current_situation_interface.py CHANGED
@@ -276,28 +276,28 @@ def display_diagnosis(metrics, text_type=None, lang_code='es', t=None):
276
  with metrics_col:
277
  metrics_config = [
278
  {
279
- 'label': t.get('vocabulary_label', "Vocabulario"),
280
  'key': 'vocabulary',
281
  'value': metrics['vocabulary']['normalized_score'],
282
  'help': t.get('vocabulary_help', "Riqueza y variedad del vocabulario"),
283
  'thresholds': thresholds['vocabulary']
284
  },
285
  {
286
- 'label': t.get('structure_label', "Estructura"),
287
  'key': 'structure',
288
  'value': metrics['structure']['normalized_score'],
289
  'help': t.get('structure_help', "Organización y complejidad de oraciones"),
290
  'thresholds': thresholds['structure']
291
  },
292
  {
293
- 'label': t.get('cohesion_label', "Cohesión"),
294
  'key': 'cohesion',
295
  'value': metrics['cohesion']['normalized_score'],
296
  'help': t.get('cohesion_help', "Conexión y fluidez entre ideas"),
297
  'thresholds': thresholds['cohesion']
298
  },
299
  {
300
- 'label': t.get('clarity_label', "Claridad"),
301
  'key': 'clarity',
302
  'value': metrics['clarity']['normalized_score'],
303
  'help': t.get('clarity_help', "Facilidad de comprensión del texto"),
@@ -309,16 +309,16 @@ def display_diagnosis(metrics, text_type=None, lang_code='es', t=None):
309
  for metric in metrics_config:
310
  value = metric['value']
311
  if value < metric['thresholds']['min']:
312
- status = t.get('metric_improvement', "⚠️ Por mejorar")
313
  color = "inverse"
314
  elif value < metric['thresholds']['target']:
315
- status = t.get('metric_acceptable', "📈 Aceptable")
316
  color = "off"
317
  else:
318
- status = t.get('metric_optimal', "✅ Óptimo")
319
  color = "normal"
320
 
321
- target_text = t.get('metric_target', "Meta: {:.2f}").format(metric['thresholds']['target'])
322
 
323
  st.metric(
324
  metric['label'],
 
276
  with metrics_col:
277
  metrics_config = [
278
  {
279
+ 'label': labels['vocabulary'],
280
  'key': 'vocabulary',
281
  'value': metrics['vocabulary']['normalized_score'],
282
  'help': t.get('vocabulary_help', "Riqueza y variedad del vocabulario"),
283
  'thresholds': thresholds['vocabulary']
284
  },
285
  {
286
+ 'label': labels['structure'],
287
  'key': 'structure',
288
  'value': metrics['structure']['normalized_score'],
289
  'help': t.get('structure_help', "Organización y complejidad de oraciones"),
290
  'thresholds': thresholds['structure']
291
  },
292
  {
293
+ 'label': labels['cohesion'],
294
  'key': 'cohesion',
295
  'value': metrics['cohesion']['normalized_score'],
296
  'help': t.get('cohesion_help', "Conexión y fluidez entre ideas"),
297
  'thresholds': thresholds['cohesion']
298
  },
299
  {
300
+ 'label': labels['clarity'],
301
  'key': 'clarity',
302
  'value': metrics['clarity']['normalized_score'],
303
  'help': t.get('clarity_help', "Facilidad de comprensión del texto"),
 
309
  for metric in metrics_config:
310
  value = metric['value']
311
  if value < metric['thresholds']['min']:
312
+ status = labels['improvement']
313
  color = "inverse"
314
  elif value < metric['thresholds']['target']:
315
+ status = labels['acceptable']
316
  color = "off"
317
  else:
318
+ status = labels['optimal']
319
  color = "normal"
320
 
321
+ target_text = labels['target'].format(metric['thresholds']['target'])
322
 
323
  st.metric(
324
  metric['label'],