I decided to test some of my old documents whose content and layout caused issues with older versions my PyMuPDF - to good results at first glance. Thanks for keeping up the great work on this package
One thing which tripped my pipeline up a smidge, was a possible change in the flags used to mark text extracted from pictures.
So, I wondered if there were any other such tags? I can’t find reference to <!-- Start of picture text --> ... <!-- End of picture text --> markers anywhere in the documentation - perhaps there are other content types marked in a similar manner?
One final observation is that ignore_images (bool) is set to true, so I’m a little surprised any were present?!
The most important change in v2.0 is that pymupdf, pymupdf4llm and pymupdf-layout are presented under one single umbrella and reachable / active by doing import pymupdf a… that’s it.
All 4LLM features and function (well almost all) are reachable via pymupdf’s API, for example there is the new Document method doc.to_markdown() – which does the same as pymupdf4llm.to_markdown(). The latter continues to exist of course – just as before.
If you have followed this comment carefully so far, you will realize that layout is activated now by default!
Therefore ignore_images/ignore_grahics has no effect - just the same as with pymupdf4llm under the Layout regime.
The will become effective again if you deactivate layout – again as before when using pymupdf4llm.
As per the tags around image text: A HTML-avid person will recognize them as HTML comments. We thought that it was about time to let the LLM consumers know that these wrappers are not page content.
Thanks both - the presence of the tags is not a major issue, and yes, I do see the layout comment now. I think I just got used to ignoring it as it was not a real problem.
My real question is about any other tags which may be included in the outputs?
I couldn’t find anywhere in the documentation that details which extracted feature types are wrapped in such tags.
HTML-savvy or not - without scanning the entire Markdown library for substrings which look like html comments, I’m just guessing at the moment.
HI @MW_UK , firstly sorry for the late reply here. If I understand correctly you think there could be other tags inside the Markdown ( but not standard Markdown tags ). In this case I think you would need to scan the Markdown for substrings like you say. However, I don’t think our to_markdown() method produces any additional inline tagging at the moment when layout is enabled.
@MW_UK We don’t have an exhaustive list. Our markdown convertor is the engine & I believe it may include some HTML comments and things like <u> for underline tags if they are found. But overall HTML syntax should be pretty rare.