Skip to content

Commit

Permalink
Some prompt tweaks I thought of for next time
Browse files Browse the repository at this point in the history
  • Loading branch information
jakep-allenai committed Sep 25, 2024
1 parent 8ebe751 commit 5f9b234
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pdelfin/silver_data/buildsilver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@

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"
)
Expand Down

0 comments on commit 5f9b234

Please sign in to comment.