Spaces:
Sleeping
Sleeping
andreeabodea
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -94,6 +94,8 @@ def answer_questions(text,language="de"):
|
|
94 |
]
|
95 |
|
96 |
# Iterate over each question and get answers
|
|
|
|
|
97 |
for question in questions:
|
98 |
result = qa_pipeline(question=question, context=text)
|
99 |
# print(f"Question: {question}")
|
@@ -107,7 +109,7 @@ def process_pdf(path):
|
|
107 |
results_dict["1. Kurzbeschreibung"] = \
|
108 |
get_section(path, "1. Kurzbeschreibung", "2. Einordnung des Moduls")
|
109 |
answers = answer_questions(results_dict["1. Kurzbeschreibung"])
|
110 |
-
return
|
111 |
|
112 |
def get_first_page_text(file_data):
|
113 |
doc = pdfplumber.open(BytesIO(file_data))
|
|
|
94 |
]
|
95 |
|
96 |
# Iterate over each question and get answers
|
97 |
+
answers_dict = {}
|
98 |
+
|
99 |
for question in questions:
|
100 |
result = qa_pipeline(question=question, context=text)
|
101 |
# print(f"Question: {question}")
|
|
|
109 |
results_dict["1. Kurzbeschreibung"] = \
|
110 |
get_section(path, "1. Kurzbeschreibung", "2. Einordnung des Moduls")
|
111 |
answers = answer_questions(results_dict["1. Kurzbeschreibung"])
|
112 |
+
return answers
|
113 |
|
114 |
def get_first_page_text(file_data):
|
115 |
doc = pdfplumber.open(BytesIO(file_data))
|