Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,9 @@ st.write(
|
|
20 |
st.text_input("Type your question here", key="userquery")
|
21 |
|
22 |
|
23 |
-
model = SentenceTransformer("all-MiniLM-L6-v2")
|
24 |
|
25 |
-
|
26 |
|
27 |
|
28 |
listofCachedItems = ["what was the revenue for FIFA 23", "what was the revenue for ApexLegends", "What was the revenue for FIFA 23 in Aug 2023", "What was the revenue for ApexLegends in Aug 2023"]
|
@@ -54,12 +54,15 @@ numericscore = numericscore[0]
|
|
54 |
|
55 |
listofanswer = []
|
56 |
|
57 |
-
|
|
|
|
|
58 |
# print(bestmatch)
|
59 |
# print(maxscore)
|
60 |
listofanswer.append(bestmatch)
|
61 |
-
|
|
|
62 |
else:
|
63 |
-
st.write("
|
64 |
|
65 |
|
|
|
20 |
st.text_input("Type your question here", key="userquery")
|
21 |
|
22 |
|
23 |
+
#model = SentenceTransformer("all-MiniLM-L6-v2")
|
24 |
|
25 |
+
model = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')
|
26 |
|
27 |
|
28 |
listofCachedItems = ["what was the revenue for FIFA 23", "what was the revenue for ApexLegends", "What was the revenue for FIFA 23 in Aug 2023", "What was the revenue for ApexLegends in Aug 2023"]
|
|
|
54 |
|
55 |
listofanswer = []
|
56 |
|
57 |
+
|
58 |
+
|
59 |
+
if numericscore > 0.95:
|
60 |
# print(bestmatch)
|
61 |
# print(maxscore)
|
62 |
listofanswer.append(bestmatch)
|
63 |
+
st.write("Found a similar question that is already precomputed")
|
64 |
+
option = st.selectbox( 'We identified something similar. Try this?', listofanswer)
|
65 |
else:
|
66 |
+
st.write("That is a new question. There is no similar questions that is cached")
|
67 |
|
68 |
|