prashant
commited on
Commit
•
660a16b
1
Parent(s):
ed6cfc9
text and display fix
Browse files
appStore/keyword_search.py
CHANGED
@@ -125,9 +125,11 @@ def app():
|
|
125 |
# st.write("\t Score: {:.3f}: \t{}".format(hit['score'], paraList[hit['corpus_id']].replace("\n", " ")))
|
126 |
st.write("\t {}: {}\t".format(counter, paraList[hit['corpus_id']].replace("\n", " ")))
|
127 |
|
128 |
-
|
129 |
if counter == 0:
|
130 |
st.write("No results found for '**{}**' ".format(keyword))
|
|
|
|
|
131 |
else:
|
132 |
logging.info("starting semantic search")
|
133 |
with st.spinner("Performing Similar/Contextual search"):
|
@@ -135,9 +137,9 @@ def app():
|
|
135 |
config = configparser.ConfigParser()
|
136 |
config.read_file(open('udfPreprocess/paramconfig.cfg'))
|
137 |
threshold = float(config.get('semantic_search','THRESHOLD'))
|
138 |
-
st.write(query)
|
139 |
semantic_hits = semantic_search(query,paraList)
|
140 |
-
st.markdown("##### Semantic search hits for {} related topics #####".format(queryList))
|
141 |
|
142 |
for i,queryhit in enumerate(semantic_hits):
|
143 |
|
|
|
125 |
# st.write("\t Score: {:.3f}: \t{}".format(hit['score'], paraList[hit['corpus_id']].replace("\n", " ")))
|
126 |
st.write("\t {}: {}\t".format(counter, paraList[hit['corpus_id']].replace("\n", " ")))
|
127 |
|
128 |
+
|
129 |
if counter == 0:
|
130 |
st.write("No results found for '**{}**' ".format(keyword))
|
131 |
+
|
132 |
+
st.markdown("---")
|
133 |
else:
|
134 |
logging.info("starting semantic search")
|
135 |
with st.spinner("Performing Similar/Contextual search"):
|
|
|
137 |
config = configparser.ConfigParser()
|
138 |
config.read_file(open('udfPreprocess/paramconfig.cfg'))
|
139 |
threshold = float(config.get('semantic_search','THRESHOLD'))
|
140 |
+
# st.write(query)
|
141 |
semantic_hits = semantic_search(query,paraList)
|
142 |
+
st.markdown("##### Few Semantic search hits for {} related topics #####".format(queryList))
|
143 |
|
144 |
for i,queryhit in enumerate(semantic_hits):
|
145 |
|