Update modules/semantic/semantic_live_interface.py
Browse files
modules/semantic/semantic_live_interface.py
CHANGED
|
@@ -71,6 +71,7 @@ def display_semantic_live_interface(lang_code, nlp_models, semantic_t):
|
|
| 71 |
# 4. Procesar an谩lisis cuando se presiona el bot贸n
|
| 72 |
if analyze_button and text_input:
|
| 73 |
st.session_state.semantic_live_state['pending_analysis'] = True
|
|
|
|
| 74 |
st.rerun()
|
| 75 |
|
| 76 |
# 5. Manejar an谩lisis pendiente
|
|
@@ -196,8 +197,8 @@ def display_semantic_live_interface(lang_code, nlp_models, semantic_t):
|
|
| 196 |
if st.button("馃挰 Consultar con Asistente",
|
| 197 |
key="semantic_live_chat_button",
|
| 198 |
use_container_width=True):
|
| 199 |
-
if 'last_result'
|
| 200 |
-
st.
|
| 201 |
else:
|
| 202 |
st.session_state.semantic_agent_data = {
|
| 203 |
'text': st.session_state.semantic_live_state['current_text'],
|
|
@@ -208,13 +209,14 @@ def display_semantic_live_interface(lang_code, nlp_models, semantic_t):
|
|
| 208 |
st.rerun()
|
| 209 |
|
| 210 |
# Bot贸n de descarga
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
|
|
|
| 218 |
|
| 219 |
# Notificaci贸n si el agente est谩 activo
|
| 220 |
if st.session_state.get('semantic_agent_active', False):
|
|
|
|
| 71 |
# 4. Procesar an谩lisis cuando se presiona el bot贸n
|
| 72 |
if analyze_button and text_input:
|
| 73 |
st.session_state.semantic_live_state['pending_analysis'] = True
|
| 74 |
+
st.session_state.semantic_live_state['current_text'] = text_input # Guardar texto actual
|
| 75 |
st.rerun()
|
| 76 |
|
| 77 |
# 5. Manejar an谩lisis pendiente
|
|
|
|
| 197 |
if st.button("馃挰 Consultar con Asistente",
|
| 198 |
key="semantic_live_chat_button",
|
| 199 |
use_container_width=True):
|
| 200 |
+
if 'last_result' in st.session_state.semantic_live_state and \
|
| 201 |
+
st.session_state.semantic_live_state['last_result'] is not None:
|
| 202 |
else:
|
| 203 |
st.session_state.semantic_agent_data = {
|
| 204 |
'text': st.session_state.semantic_live_state['current_text'],
|
|
|
|
| 209 |
st.rerun()
|
| 210 |
|
| 211 |
# Bot贸n de descarga
|
| 212 |
+
if 'concept_graph' in analysis: # Verificar existencia
|
| 213 |
+
st.download_button(
|
| 214 |
+
label="馃摜 " + semantic_t.get('download_graph', "Descargar"),
|
| 215 |
+
data=analysis['concept_graph'],
|
| 216 |
+
file_name="semantic_live_graph.png",
|
| 217 |
+
mime="image/png",
|
| 218 |
+
use_container_width=True
|
| 219 |
+
)
|
| 220 |
|
| 221 |
# Notificaci贸n si el agente est谩 activo
|
| 222 |
if st.session_state.get('semantic_agent_active', False):
|