Files
Michele Dolfi 19af03f539 feat: Support for DeepSeek-OCR in VLM pipeline (#2798)
* add parsing of annotated markdown and definition of new ResponseFormat for the VLM pipeline

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* fix broken html in test

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* update result with initial text

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* move parsing to vlm pipeline

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* restore md from main

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* process table structure

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* simplify and refactor

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* factor out deepseekocr utils

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* renaming

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* refactor common logic in vlm parsing logic

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add deepseek-ocr with ollama

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* update tests for new annotation format

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* fix parsing of title

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* more test data

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add picture item

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* fix bbox parsing

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* remove old tests

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add test parsing deepseek md

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* rename test

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* add test with ollama conversion

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

* fix test and mark methods as private

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>

---------

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
2026-01-09 18:42:40 +01:00

3.4 KiB
Vendored

order to compute the TED score. Inference timing results for all experiments were obtained from the same machine on a single core with AMD EPYC 7763 CPU @2.45 GHz.

<|ref|>sub_title<|/ref|><|det|>217, 209, 520, 225<|/det|>

5.1 Hyper Parameter Optimization

<|ref|>text<|/ref|><|det|>217, 230, 785, 321<|/det|> We have chosen the PubTabNet data set to perform HPO, since it includes a highly diverse set of tables. Also we report TED scores separately for simple and complex tables (tables with cell spans). Results are presented in Table. It is evident that with OTSL, our model achieves the same TED score and slightly better mAP scores in comparison to HTML. However OTSL yields a (2x) speed up in the inference runtime over HTML.

<|ref|>table<|/ref|><|det|>225, 421, 777, 595<|/det|> <|ref|>table_caption<|/ref|><|det|>217, 342, 785, 413<|/det|> Table 1. HPO performed in OTSL and HTML representation on the same transformer-based TableFormer 9 architecture, trained only on PubTabNet [22]. Effects of reducing the # of layers in encoder and decoder stages of the model show that smaller models trained on OTSL perform better, especially in recognizing complex table structures, and maintain a much higher mAP score than the HTML counterpart.

# enc-layers# dec-layersLanguageTEDsmAP (0.75)Inference time (secs)
simplecomplexall
66OTSL0.9650.9340.9550.882.73
HTML0.9690.9270.9550.8575.39
44OTSL0.9380.9040.9270.8531.97
HTML0.9520.9090.9380.8433.77
24OTSL0.9230.8970.9150.8591.91
HTML0.9450.9010.9310.8343.81
42OTSL0.9520.920.9420.8571.22
HTML0.9440.9030.9310.8242

<|ref|>sub_title<|/ref|><|det|>217, 636, 432, 652<|/det|>

5.2 Quantitative Results

<|ref|>text<|/ref|><|det|>217, 656, 785, 777<|/det|> We picked the model parameter configuration that produced the best prediction quality (enc=6, dec=6, heads=8) with PubTabNet alone, then independently trained and evaluated it on three publicly available data sets: PubTabNet (395k samples), FinTabNet (113k samples) and PubTables- 1M (about 1M samples). Performance results are presented in Table. 2 It is clearly evident that the model trained on OTSL outperforms HTML across the board, keeping high TEDs and mAP scores even on difficult financial tables (FinTabNet) that contain sparse and large tables.

<|ref|>text<|/ref|><|det|>217, 778, 785, 838<|/det|> Additionally, the results show that OTSL has an advantage over HTML when applied on a bigger data set like PubTables- 1M and achieves significantly improved scores. Finally, OTSL achieves faster inference due to fewer decoding steps which is a result of the reduced sequence representation.