Spaces:
Running
Running
Update modules/semantic/semantic_interface.py
Browse files
modules/semantic/semantic_interface.py
CHANGED
@@ -137,23 +137,18 @@ def display_semantic_interface(lang_code, nlp_models, semantic_t):
|
|
137 |
)
|
138 |
|
139 |
# --- BOT脫N PARA ACTIVAR EL AGENTE VIRTUAL (NUEVA POSICI脫N CORRECTA) ---
|
140 |
-
if st.button(
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
# Obtener el texto analizado
|
148 |
-
text_content = st.session_state.semantic_state.get('text_content', "")
|
149 |
-
|
150 |
-
st.session_state.semantic_agent_active = True
|
151 |
st.session_state.semantic_agent_data = {
|
152 |
-
'text': text_content,
|
153 |
-
'metrics': st.session_state.semantic_result['analysis'],
|
154 |
'graph_data': st.session_state.semantic_result['analysis'].get('concept_graph')
|
155 |
}
|
156 |
-
st.
|
157 |
st.rerun()
|
158 |
|
159 |
# Mostrar notificaci贸n si el agente est谩 activo
|
|
|
137 |
)
|
138 |
|
139 |
# --- BOT脫N PARA ACTIVAR EL AGENTE VIRTUAL (NUEVA POSICI脫N CORRECTA) ---
|
140 |
+
if st.button("馃挰 Consultar con Asistente"):
|
141 |
+
if 'semantic_result' not in st.session_state:
|
142 |
+
st.error("Primero complete el an谩lisis sem谩ntico")
|
143 |
+
return
|
144 |
+
|
145 |
+
# Guardar TODOS los datos necesarios
|
|
|
|
|
|
|
|
|
|
|
146 |
st.session_state.semantic_agent_data = {
|
147 |
+
'text': st.session_state.semantic_state['text_content'], # Texto completo
|
148 |
+
'metrics': st.session_state.semantic_result['analysis'], # M茅tricas
|
149 |
'graph_data': st.session_state.semantic_result['analysis'].get('concept_graph')
|
150 |
}
|
151 |
+
st.session_state.semantic_agent_active = True
|
152 |
st.rerun()
|
153 |
|
154 |
# Mostrar notificaci贸n si el agente est谩 activo
|