ivyblossom commited on
Commit
75c6f14
·
1 Parent(s): c7c4e48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -37,11 +37,13 @@ def main():
37
  # Perform question-answering in batches
38
  answers = question_answering(questions, pdf_text)
39
 
40
- st.write("Questions and Answers:")
 
41
  for i, (question, answer) in enumerate(zip(questions, answers)):
42
- st.write(f"Question {i + 1}: '{question}'")
43
- st.write("Answer:", answer['answer'])
44
- st.write("Score:", answer['score'])
 
45
 
46
  if __name__ == "__main__":
47
  main()
 
37
  # Perform question-answering in batches
38
  answers = question_answering(questions, pdf_text)
39
 
40
+ # Display the results as a table with a header row
41
+ table_data = [["Question", "Answer", "Score"]]
42
  for i, (question, answer) in enumerate(zip(questions, answers)):
43
+ table_data.append([f"{i + 1}: '{question}'", answer['answer'], f"{answer['score']:.2f}"])
44
+
45
+ st.write("Questions and Answers:")
46
+ st.table(table_data)
47
 
48
  if __name__ == "__main__":
49
  main()