Omar ID EL MOUMEN commited on
Commit
bceef6c
·
1 Parent(s): 34d4681

Mini-patch #2

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -112,8 +112,8 @@ async def extract_text_pdf(document: DocumentID):
112
  else:
113
  for title in titles:
114
  if title[0] == 1 or title[0] == 2:
115
- main_titles.append(title[1])
116
- return {"pub_id": document.doc_id, "titles": [re.sub(r"\s+", " ", remove_punctuations(remove_in_betweens(t))).strip() for t in main_titles], "text": postprocess_text, "error": False} if len(main_titles) > 0 else {"pub_id": document.doc_id, "titles": "No titles found !", "text": postprocess_text, "error": False}
117
  else:
118
  print("ID: " + document.doc_id)
119
  print("URL: " + f"http://arxiv.org/pdf/{document.doc_id}")
 
112
  else:
113
  for title in titles:
114
  if title[0] == 1 or title[0] == 2:
115
+ main_titles.append((title[0], title[1]))
116
+ return {"pub_id": document.doc_id, "titles": [(t[0],re.sub(r"\s+", " ", remove_punctuations(remove_in_betweens(t[1]))).strip()) for t in main_titles], "text": postprocess_text, "error": False} if len(main_titles) > 0 else {"pub_id": document.doc_id, "titles": "No titles found !", "text": postprocess_text, "error": False}
117
  else:
118
  print("ID: " + document.doc_id)
119
  print("URL: " + f"http://arxiv.org/pdf/{document.doc_id}")