vasevooo commited on
Commit
42f7412
·
1 Parent(s): 67eae9c

Update pages/answers.py

Browse files
Files changed (1) hide show
  1. pages/answers.py +7 -7
pages/answers.py CHANGED
@@ -61,24 +61,24 @@ def get_answer(context, question):
61
  def main():
62
  st.title("Question Answering App :robot_face:")
63
  st.divider()
64
- st.markdown("### **Enter the context and question, then click on ':blue_button:Get Answer' to retrieve the answer:**")
65
 
66
- context = st.text_area("**:blue_button:Context**", "Enter the context here...")
67
- question = st.text_input("**:blue_button:Question**", "Enter the question here...")
68
 
69
- if st.button(":blue_button:Get Answer"):
70
  if context.strip() == "" or question.strip() == "":
71
  st.warning("Please enter the context and question.")
72
  else:
73
  answer = get_answer(context, question)
74
  st.success(f"Answer: {answer}")
75
 
76
- if st.button(":blue_button:Random Example"):
77
  pair = random.choice(pairs)
78
  context = pair['context']
79
  question = pair['question']
80
- st.text_area("**:blue_button:Context**", value=context)
81
- st.text_input("**:blue_button:Question**", value=question)
82
 
83
 
84
  if __name__ == "__main__":
 
61
  def main():
62
  st.title("Question Answering App :robot_face:")
63
  st.divider()
64
+ st.markdown("### **Enter the context and question, then click on ':blue[Get Answer]' to retrieve the answer:**")
65
 
66
+ context = st.text_area("**:blue[Context]**", "Enter the context here...")
67
+ question = st.text_input("**:blue[Question]**", "Enter the question here...")
68
 
69
+ if st.button(":blue[**Get Answer**]"):
70
  if context.strip() == "" or question.strip() == "":
71
  st.warning("Please enter the context and question.")
72
  else:
73
  answer = get_answer(context, question)
74
  st.success(f"Answer: {answer}")
75
 
76
+ if st.button(":blue[**Random Example**]"):
77
  pair = random.choice(pairs)
78
  context = pair['context']
79
  question = pair['question']
80
+ st.text_area(":blue[**Context**]", value=context)
81
+ st.text_input(":blue[**Question**]", value=question)
82
 
83
 
84
  if __name__ == "__main__":