Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,13 @@ p = pipeline(
|
|
15 |
def qa(question: str, doc: str) -> str:
|
16 |
reader = PdfReader(doc)
|
17 |
|
18 |
-
text =
|
|
|
|
|
19 |
|
20 |
-
|
|
|
|
|
21 |
#output = p(img, question)
|
22 |
return text
|
23 |
|
|
|
15 |
def qa(question: str, doc: str) -> str:
|
16 |
reader = PdfReader(doc)
|
17 |
|
18 |
+
text = []
|
19 |
+
for p in np.arange(0, len(reader.pages), 1):
|
20 |
+
page = reader.pages[int(p)]
|
21 |
|
22 |
+
# extracting text from page
|
23 |
+
text.append(page.extract_text())
|
24 |
+
text = ' '.join(text)
|
25 |
#output = p(img, question)
|
26 |
return text
|
27 |
|