Spaces:
Running
Running
Commit
·
75c6f14
1
Parent(s):
c7c4e48
Update app.py
Browse files
app.py
CHANGED
@@ -37,11 +37,13 @@ def main():
|
|
37 |
# Perform question-answering in batches
|
38 |
answers = question_answering(questions, pdf_text)
|
39 |
|
40 |
-
|
|
|
41 |
for i, (question, answer) in enumerate(zip(questions, answers)):
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
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()
|