Update modules/ui.py
Browse files- modules/ui.py +25 -25
modules/ui.py
CHANGED
@@ -207,7 +207,7 @@ def display_student_progress(username, lang_code='es'):
|
|
207 |
df = df.sort_values('count', ascending=False)
|
208 |
|
209 |
fig, ax = plt.subplots(figsize=(12, 6))
|
210 |
-
bars = ax.bar(df['label'], df['count'], color=[
|
211 |
|
212 |
ax.set_xlabel('Categoría Gramatical')
|
213 |
ax.set_ylabel('Cantidad de Palabras')
|
@@ -224,38 +224,38 @@ def display_student_progress(username, lang_code='es'):
|
|
224 |
# Mostrar análisis morfosintáctico
|
225 |
with st.expander("Análisis Morfosintáctico - Diagramas de Arco", expanded=False):
|
226 |
for i, entry in enumerate(student_data['entries']):
|
227 |
-
if
|
228 |
st.subheader(f"Análisis {i+1} - {entry['timestamp']}")
|
229 |
-
st.write(entry['
|
|
|
|
|
|
|
230 |
|
231 |
-
# Mostrar análisis semántico
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
st.subheader(f"Análisis {i+1} - {entry['timestamp']}")
|
236 |
-
|
|
|
237 |
image_bytes = base64.b64decode(entry['network_diagram'])
|
238 |
st.image(image_bytes)
|
239 |
-
except Exception as e:
|
240 |
-
st.error(f"Error al mostrar el diagrama de red: {str(e)}")
|
241 |
|
242 |
-
# Mostrar análisis del discurso
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
st.subheader(f"Análisis {i+1} - {entry['timestamp']}")
|
247 |
-
|
|
|
|
|
|
|
|
|
248 |
image_bytes = base64.b64decode(entry['combined_graph'])
|
249 |
st.image(image_bytes)
|
250 |
-
st.write("Texto del documento patrón:")
|
251 |
-
st.write(entry['text1'])
|
252 |
-
st.write("Texto del documento comparado:")
|
253 |
-
st.write(entry['text2'])
|
254 |
-
except Exception as e:
|
255 |
-
st.error(f"Error al mostrar el gráfico combinado: {str(e)}")
|
256 |
|
257 |
-
# Mostrar conversaciones del chat
|
258 |
-
if 'chat_history' in student_data
|
259 |
with st.expander("Historial de Conversaciones del Chat", expanded=False):
|
260 |
for i, chat in enumerate(student_data['chat_history']):
|
261 |
st.subheader(f"Conversación {i+1} - {chat['timestamp']}")
|
|
|
207 |
df = df.sort_values('count', ascending=False)
|
208 |
|
209 |
fig, ax = plt.subplots(figsize=(12, 6))
|
210 |
+
bars = ax.bar(df['label'], df['count'], color=[x for x in df['category']]) # Usar los colores directamente
|
211 |
|
212 |
ax.set_xlabel('Categoría Gramatical')
|
213 |
ax.set_ylabel('Cantidad de Palabras')
|
|
|
224 |
# Mostrar análisis morfosintáctico
|
225 |
with st.expander("Análisis Morfosintáctico - Diagramas de Arco", expanded=False):
|
226 |
for i, entry in enumerate(student_data['entries']):
|
227 |
+
if 'arc_diagrams' in entry:
|
228 |
st.subheader(f"Análisis {i+1} - {entry['timestamp']}")
|
229 |
+
st.write(entry['text']) # Mostrar el texto analizado
|
230 |
+
for j, diagram in enumerate(entry['arc_diagrams']):
|
231 |
+
st.subheader(f"Diagrama de Arco {j+1}")
|
232 |
+
st.write(diagram, unsafe_allow_html=True)
|
233 |
|
234 |
+
# Mostrar análisis semántico (si existe)
|
235 |
+
if 'semantic_analyses' in student_data:
|
236 |
+
with st.expander("Análisis Semántico - Diagramas de Red", expanded=False):
|
237 |
+
for i, entry in enumerate(student_data['semantic_analyses']):
|
238 |
+
st.subheader(f"Análisis Semántico {i+1} - {entry['timestamp']}")
|
239 |
+
st.write(entry['text']) # Mostrar el texto analizado
|
240 |
+
if 'network_diagram' in entry:
|
241 |
image_bytes = base64.b64decode(entry['network_diagram'])
|
242 |
st.image(image_bytes)
|
|
|
|
|
243 |
|
244 |
+
# Mostrar análisis del discurso (si existe)
|
245 |
+
if 'discourse_analyses' in student_data:
|
246 |
+
with st.expander("Análisis del Discurso - Comparación de Grafos", expanded=False):
|
247 |
+
for i, entry in enumerate(student_data['discourse_analyses']):
|
248 |
+
st.subheader(f"Análisis del Discurso {i+1} - {entry['timestamp']}")
|
249 |
+
st.write("Texto del documento patrón:")
|
250 |
+
st.write(entry['text1'])
|
251 |
+
st.write("Texto del documento comparado:")
|
252 |
+
st.write(entry['text2'])
|
253 |
+
if 'combined_graph' in entry:
|
254 |
image_bytes = base64.b64decode(entry['combined_graph'])
|
255 |
st.image(image_bytes)
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
|
257 |
+
# Mostrar conversaciones del chat (si existe)
|
258 |
+
if 'chat_history' in student_data:
|
259 |
with st.expander("Historial de Conversaciones del Chat", expanded=False):
|
260 |
for i, chat in enumerate(student_data['chat_history']):
|
261 |
st.subheader(f"Conversación {i+1} - {chat['timestamp']}")
|