News for hackers. Stuff that matters.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by alsodumb on Thursday November 30, 2023 @10:00PM (#38482521)
Great work! I am a bit confused with the comparison with nougat throughout the repo. Nougat was specifically trained for academic documents, and I don't think anyone ever claimed Nougat was the best OCR model out there. That's kinda clear in your benchmark too where you mention that nougat has higher accuracy on arxiv documents. You also mention that marker will convert fewer equations when compared to nougat, and yet compare with nougat in terms of speed? (again, only complaining because it's a model designed for academic documents).

For anyone trying to do OCR on any pdf with math in it, definitely do try nougat. It's very easy to install (just a python package), and extracts the math, text, tables and beyond (in a .mmd file) with a single command line command. It also runs reasonably fast for personal uses - it takes about 30 seconds to convert a 6 page document using CPU only on my 4 year old i5 laptop.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by fshr on Thursday November 30, 2023 @11:37PM (#38483187)
> I don't think anyone ever claimed Nougat was the best OCR model out there

Comparing two things doesn't inherently imply the previous thing was touted about with superlatives. It's just a way to juxtapose the new thing with something that may be familiar. As you said, nougat is easy to install/run so it makes sense they'd compare it. Would it be better if they could add more libraries in the comparison? Absolutely; that'd be helpful.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by defsectec on Thursday November 30, 2023 @11:37PM (#38483182)
How do you think nougat would handle RPG rulebook PDFs?

I'm looking for a food OCR model to help me transcribe sections of RPG books to markdown. Ideally, I'd like the emphasis such as bold or italics to be transcribed.

The combo of text, numbers, and math symbols seems similar to technical and academic writing, but often has weird formatting, text boxes in the margins, and many diagrams.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by alsodumb on Friday December 01, 2023 @01:47AM (#38483917)
I'm not completely sure to be honest, but you should try it yourself with a sample page! I believe hugging face hosts it online on their demo pages so you don't even have to install the package to test on one page.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @09:34AM (#38487111)
Author here: for my use case (converting scientific PDFs in bulk), nougat was the best solution, so I compared to it as the default. I also compare to naive text extraction further down.

Nougat is a great model, and converts a lot of PDFs very well. I just wanted something faster, and more generalizable.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by civilitty on Friday December 01, 2023 @11:05AM (#38488276)
Great work! I just tried it on Linux for System Administrators and it did a great job properly picking up on code and config text.

I noticed marker downloaded a PyTorch checkpoint called `nougat-0.1.0-small`, do you use nougat under the hood too or is that just a coincidence?

Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @11:45AM (#38488833)
Yes, nougat is used as part of the pipeline to convert the equations (basically marker detects the equations then passes those regions to nougat). It's a great model for this.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by Ldorigo on Sunday December 03, 2023 @04:32AM (#38505921)
Reading your comment and parent's I think perhaps there is a mistake in the comparison chart on GitHub? It says nougat takes around 700 seconds per page and yours around 90. This doesn't match with parent's claim that it took him 30 seconds to run nougat on 6 pages.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by sumedh on Saturday December 02, 2023 @01:53AM (#38496546)
> extracts the math, text, tables

I want to extract financial statements from pdfs which are in tables, would Nougat be suitable for that use case?

Re:Marker: Convert PDF to Markdown quickly with high accuracy by defsectec on Thursday November 30, 2023 @11:01PM (#38482982)
This looks amazing, I'll have to play around with this over the weekend.

I regularly hand transcribe RPG PDFs scans from dubious sources that have not always been run through OCR to have selectable text. If it has, it wasn't always done very well.

It's literally faster to type it all myself than fix all the errors from copy-pasting (or after using OCR to turn it into text).

Even if the file was an official PDF the formatting would often get screwed up with lots of double or triple spaces and even tabs included between words.

This would save so much time if I can get it to work. Thanks for sharing!

Re:Marker: Convert PDF to Markdown quickly with high accuracy by crooked-v on Friday December 01, 2023 @12:33AM (#38483528)
> I regularly hand transcribe RPG PDFs scans from dubious sources

Heh, that was my immediate thought too. There's a ton of RPG stuff that never had any kind of physical release and is totally orphaned as IP.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by milep on Friday December 01, 2023 @05:48AM (#38485361)
I had this use case also in mind. Already tried with one book, but the results were not that good. Many of the tables and text boxes were messed up. I had pretty good results converting tables to markdown with ChatGPT by taking a screenshot of a table and pasting it to chat. It was able to handle some "irregular" tables with a bit of prompting. Like "Read the table row by row. Column headers are X, Y, Z. X is text, Y is number, Z is word" as a simplified example.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by lgats on Thursday November 30, 2023 @11:51PM (#38483273)
It'd be really great if there was something like this that also supported image extraction
Re:Marker: Convert PDF to Markdown quickly with high accuracy by prmoustache on Friday December 01, 2023 @03:14AM (#38484394)
Especially for those that want to move out of Confluence. It is rather easy to obtain a docx or pdf from the API as well as the raw, uncompressed attachements, a bit more complicated to convert said files to markdown with full quality attachements and no formatting errors on every pages.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by afandian on Friday December 01, 2023 @04:47AM (#38484988)
My current workflow (for getting a magazine onto a website) is Calibre's HTMLZ export, then through Pandoc to markdown. It produces good enough Markdown to feed in to Hugo, and extracts images.

I've been through a number of options in the past and this is what I've settled on.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by samuell on Friday December 01, 2023 @05:57AM (#38485411)
Interesting! I tried it, but it seems to struggle with multi-column layouts (lines get intermingled). Is that something you tried?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by afandian on Friday December 01, 2023 @12:24PM (#38489362)
No, only standard paragraphs.

My workflow still takes manual tweaking. When I find floated figures with captions, the lines get intertwingled and need to be unintertwingled. So I'm not surprised it didn't work for you.

Good luck, report back if you find what you're looking for. I'm always on the lookout for a better way.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by samuell on Saturday December 02, 2023 @06:17AM (#38497789)
I can report that the closest I've came before is with PDFMiner (https://pypi.org/project/pdfminer/) for Python. The benefit of this one is that it retains styling information, so that italics and the like can be retained, at least with some post-processing (I think one might need to convert certain CSS-classes to actual <i> or <em> tags).

The other option I have started looking into is the PDFCPU library for Go. It is a bit more low-level than PDFMiner, but one gets out very well structured info, that seem it might be possible to post-process quite well, for one's particular use case and PDF layouts: https://github.com/pdfcpu/pdfcpu

I also now tried the Marker tool in the OT, and it seems to do a reasonable job. It did intermingle some columns though, at least in some tricky cases such as when there were a round shaped image in between the two columns. One note is that Marker doesn't seem to retain styling like italics though.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by nicodjimenez on Thursday November 30, 2023 @11:36PM (#38483176)
Mathpix does this and also supports handwriting, in addition to capturing all figures, and also supports over 50 languages.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by tomr75 on Friday December 01, 2023 @12:48AM (#38483599)
$$
Re:Marker: Convert PDF to Markdown quickly with high accuracy by phi-go on Friday December 01, 2023 @02:59AM (#38484323)
You should mention that you are the CEO of Mathpix.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by pk-protect-ai on Friday December 01, 2023 @04:07AM (#38484733)
It actually doesn't matter. For my cases, I found Mathpix to be much more reliable than Nougat, for example. So, when you have hundreds of documents to convert a year and little time for manual labor on the results, paying a yearly "pro" subscription fee is worth it. However, it will really hit your pocket when you need to prepare datasets from thousands of PDFs... That's what you can't afford without a budget allocation from your project.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by phi-go on Friday December 01, 2023 @05:06AM (#38485106)
While I can see that Mathpix might be the superior choice. What matters to me is that knowing the affiliation of the GP the comment has a very different feel to it.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by nicodjimenez on Saturday December 02, 2023 @07:38AM (#38498200)
Mathpix is going to lower price a lot for larger scale pdf processing, stay tuned!
Re:Marker: Convert PDF to Markdown quickly with high accuracy by mlhpdx on Thursday November 30, 2023 @10:00PM (#38482519)
Nice. This would have been very helpful when I was building an e-discovery document processing engine. Back then we could get text out (OCR, so kind of) but it was a bear to present. Markdown would have been a whole lot easier.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by potatoman22 on Thursday November 30, 2023 @09:56PM (#38482493)
This seems like a great tool to help migrate my notes out of OneNote
Re:Marker: Convert PDF to Markdown quickly with high accuracy by smusamashah on Friday December 01, 2023 @04:37AM (#38484917)
How can it help with OneNote?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by baby_souffle on Friday December 01, 2023 @09:27AM (#38487032)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by airstrike on Thursday November 30, 2023 @10:54PM (#38482938)
Really interesting stuff... it might be worth adding some before-and-after examples to the repo.

What kind of PDF are you tweaking it for? How does it handle handwritten annotations?

Re:Marker: Convert PDF to Markdown quickly with high accuracy by jnathsf on Thursday November 30, 2023 @10:12PM (#38482637)
Are there any other libraries or online services that does this well? I have a large number of PDFs from government agencies. I’ve tried AWS Textract and works fairly well.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by nicodjimenez on Thursday November 30, 2023 @11:36PM (#38483177)
Try Mathpix
Re:Marker: Convert PDF to Markdown quickly with high accuracy by iglio on Friday December 01, 2023 @05:52AM (#38485382)
Suggest adding a disclaimer that you are the founder
Re:Marker: Convert PDF to Markdown quickly with high accuracy by nicodjimenez on Saturday December 02, 2023 @07:40AM (#38498212)
You’re right :) got to love HN, I broke the code and got downvoted! I like a community that has teeth
Re:Marker: Convert PDF to Markdown quickly with high accuracy by wriggles on Friday December 01, 2023 @05:02AM (#38485081)
https://www.handwritingocr.com is aimed specifically at handwriting, and will do that better than Textract and co, but works well for printed text too.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by dr_kiszonka on Thursday November 30, 2023 @11:00PM (#38482970)
Nice! The only missing feature is conversion of plots to ASCII art ; )
Re:Marker: Convert PDF to Markdown quickly with high accuracy by ploum on Friday December 01, 2023 @04:57AM (#38485050)
This could be achieved with chafa.py :

https://chafapy.mage.black/

https://hpjansson.org/chafa/

Re:Marker: Convert PDF to Markdown quickly with high accuracy by danofsteel32 on Friday December 01, 2023 @04:18AM (#38484800)
I have an odd usecase that I've yet to find a good solution to: Reading construction documents (Blueprints are always PDF). I've had much better luck parsing DXF (AutoCAD) files but it's not always easy to get an architect to send them to me even if I'm the GC on the job.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by KeplerBoy on Friday December 01, 2023 @04:50AM (#38485009)
Great stuff!

I have a question regarding the output of Nougat: Where do the "hallucinations" come from (just scroll through the Nougat output of the Think Python example to see what I mean)?

Nevermind, i just read it runs it through an LLM, so hallucinations are par for the course.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by thfuran on Friday December 01, 2023 @06:36AM (#38485649)
I think these sorts of tools are dangerous at least until the hallucination (in text or formatting) rate is below that experienced by a careful reader repeatedly re-reading a document, which is almost but not quite zero and, depending on the application, potentially even until it's actually zero. I guess they're mostly fine for cases where the extact document content isn't important, but it's probably not common to have a lot of documents that nobody anywhere considers or ever will consider important yet which must be more accessible than pdfs.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by scary-size on Friday December 01, 2023 @04:57AM (#38485049)
Nice work. I tend to do most of my longer reading on an e-reader. PDFs, especially multi-column layouts, are a nightmare with the out-of-the-box offerings from Amazon Kindle or Pocketbook. This looks like something that'll improve my experience quite a lot.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by iamflimflam1 on Friday December 01, 2023 @04:58AM (#38485057)
How good is tesseract for OCR nowadays? I tried using it a while back and it was nowhere near as good as the online offerings from AWS, Azure and GCP.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by rereasonable on Friday December 01, 2023 @06:42AM (#38485698)
Last update was pretty recent, and the git mentions tesseract 5 as a dep. so it's likely moved on a bit from when you last tried it:

https://github.com/tesseract-ocr/tesseract/releases

I suppose it depends on your use-case. For personal tasks like this it should be more than sufficient, and won't need user details/cc or whatever to use it.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by Geee on Friday December 01, 2023 @06:42AM (#38485700)
I tried it quite recently and it failed on a very basic image. I also tried the iOS Vision API, which also failed. My test case was a clear photo of a book page.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by is_true on Friday December 01, 2023 @12:26PM (#38489396)
It requires quite a bit of preprocessing. I've only tried GCP's solution which it's better in my experience
Re:Marker: Convert PDF to Markdown quickly with high accuracy by habosa on Friday December 01, 2023 @01:56PM (#38490684)
I found it to be surprisingly good and I was very impressed with the in-browser performance. It is very very sensitive to resolution though. Once my images got down to a certain size they produced garbage from Tesseract even though they were very human readable.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by dr_dshiv on Friday December 01, 2023 @05:04AM (#38485095)
What’s the best tool for writing with chatGPT so that markdown gets rendered properly? Copy pasting in google docs is always misery.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by rany_ on Friday December 01, 2023 @05:06AM (#38485110)
I'd just use pandoc to convert to docx.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by mannycalavera42 on Friday December 01, 2023 @05:12AM (#38485143)
Let's not underestimate the impact of such tool: we are talking about freeing up tons of knowledge from a "good for consumption/bad for distribution" format.

I'm very excited about it.

Let's build a pipeline: all the pdfs -> markdown them all -> archive.org them all

Re:Marker: Convert PDF to Markdown quickly with high accuracy by samuell on Friday December 01, 2023 @05:34AM (#38485280)
Yes, there is an enormous interest in this kind of thing, not the least in larger organizations with tons of PDF documents in various forms.

Even though this would only cover a small part of the needs or use cases, it will still be hugely useful if it works well.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by mannycalavera42 on Friday December 01, 2023 @05:37AM (#38485299)
cough L cough L cough M cough anyone? :)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by samuell on Friday December 01, 2023 @05:42AM (#38485330)
Yeah, I know, but a lot of this content can be pretty sensitive, and might not be allowed to upload outside organization networks sometimes (hospitals, governments etc).
Re:Marker: Convert PDF to Markdown quickly with high accuracy by scoot on Friday December 01, 2023 @05:52AM (#38485379)
Like most software, LLMs can be run locally, or on private infrastructure. This was on the front page yesterday, which is not the only way to run an LLM locally, but about the easiest way possible: https://news.ycombinator.com/item?id=38464057
Re:Marker: Convert PDF to Markdown quickly with high accuracy by samuell on Friday December 01, 2023 @09:35AM (#38487123)
Thanks! Well, yea, I just thought the quality of offline models might not yet be good enough. By I'm glad to be told otherwise :)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by miki123211 on Friday December 01, 2023 @07:21AM (#38485913)
This also has tons of use-cases for accessibility, getting PDF accessibility right is tons of work and even if you manage it, it's highly likely that the PDF viewers your users use don't support the necessary standards anyway.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by Alex3917 on Friday December 01, 2023 @07:59AM (#38486167)
> we are talking about freeing up tons of knowledge from a "good for consumption/bad for distribution" format.

FWIW PDF is actually great for distribution. It allows you to invisibly embed all the raw data used to generate the document that the end user is seeing, in whatever format you want. So if you are generating your PDFs by using PrinceXML to render HTML, you can embed the raw JSON used to generate all of the text, graphs, charts, etc. Now most people don't actually do this of course, but that isn't the fault of the spec.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by sertbdfgbnfgsd on Friday December 01, 2023 @08:08AM (#38486239)
pdfs don't play well with ereaders.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by Alex3917 on Friday December 01, 2023 @08:11AM (#38486256)
Are the standards for building accessible PDFs worse than the standards for building accessible websites, or are they just not as commonly implemented?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by sertbdfgbnfgsd on Friday December 01, 2023 @08:21AM (#38486346)
I don't know anything about websites. I had ebooks in mind.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by solardev on Friday December 01, 2023 @11:13AM (#38488376)
(anecdotally) PDFs usually come from many people, departments, companies, and apps. It's hard to shoehorn in accessibility if someone didn't add it in at the origin (like in indesign or whatever app they used). Or if they printed to PDF, whatever accessibility they had would probably be lost. Much of the time it's like working with a raster image with some embedded text. Not really the same as being able to edit a proper semantic document.

With a website and available source code, any dev working on it later on can still add accessibility, tweak contrasts and fonts and add screen reader hints, etc.

It's much harder to do so for PDFs after the fact. And PDF viewer apps may or may not even support the accessibility annotations. By contrast all the major browsers and operating systems have OK support for web accessibility.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by chaxor on Friday December 01, 2023 @11:32AM (#38488631)
Yeah, totally. PDFs are wonderful for archiving.*

They can hold so many different types of data so that they're extremely difficult to parse.

Because of this, you can put several malicious programs into them for RCE.

That way, if someone archives many PDFs, there can be a plethora of different RCE vulnerabilities just waiting for the user to discover.

It's a wonderful dream for any malicious actor.

* /s

Re:Marker: Convert PDF to Markdown quickly with high accuracy by HeavyStorm on Friday December 01, 2023 @03:51PM (#38492196)
The problem of PDF is not distribution, it's consumption. It has a fixed layout that's so 1990 that makes me itch.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @09:30AM (#38487068)
Author here - this is one of the reasons I made this. Also see https://github.com/VikParuchuri/libgen_to_txt , although I haven't integrated marker with it yet (it uses naive text extraction).
Re:Marker: Convert PDF to Markdown quickly with high accuracy by kevincox on Friday December 01, 2023 @10:47AM (#38488112)
> Let's build a pipeline

I don't think that is the right approach for archiving. The preferred pipeline would be

all the pdfs -> archive them all -> markdown them

This way you can always re-run the conversion as bugs are fixed and improvements are made. Generally archivist prefer to save as close to the source material as possible, because every transformation from there can only lose data.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by crotchfire on Monday December 04, 2023 @03:23AM (#38514940)
Yeah if you get down into the weeds these models are significantly corrupting the source data.

I opened the first example to a random chapter (1.4 Formal and natural languages); within the first three paragraphs it:

- Hallucinated spurious paragraph breaks

- Ignored all the boldfacing

- Hallucinated a blockquote into a new section

This is not a tool to produce something for humans to read.

Maybe it might be useful as part of some pipeline that needs to feed markdown into some other machine process. I would not waste my time reading the crud that came out of this thing.

It's a stunt.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by Gabrys1 on Friday December 01, 2023 @11:50AM (#38488912)
Finally a good usecase for AI/ML/LLM.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by rounakdatta on Friday December 01, 2023 @05:38AM (#38485303)
This kind of tool should also be built-into the post-processing pipeline of paperless-ngx. Well-parsed markdowns would be better indexable for search.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by sertbdfgbnfgsd on Friday December 01, 2023 @08:07AM (#38486234)
Question for the author: Why to markdown? It seems to me the hard part of this tool is parsing pdfs with high accuracy, not whatever you do with them. As such, I would love if this tool allowed the user to choose the output format. I know that I would use a high accuracy pdf parser to render into epub.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by carschno on Friday December 01, 2023 @08:14AM (#38486288)
I agree, the intermediate format should be plain text that could optionally be converted to any other format. I suppose that Markdown, however, is used as intermediate format here. It is close to plain text while it can preserve simple layout information.

In practice, I would use the Markdown output and plug it into any tool that converts that into the desired final output format.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by sertbdfgbnfgsd on Friday December 01, 2023 @08:25AM (#38486379)
That sounds reasonable. I might explore pdf -> markdown -> epub.

I wonder if this could somehow be used directly by calibre. I think calibre's pdf->epub conversion isn't amazing. In particular, tables often end up broken.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by Finnucane on Friday December 01, 2023 @08:24AM (#38486373)
You would want to have some kind fo markup that preserves structural markup as much as possible. I manage ebooks for a university press, and we have a deep backlist waiting for conversion, a lot of which only exists as page scans of old print volumes. I want to be able to offer them as epubs, which means I need to know where there are chapter breaks, heads, tables, charts, math, blockquotes, and so on and so forth. I have vendors that can do this for me, but it costs more than we'd get for some of these books in sales. I'd love to be able to do soem of this myself.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @09:35AM (#38487125)
I chose markdown because I wanted to preserve equations (fenced by $/$$), tables, bold/italic information, and headers. I haven't looked into epub output, but this ruled out plain text.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by da39a3ee on Saturday December 02, 2023 @11:34AM (#38499773)
Why not choose an unambiguously parseable output format such as JSON, and then convert JSON to markdown/ html / etc when needed?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by yxhuvud on Friday December 01, 2023 @08:25AM (#38486385)
Impressive. It would be nice to have access to a spellchecker with support for more languages though. But the results are pretty good despite that.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by rurban on Friday December 01, 2023 @09:40AM (#38487180)
Spellchecker is included. Just change the spell_Lang from eng to your lang
Re:Marker: Convert PDF to Markdown quickly with high accuracy by yxhuvud on Friday December 01, 2023 @10:02AM (#38487474)
I know it is included. The problem is that the available selection of languages is not good enough to include any of the languages I need it for. There is only support for a handful of languages.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by hashemian on Friday December 01, 2023 @08:44AM (#38486560)
Amazing work. Thank you.

I have a set of PDF files, and this week was thinking how I can link them to an LLM and be able to ask questions about them. So this was very timely.

I did a quick side-by-side testing against Nougat, and it clearly works better. On a handful of PDFs I tested, Marker extracted considerably more text (the text did not have any math, just academic papers), finished the job faster, and did not crash on any pdf, while Nougat took a lot longer to finish, and sometimes crashed due to out-of-memory error (could not allocate more than 7GB RAM!)

Re:Marker: Convert PDF to Markdown quickly with high accuracy by s1291 on Friday December 01, 2023 @08:47AM (#38486594)
I'm curious if anyone has had any success building this package. I've spent a lot of time trying to build it myself, but unfortunately haven't been able to get it to work. Has anyone else had better luck?"
Re:Marker: Convert PDF to Markdown quickly with high accuracy by yxhuvud on Friday December 01, 2023 @10:03AM (#38487498)
The hard part was getting CUDA and torch to work. The package itself was just poetry install. Easy-peasy.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by hashemian on Friday December 01, 2023 @08:55AM (#38486660)
I did it on mac without any issues. Are you using Mac or Linux? what is the issue?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by s1291 on Friday December 01, 2023 @09:18AM (#38486923)
I'm using Ubuntu 22.04. I encountered several errors with Poetry and attempted to fix them but eventually gave up.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @09:37AM (#38487142)
(author) Please feel free to open an issue if you try again. Poetry can be painful, I might just switch to a requirements.txt file in the future. (you can skip poetry if you want by just pulling everything in pyproject.toml into a requirements.txt file also)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by yxhuvud on Friday December 01, 2023 @10:12AM (#38487626)
I found the use of poetry a bresh of fresh air compared to the usual python silliness. Painless, as opposed to getting the cuda stuff working which took a lot longer.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by s1291 on Friday December 01, 2023 @09:57AM (#38487419)
Is there a plan to release this package as a docker image?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by vikp on Friday December 01, 2023 @11:46AM (#38488841)
Yes, this is on my list of things to do :)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by nemacol on Friday December 01, 2023 @09:33AM (#38487108)
Can someone help me understand the line

>Due to the licensing of the underlying models like layoutlmv3 and nougat, this is only suitable for noncommercial usage.

Does this mean it isn't suitable if I wanted to use it in a product for sale or I cannot use it for tasks at my work? I would like to try to use this at work to convert vendor documentation to include in our internal wiki.

Re:Marker: Convert PDF to Markdown quickly with high accuracy by infecto on Friday December 01, 2023 @09:45AM (#38487232)
If your work is commercial then you cannot use it. Think of it this way, is your work being used in a commercial business. Then it cannot be used. If you are using this for personal use or anything that is not part of a business, its ok.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by creativenolo on Sunday December 03, 2023 @02:30PM (#38509947)
What if your business is education and you use it in your educational output? (Serious question)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by nemacol on Tuesday December 05, 2023 @08:08AM (#38530230)
Thank you for your help!
Re:Marker: Convert PDF to Markdown quickly with high accuracy by rurban on Friday December 01, 2023 @09:38AM (#38487151)
The installation of this thing needed more time than manual fixups of the generated .md with a simple pdf2md converter. And I got a perfect result, unlike marker/nougat.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by bingdig on Friday December 01, 2023 @09:47AM (#38487259)
I'm not very technical but could benefit from this tool tremendously. Is there a way to use it from R?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by poulpy123 on Friday December 01, 2023 @09:50AM (#38487304)
That looks great ! I would think that the same with latex or typst could be even better if doable
Re:Marker: Convert PDF to Markdown quickly with high accuracy by ramoz on Friday December 01, 2023 @10:01AM (#38487469)
Kosmos2.5 seems promising and I hope we see it in oss (otherwise assume it just makes Azure cloud ocr better)

https://arxiv.org/pdf/2309.11419.pdf

Re:Marker: Convert PDF to Markdown quickly with high accuracy by nanna on Friday December 01, 2023 @10:06AM (#38487535)
Might the OCRing of for example MIT's student magazine The Tech have used a similar stack as this, sans Markdown output of course? In the sense of the way any given historical issue's complex layout has been OCR'd so well?

https://thetech.com/issues

Random old issue for example: https://thetech.com/issues/33/34

Re:Marker: Convert PDF to Markdown quickly with high accuracy by 101008 on Friday December 01, 2023 @11:11AM (#38488337)
I'd love to try this for a magazine I publish in PDF (designed with Adobe Indesign), but I couldn't make the repo work on my local. Any chance anyone could make a guide to try it on the cloud? It would be appreciated :)
Re:Marker: Convert PDF to Markdown quickly with high accuracy by maliker on Friday December 01, 2023 @12:12PM (#38489231)
I've struggled with the other part of this flow: getting a good clean PDF of a website in an automated way. Whatever archive.today does is probably the best approach I've seen, but they don't publish their code as far as I can tell.
Re:Marker: Convert PDF to Markdown quickly with high accuracy by ryanklee on Friday December 01, 2023 @12:27PM (#38489411)
How well does this handle tables and text embedded in images?
Re:Marker: Convert PDF to Markdown quickly with high accuracy by da39a3ee on Saturday December 02, 2023 @09:02AM (#38498669)
Why are people converting PDF to Markdown? I get the impression that it is a thing currently in the LLM / ML world. But shouldn't we be converting to an unambiguously machine readable format like JSON, and then separately writing JSON to md formatters?