Some prompt tweaks I thought of for next time

This commit is contained in:
Jake Poznanski 2024-09-25 20:47:33 +00:00
parent 8ebe751196
commit 5f9b2341c7

View File

@ -20,11 +20,13 @@ TARGET_IMAGE_DIM = 2048
def _build_prompt(base_text: str) -> str:
return (
f"Below is the image of one page of a PDF document, as well as a the raw textual content that was previously extracted for it. "
f"Below is the image of one page of a PDF document, as well as some raw textual content that was previously extracted for it. "
f"Just return the plain text representation of this document as if you were reading it naturally.\n"
f"Turn equations into a LaTeX representation. Remove the headers and footers, but keep references and footnotes.\n"
f"Read any natural handwriting.\n"
f"This is likely one page out of several in the document, so be sure to preserve any sentences that come from the previous page, or continue onto the next page, exactly as they are.\n"
f"If there is no text at all that you think you should read, just output [NO TEXT].\n"
f"If the page has no English text on it at all, just output [NO ENGLISH TEXT].\n"
f"Do not hallucinate.\n"
f"RAW_TEXT_START\n{base_text}\nRAW_TEXT_END"
)