Markdown genration
#36
by
anhdo10ntq
- opened
I want to know how the model extract markdown for OCR. does it based on the json like (bounding box, context,...) then use LLM to generate the markdown.
I want to know how the model extract markdown for OCR. does it based on the json like (bounding box, context,...) then use LLM to generate the markdown.
It just serializes the output JSON into markdown
- It sorts the segments in reading order (top-to-bottom, left-to-right)
- Formats the text according to its category
- Skips page footers and page headers (optionally)
Basically, you can write down your own markdown serializer
Sources:
https://github.com/rednote-hilab/dots.ocr/blob/master/dots_ocr/utils/format_transformer.py#L145
https://huggingface.co/spaces/MohamedRashad/Dots-OCR/blob/main/app.py#L240