Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pdf context extract #137

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Pdf context extract #137

wants to merge 3 commits into from

Conversation

BryceStevenWilley
Copy link
Contributor

Definitely not finished. Still needs:

  • docstrings for functions
  • higher level documentation for which functions we expect people to use
  • maybe some sort of testing on a few PDFs

Harder than anticipated, for a few reasons:

* can't get things in order. I guess that's the point of PDFminer, but...
* PDF miner doesn't give you AcroForms at all. It has a completley hardcoded
  way of getting them, outside the context of the page.
* We can do these two things:
    * kinda put all of the fields back in the original text (see replace_original_text).
      Doesn't work too well though, lots of duplicate pieces of text that put many of the fields
      in the same place, when they should be in a different place.
        * could gather fields with the same adjacent text, and get all parts of that text in the PDF.
          Not guaranteed to be in order tho.
    * for each field, get all of the surrounding context. Is okay! But consistently gets too much text for GPT4.
      Even if we make it smaller, sometimes the surrounding context isn't the full sentence, or gets too much from other
      fields (will have too much shared / confusing the two fields).

TBH next goal is to try the PDFPageAndFieldInterpreter approach, notes in there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant