Rajagopal commited on
Commit
e476748
1 Parent(s): 83d7e80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
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
- #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,12 +54,15 @@ numericscore = numericscore[0]
54
 
55
  listofanswer = []
56
 
57
- if numericscore > 0.45:
 
 
58
  # print(bestmatch)
59
  # print(maxscore)
60
  listofanswer.append(bestmatch)
61
- option = st.selectbox( 'We identified something similar. Try this?', listofanswer)
 
62
  else:
63
- st.write("No matches")
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