INNER CODE UNIT · Python
extract_text_from_upload
IvanIsCoding/ResuLLMe · src/doc_utils.py:13
def extract_text_from_upload(file):
if file.type == "application/pdf":
text = extract_text_from_pdf(file)
return text
elif (
file.type
== "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
):
text = extract_text_from_docx(file)
return text
elif file.type == "application/json":
return file.getvalue().decode("utf-8")
else:
return file.getvalue().decode("utf-8")
def escape_for_latex(data):
if isinstance(data, dict):