MCPcopy Create free account
hub / github.com/ScienciaLAB/document-qa / process_pdf

Method process_pdf

document_qa/ner_client_generic.py:313–326  ·  view source on GitHub ↗
(self, form_data: dict, method_name="superconductors", params={}, headers={"Accept": "application/json"})

Source from the content-addressed store, hash-verified

311 return status, json.loads(res.text)
312
313 def process_pdf(self, form_data: dict, method_name="superconductors", params={}, headers={"Accept": "application/json"}):
314
315 the_url = self.get_url(method_name)
316 params, the_url = self.get_params_from_url(the_url)
317
318 res, status = self.post(url=the_url, files=form_data, data=params, headers=headers)
319
320 if status == 503:
321 time.sleep(self.config["sleep_time"])
322 return self.process_text(input, method_name, params, headers)
323 elif status != 200:
324 print("Processing failed with error " + str(status))
325 else:
326 return res.text
327
328 def process_pdfs(self, pdf_files, params={}):
329 pass

Callers 1

process_structureMethod · 0.80

Calls 4

get_urlMethod · 0.95
get_params_from_urlMethod · 0.95
process_textMethod · 0.95
postMethod · 0.80

Tested by

no test coverage detected