AIdeaText commited on
Commit
44be370
·
verified ·
1 Parent(s): f3bca54

Update modules/ui/ui.py

Browse files
Files changed (1) hide show
  1. modules/ui/ui.py +13 -8
modules/ui/ui.py CHANGED
@@ -986,6 +986,9 @@ def display_discourse_analysis_interface(nlp_models, lang_code):
986
  st.info(t['initial_message']) # Asegúrate de que 'initial_message' esté en tus traducciones
987
 
988
  #################################################
 
 
 
989
  def display_discourse_results(result, lang_code, t):
990
  if result is None:
991
  st.warning(t.get('no_results', "No hay resultados disponibles."))
@@ -995,10 +998,6 @@ def display_discourse_results(result, lang_code, t):
995
 
996
  with col1:
997
  with st.expander(t.get('file_uploader1', "Documento 1"), expanded=True):
998
- if 'graph1' in result:
999
- st.pyplot(result['graph1'])
1000
- else:
1001
- st.warning(t.get('graph_not_available', "El gráfico no está disponible."))
1002
  st.subheader(t.get('key_concepts', "Conceptos Clave"))
1003
  if 'key_concepts1' in result:
1004
  df1 = pd.DataFrame(result['key_concepts1'], columns=['Concepto', 'Frecuencia'])
@@ -1006,13 +1005,14 @@ def display_discourse_results(result, lang_code, t):
1006
  st.table(df1)
1007
  else:
1008
  st.warning(t.get('concepts_not_available', "Los conceptos clave no están disponibles."))
 
 
 
 
 
1009
 
1010
  with col2:
1011
  with st.expander(t.get('file_uploader2', "Documento 2"), expanded=True):
1012
- if 'graph2' in result:
1013
- st.pyplot(result['graph2'])
1014
- else:
1015
- st.warning(t.get('graph_not_available', "El gráfico no está disponible."))
1016
  st.subheader(t.get('key_concepts', "Conceptos Clave"))
1017
  if 'key_concepts2' in result:
1018
  df2 = pd.DataFrame(result['key_concepts2'], columns=['Concepto', 'Frecuencia'])
@@ -1020,6 +1020,11 @@ def display_discourse_results(result, lang_code, t):
1020
  st.table(df2)
1021
  else:
1022
  st.warning(t.get('concepts_not_available', "Los conceptos clave no están disponibles."))
 
 
 
 
 
1023
 
1024
  # Relación de conceptos entre ambos documentos (Diagrama de Sankey)
1025
  st.subheader(t.get('comparison', "Relación de conceptos entre ambos documentos"))
 
986
  st.info(t['initial_message']) # Asegúrate de que 'initial_message' esté en tus traducciones
987
 
988
  #################################################
989
+ import plotly.graph_objects as go
990
+ import random
991
+
992
  def display_discourse_results(result, lang_code, t):
993
  if result is None:
994
  st.warning(t.get('no_results', "No hay resultados disponibles."))
 
998
 
999
  with col1:
1000
  with st.expander(t.get('file_uploader1', "Documento 1"), expanded=True):
 
 
 
 
1001
  st.subheader(t.get('key_concepts', "Conceptos Clave"))
1002
  if 'key_concepts1' in result:
1003
  df1 = pd.DataFrame(result['key_concepts1'], columns=['Concepto', 'Frecuencia'])
 
1005
  st.table(df1)
1006
  else:
1007
  st.warning(t.get('concepts_not_available', "Los conceptos clave no están disponibles."))
1008
+
1009
+ if 'graph1' in result:
1010
+ st.pyplot(result['graph1'])
1011
+ else:
1012
+ st.warning(t.get('graph_not_available', "El gráfico no está disponible."))
1013
 
1014
  with col2:
1015
  with st.expander(t.get('file_uploader2', "Documento 2"), expanded=True):
 
 
 
 
1016
  st.subheader(t.get('key_concepts', "Conceptos Clave"))
1017
  if 'key_concepts2' in result:
1018
  df2 = pd.DataFrame(result['key_concepts2'], columns=['Concepto', 'Frecuencia'])
 
1020
  st.table(df2)
1021
  else:
1022
  st.warning(t.get('concepts_not_available', "Los conceptos clave no están disponibles."))
1023
+
1024
+ if 'graph2' in result:
1025
+ st.pyplot(result['graph2'])
1026
+ else:
1027
+ st.warning(t.get('graph_not_available', "El gráfico no está disponible."))
1028
 
1029
  # Relación de conceptos entre ambos documentos (Diagrama de Sankey)
1030
  st.subheader(t.get('comparison', "Relación de conceptos entre ambos documentos"))