Spaces:
Sleeping
Sleeping
Omar ID EL MOUMEN
commited on
Commit
·
743537e
1
Parent(s):
8d63c3e
Add print for debug random extraction
Browse files
app.py
CHANGED
@@ -93,6 +93,9 @@ async def extract_text_pdf(id_doc: str):
|
|
93 |
titles = re.findall(regex_titles, postprocess_text, flags=re.MULTILINE) if len(doc.get_toc()) <= 0 else doc.get_toc()
|
94 |
return {"error": False, "message": titles}
|
95 |
else:
|
|
|
|
|
|
|
96 |
return {"error": True, "message": "Error while downloading PDF: " + str(pdf_req.status_code)}
|
97 |
|
98 |
@app.get("/extract/random/{keyword}/{limit}")
|
|
|
93 |
titles = re.findall(regex_titles, postprocess_text, flags=re.MULTILINE) if len(doc.get_toc()) <= 0 else doc.get_toc()
|
94 |
return {"error": False, "message": titles}
|
95 |
else:
|
96 |
+
print("ID: " + id_doc)
|
97 |
+
print("URL: " + f"http://arxiv.org/pdf/{id_doc}")
|
98 |
+
print("Status code: " + str(pdf_req.status))
|
99 |
return {"error": True, "message": "Error while downloading PDF: " + str(pdf_req.status_code)}
|
100 |
|
101 |
@app.get("/extract/random/{keyword}/{limit}")
|