seonglae commited on
Commit
aed5b3a
1 Parent(s): 26e6019

feat: 2 candidate example quenstion added

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -17,7 +17,8 @@ st.header(TITLE)
17
  st.markdown('''
18
  <h5>Ask short-answer question that can be find in Wikipedia data.</h5>
19
  ''', unsafe_allow_html=True)
20
- st.markdown('This demo retrieves the original context from 21,000,000 wikipedia passages in real-time')
 
21
 
22
 
23
  @st.cache_resource
@@ -56,6 +57,11 @@ st.markdown(styl, unsafe_allow_html=True)
56
 
57
 
58
  question = st.text_input("Question", INITIAL)
 
 
 
 
 
59
 
60
 
61
  @torch.inference_mode()
@@ -78,7 +84,7 @@ def main(question: str):
78
 
79
  # Reader
80
  [summary] = summarize_text(models['summarizer'][0],
81
- models['summarizer'][1], [ctx])
82
  answers = ask_reader(models['reader'][0],
83
  models['reader'][1], [question], [summary])
84
  answer = answers[0]['answer']
 
17
  st.markdown('''
18
  <h5>Ask short-answer question that can be find in Wikipedia data.</h5>
19
  ''', unsafe_allow_html=True)
20
+ st.markdown(
21
+ 'This demo searches through 21,000,000 Wikipedia passages in real-time under the hood.')
22
 
23
 
24
  @st.cache_resource
 
57
 
58
 
59
  question = st.text_input("Question", INITIAL)
60
+ col1, col2 = st.columns(2)
61
+ if col1.button("Where is the capital of South Korea"):
62
+ question = "Where is the capital of South Korea"
63
+ if col2.button("Where is Eiffel Tower"):
64
+ question = "Where is Eiffel Tower"
65
 
66
 
67
  @torch.inference_mode()
 
84
 
85
  # Reader
86
  [summary] = summarize_text(models['summarizer'][0],
87
+ models['summarizer'][1], [ctx])
88
  answers = ask_reader(models['reader'][0],
89
  models['reader'][1], [question], [summary])
90
  answer = answers[0]['answer']