mariavhrh commited on
Commit
e7a869b
1 Parent(s): 669db7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -4,6 +4,7 @@ from bokeh .models import CustomJS #line:3:from bokeh.models import CustomJS
4
  from streamlit_bokeh_events import streamlit_bokeh_events #line:4:from streamlit_bokeh_events import streamlit_bokeh_events
5
  import pandas as pd #line:6:import pandas as pd
6
  import numpy as np #line:7:import numpy as np
 
7
  from nltk .stem import SnowballStemmer #line:8:from nltk.stem import SnowballStemmer
8
  from inflector import Inflector ,English ,Spanish #line:9:from inflector import Inflector, English, Spanish
9
  inflector =Inflector (Spanish )#line:10:inflector = Inflector(Spanish)
@@ -161,6 +162,9 @@ if query !="none":#line:86:if query!="salir":
161
  indexmax =np .argwhere (count_words ==np .amax (count_words ))#line:219:indexmax = np.argwhere(count_words == np.amax(count_words))
162
  all_zeros =not np .any (indexmax )#line:220:all_zeros = not np.any(indexmax)
163
  #st .text (count_words )#line:222:st.text(count_words)
 
 
 
164
  if not np .all (count_words ==0 ):#line:224:if not np.all(count_words==0):
165
  for indexin in indexmax :#line:226:for indexin in indexmax:
166
 
@@ -168,7 +172,7 @@ if query !="none":#line:86:if query!="salir":
168
  #st .text (count_words [indexin ])#line:229:st.text(count_words[indexin])
169
 
170
  st .text ("Si has preguntado...\n")#line:230:st.text("Si has preguntado...\n")
171
- st .text (df .iloc [indexin ,2])#line:231:st.text(df.iloc[indexin,2])
172
  st .text ("La respuesta es...\n")#line:232:st.text("La respuesta es...\n")
173
- st .text (df .iloc [indexin ,3])#line:233:st.text(df.iloc[indexin,3])
174
  print ("GRACIAS!")
 
4
  from streamlit_bokeh_events import streamlit_bokeh_events #line:4:from streamlit_bokeh_events import streamlit_bokeh_events
5
  import pandas as pd #line:6:import pandas as pd
6
  import numpy as np #line:7:import numpy as np
7
+ import xlrd
8
  from nltk .stem import SnowballStemmer #line:8:from nltk.stem import SnowballStemmer
9
  from inflector import Inflector ,English ,Spanish #line:9:from inflector import Inflector, English, Spanish
10
  inflector =Inflector (Spanish )#line:10:inflector = Inflector(Spanish)
 
162
  indexmax =np .argwhere (count_words ==np .amax (count_words ))#line:219:indexmax = np.argwhere(count_words == np.amax(count_words))
163
  all_zeros =not np .any (indexmax )#line:220:all_zeros = not np.any(indexmax)
164
  #st .text (count_words )#line:222:st.text(count_words)
165
+
166
+ df = xlrd.open_workbook('preguntas_qh_tags2.xlsx')
167
+ df = df.sheet_by_index(0)
168
  if not np .all (count_words ==0 ):#line:224:if not np.all(count_words==0):
169
  for indexin in indexmax :#line:226:for indexin in indexmax:
170
 
 
172
  #st .text (count_words [indexin ])#line:229:st.text(count_words[indexin])
173
 
174
  st .text ("Si has preguntado...\n")#line:230:st.text("Si has preguntado...\n")
175
+ st .text (df.cell(int(indexin)+1,2))#line:231:st.text(df.iloc[indexin,2])
176
  st .text ("La respuesta es...\n")#line:232:st.text("La respuesta es...\n")
177
+ st .text (df.cell(int(indexin)+1,3))#line:233:st.text(df.iloc[indexin,3])
178
  print ("GRACIAS!")