Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @10:20AM
(#32224654)
The version in the notebook is just for simple text-based PDFs. I wrote some posts on our company blog[1] about the sheer agonies of dealing with PDF as a data format, so wanted to stick with as simple as possible for now.
That said, I'm planning future notebooks where you can perform text-to-image or image-to-image search, integrate OCR, scale it up, serve it, deploy it, etc.
Re:Search PDFs with Transformers and Python Notebook
by shubham_saboo on Monday July 25, 2022 @10:21AM
(#32224678)
Awesome, will be on the lookout for that!
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @10:23AM
(#32224698)
We've got quite a few other notebooks for other kinds of search on the blog. Would love to hear your thoughts!
Re:Search PDFs with Transformers and Python Notebook
by rahimnathwani on Monday July 25, 2022 @10:22AM
(#32224693)
Under the hood, it uses https://github.com/pdfminer/pdfminer.six which expects the text to be stored as text.
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @10:28AM
(#32224779)
You mean the PDFSegmenter Executor in the notebook?
Re:Search PDFs with Transformers and Python Notebook
by rahimnathwani on Monday July 25, 2022 @10:33AM
(#32224852)
Yes
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @11:12AM
(#32225494)
PDFSegmenter also extracts images, which can then be OCR'ed in the next step of the pipeline
Re:Search PDFs with Transformers and Python Notebook
by spaetzleesser on Monday July 25, 2022 @04:55PM
(#32230798)
"PDF as a data structure"
Don't. PDF is a terrible format for storing machine readable data. You lose a ton of Information while you create the PDF which you then painstakingly have to get back later (if that's even possible)
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @05:57PM
(#32231473)
I may have misworded it (if I wrote those words - PDF rots the brain and my memory likewise).
Agreed on the rest. PDFs don't store machine-readable data. Often just pixelated scanned hot garbage dumpster fire text.
I hate PDFs but have to work with the satanforesaken things. Hence the notebook. It's my little way of trying to give my little PDF-bespoked-hellscape a tiny little glow-up.
Re:Search PDFs with Transformers and Python Notebook
by spaetzleesser on Monday July 25, 2022 @10:40PM
(#32233639)
I probably didn’t read your comment closely enough. When I hear about PDF parsing or PDF as data I immediately get flashbacks from a project years ago where I had to parse PDF files. I think I am still traumatized by this experience so whenever I hear somebody wants to do this I just want to scream “Nooo. Don’t do this”
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Tuesday July 26, 2022 @04:14AM
(#32235656)
I think you and I should start a support group!
Re:Search PDFs with Transformers and Python Notebook
by alexcg1 on Monday July 25, 2022 @11:43AM
(#32225991)
Incidentally Jina Hub [0] has a few OCR Executors [1][2] you could integrate into my notebook (though you'd have to do some rewiring to take images into account since it's a text-based notebook)
Does it work end-to-end with PDF as a data structure or do we have to use OCR and parse the text first to be able to search it, really curious?