Update modules/ui/user_page.py
Browse files- modules/ui/user_page.py +19 -12
modules/ui/user_page.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
import logging
|
3 |
from datetime import datetime, timezone
|
@@ -10,6 +12,7 @@ logger = logging.getLogger(__name__)
|
|
10 |
#Importaciones locales.
|
11 |
|
12 |
from ..utils.widget_utils import generate_unique_key
|
|
|
13 |
from session_state import initialize_session_state, logout
|
14 |
|
15 |
from translations import get_translations
|
@@ -21,9 +24,11 @@ from ..admin.admin_ui import admin_page
|
|
21 |
from ..chatbot import display_sidebar_chat
|
22 |
|
23 |
# Students activities
|
|
|
24 |
from ..studentact.student_activities_v2 import display_student_activities
|
25 |
-
|
26 |
-
from ..studentact.
|
|
|
27 |
|
28 |
|
29 |
##Importaciones desde la configuraci贸n de bases datos #######
|
@@ -63,7 +68,7 @@ from ..database.semantic_mongo_db import (
|
|
63 |
get_student_semantic_data
|
64 |
)
|
65 |
|
66 |
-
|
67 |
|
68 |
from ..database.chat_mongo_db import store_chat_history, get_chat_history
|
69 |
|
@@ -192,8 +197,8 @@ def user_page(lang_code, t):
|
|
192 |
|
193 |
# Sistema de tabs
|
194 |
tab_names = [
|
195 |
-
t.get('semantic_live_tab', 'An谩lisis Sem谩ntico
|
196 |
-
t.get('semantic_tab', 'An谩lisis Sem谩ntico
|
197 |
t.get('discourse_tab', 'An谩lisis comparado de textos'),
|
198 |
t.get('activities_tab', 'Registro de mis actividades'),
|
199 |
t.get('feedback_tab', 'Formulario de Comentarios')
|
@@ -215,17 +220,17 @@ def user_page(lang_code, t):
|
|
215 |
if can_switch:
|
216 |
st.session_state.selected_tab = index
|
217 |
|
218 |
-
if index == 0: # Sem谩ntico
|
219 |
st.session_state.tab_states['semantic_live_active'] = True
|
220 |
-
|
221 |
st.session_state.lang_code,
|
222 |
st.session_state.nlp_models,
|
223 |
-
t
|
224 |
)
|
225 |
-
|
226 |
-
elif index == 1: # Sem谩ntico
|
227 |
st.session_state.tab_states['semantic_active'] = True
|
228 |
-
|
229 |
st.session_state.lang_code,
|
230 |
st.session_state.nlp_models,
|
231 |
t # Pasamos todo el diccionario de traducciones
|
@@ -296,6 +301,8 @@ def get_state_key_for_index(index):
|
|
296 |
}
|
297 |
return state_map.get(index)
|
298 |
|
|
|
|
|
299 |
def display_feedback_form(lang_code, t):
|
300 |
"""
|
301 |
Muestra el formulario de retroalimentaci贸n
|
@@ -312,7 +319,7 @@ def display_feedback_form(lang_code, t):
|
|
312 |
if not feedback_t:
|
313 |
feedback_t = t
|
314 |
|
315 |
-
#st.header(feedback_t.get('feedback_title', 'Formulario de Opini贸n'))
|
316 |
|
317 |
name = st.text_input(feedback_t.get('name', 'Nombre'))
|
318 |
email = st.text_input(feedback_t.get('email', 'Correo electr贸nico'))
|
|
|
1 |
+
# modules/ui/user_page.py
|
2 |
+
|
3 |
import streamlit as st
|
4 |
import logging
|
5 |
from datetime import datetime, timezone
|
|
|
12 |
#Importaciones locales.
|
13 |
|
14 |
from ..utils.widget_utils import generate_unique_key
|
15 |
+
|
16 |
from session_state import initialize_session_state, logout
|
17 |
|
18 |
from translations import get_translations
|
|
|
24 |
from ..chatbot import display_sidebar_chat
|
25 |
|
26 |
# Students activities
|
27 |
+
|
28 |
from ..studentact.student_activities_v2 import display_student_activities
|
29 |
+
|
30 |
+
#from ..studentact.current_situation_interface import display_current_situation_interface
|
31 |
+
#from ..studentact.current_situation_analysis import analyze_text_dimensions
|
32 |
|
33 |
|
34 |
##Importaciones desde la configuraci贸n de bases datos #######
|
|
|
68 |
get_student_semantic_data
|
69 |
)
|
70 |
|
71 |
+
from ..database.semantic_mongo_live_db import get_student_semantic_live_analysis
|
72 |
|
73 |
from ..database.chat_mongo_db import store_chat_history, get_chat_history
|
74 |
|
|
|
197 |
|
198 |
# Sistema de tabs
|
199 |
tab_names = [
|
200 |
+
t.get('semantic_live_tab', 'An谩lisis Sem谩ntico (Texto Directo)'),
|
201 |
+
t.get('semantic_tab', 'An谩lisis Sem谩ntico'),
|
202 |
t.get('discourse_tab', 'An谩lisis comparado de textos'),
|
203 |
t.get('activities_tab', 'Registro de mis actividades'),
|
204 |
t.get('feedback_tab', 'Formulario de Comentarios')
|
|
|
220 |
if can_switch:
|
221 |
st.session_state.selected_tab = index
|
222 |
|
223 |
+
if index == 0: # Sem谩ntico Live
|
224 |
st.session_state.tab_states['semantic_live_active'] = True
|
225 |
+
display_semantic_live_interface(
|
226 |
st.session_state.lang_code,
|
227 |
st.session_state.nlp_models,
|
228 |
+
t
|
229 |
)
|
230 |
+
|
231 |
+
elif index == 1: # Sem谩ntico
|
232 |
st.session_state.tab_states['semantic_active'] = True
|
233 |
+
display_semantic_interface(
|
234 |
st.session_state.lang_code,
|
235 |
st.session_state.nlp_models,
|
236 |
t # Pasamos todo el diccionario de traducciones
|
|
|
301 |
}
|
302 |
return state_map.get(index)
|
303 |
|
304 |
+
###################################
|
305 |
+
######################################################################
|
306 |
def display_feedback_form(lang_code, t):
|
307 |
"""
|
308 |
Muestra el formulario de retroalimentaci贸n
|
|
|
319 |
if not feedback_t:
|
320 |
feedback_t = t
|
321 |
|
322 |
+
#st.header(feedback_t.get('feedback_title', 'Formulario de Opini贸n'))
|
323 |
|
324 |
name = st.text_input(feedback_t.get('name', 'Nombre'))
|
325 |
email = st.text_input(feedback_t.get('email', 'Correo electr贸nico'))
|