|
|
|
|
|
import streamlit as st |
|
from .database import get_student_data |
|
from .morpho_analysis import get_repeated_words_colors, highlight_repeated_words, POS_COLORS, POS_TRANSLATIONS |
|
from .syntax_analysis import visualize_syntax |
|
|
|
def display_chat_interface(): |
|
st.markdown("### Chat con AIdeaText") |
|
|
|
|
|
if 'chat_history' not in st.session_state: |
|
st.session_state.chat_history = [] |
|
|
|
|
|
for i, (role, text) in enumerate(st.session_state.chat_history): |
|
if role == "user": |
|
st.text_area(f"Tú:", value=text, height=50, key=f"user_message_{i}", disabled=True) |
|
else: |
|
st.text_area(f"AIdeaText:", value=text, height=50, key=f"bot_message_{i}", disabled=True) |
|
|
|
|
|
user_input = st.text_input("Escribe tu mensaje aquí:") |
|
|
|
if st.button("Enviar"): |
|
if user_input: |
|
|
|
st.session_state.chat_history.append(("user", user_input)) |
|
|
|
|
|
response = get_chatbot_response(user_input) |
|
|
|
|
|
st.session_state.chat_history.append(("bot", response)) |
|
|
|
|
|
st.experimental_rerun() |
|
|
|
def display_student_progress(student_data): |
|
st.success("Datos obtenidos exitosamente") |
|
|
|
|
|
st.subheader("Estadísticas generales") |
|
st.write(f"Total de entradas: {student_data['entries_count']}") |
|
|
|
|
|
st.subheader("Conteo de palabras por categoría") |
|
st.bar_chart(student_data['word_count']) |
|
|
|
|
|
st.subheader("Entradas recientes") |
|
for entry in student_data['entries'][:5]: |
|
st.text_area(f"Entrada del {entry['timestamp']}", entry['text'], height=100) |
|
|
|
def display_text_analysis_interface(nlp_models, lang_code): |
|
|
|
|
|
|
|
|