cpnepo commited on
Commit
8b47bd2
1 Parent(s): 42dac5b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -63,5 +63,12 @@ if st.button('Accio Responsa!'):
63
  # Perform the querying
64
  QA_input = {'question': query, 'context': context}
65
  res = pipe(QA_input)
 
 
 
 
 
 
 
66
  #out = res.get('answer')
67
- st.write(res)
63
  # Perform the querying
64
  QA_input = {'question': query, 'context': context}
65
  res = pipe(QA_input)
66
+
67
+ confidence = res.get('score')
68
+ if confidence > 0.5:
69
+ st.write(res.get('answer'))
70
+ else:
71
+ out = "Sorry dear, I'm not sure"
72
+ st.write(out)
73
  #out = res.get('answer')
74
+