HarryLee commited on
Commit
18083b8
·
1 Parent(s): 5b680fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -69,6 +69,7 @@ from sklearn.feature_extraction import _stop_words
69
  import string
70
  from tqdm.autonotebook import tqdm
71
  import numpy as np
 
72
 
73
 
74
  # We lower case our text and remove stop-words from indexing
@@ -152,7 +153,12 @@ def search(query):
152
  # Total Results
153
  total_qe.append(qe_string)
154
  st.write("E-Commerce Query Expansion Results: \n")
155
- st.write(total_qe)
 
 
 
 
 
156
 
157
  st.write("## Results:")
158
  if st.button('Generated Expansion'):
 
69
  import string
70
  from tqdm.autonotebook import tqdm
71
  import numpy as np
72
+ import re
73
 
74
 
75
  # We lower case our text and remove stop-words from indexing
 
153
  # Total Results
154
  total_qe.append(qe_string)
155
  st.write("E-Commerce Query Expansion Results: \n")
156
+
157
+ for sub_list in total_qe:
158
+ for i in sub_list:
159
+ rs = re.sub("([^\u0030-\u0039\u0041-\u007a])", ' ', i)
160
+ rs_final = re.sub("\x20\x20", "\n", rs)
161
+ st.write(rs_final.strip())
162
 
163
  st.write("## Results:")
164
  if st.button('Generated Expansion'):