-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to get context around PDF fields
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.
- Loading branch information
1 parent
421f514
commit cb8a9d7
Showing
1 changed file
with
151 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters