feat: enable precision control in float serialization (#1914)

* chore: propagate precision control in float serialization

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* parametrize float serialization, propagate core updates

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* update test float precision

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

* repin docling-core

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>

---------

Signed-off-by: Panos Vagenas <pva@zurich.ibm.com>
This commit is contained in:
Panos Vagenas
2025-07-09 16:39:17 +02:00
committed by GitHub
parent 931eb55b88
commit ec588df971
44 changed files with 364257 additions and 368422 deletions

View File

@@ -5,12 +5,10 @@
"origin": {
"mimetype": "application/pdf",
"binary_hash": 16115062463007057787,
"filename": "webp-test.webp",
"uri": null
"filename": "webp-test.webp"
},
"furniture": {
"self_ref": "#/furniture",
"parent": null,
"children": [],
"content_layer": "furniture",
"name": "_root_",
@@ -18,10 +16,9 @@
},
"body": {
"self_ref": "#/body",
"parent": null,
"children": [
{
"cref": "#/texts/0"
"$ref": "#/texts/0"
}
],
"content_layer": "body",
@@ -33,7 +30,7 @@
{
"self_ref": "#/texts/0",
"parent": {
"cref": "#/body"
"$ref": "#/body"
},
"children": [],
"content_layer": "body",
@@ -42,10 +39,10 @@
{
"page_no": 1,
"bbox": {
"l": 234.08627147881114,
"t": 2570.0959833241664,
"r": 1696.0985042090742,
"b": 2319.1220927976665,
"l": 234.09,
"t": 2570.1,
"r": 1696.1,
"b": 2319.12,
"coord_origin": "BOTTOMLEFT"
},
"charspan": [
@@ -55,9 +52,7 @@
}
],
"orig": "Docling bundles PDF document conversion to JSON and Markdown in an easy self contained package",
"text": "Docling bundles PDF document conversion to JSON and Markdown in an easy self contained package",
"formatting": null,
"hyperlink": null
"text": "Docling bundles PDF document conversion to JSON and Markdown in an easy self contained package"
}
],
"pictures": [],
@@ -70,7 +65,6 @@
"width": 2000.0,
"height": 2829.0
},
"image": null,
"page_no": 1
}
}

View File

@@ -85,14 +85,14 @@
"a": 255
},
"rect": {
"r_x0": 246.4065456254215,
"r_y0": 329.06770715202435,
"r_x1": 1691.991797818404,
"r_y1": 329.06770715202435,
"r_x2": 1691.991797818404,
"r_y2": 258.9040166758338,
"r_x3": 246.4065456254215,
"r_y3": 258.9040166758338,
"r_x0": 246.41,
"r_y0": 329.07,
"r_x1": 1691.99,
"r_y1": 329.07,
"r_x2": 1691.99,
"r_y2": 258.9,
"r_x3": 246.41,
"r_y3": 258.9,
"coord_origin": "TOPLEFT"
},
"text": "Docling bundles PDF document conversion to",
@@ -110,14 +110,14 @@
"a": 255
},
"rect": {
"r_x0": 234.08627147881114,
"r_y0": 419.5788697734327,
"r_x1": 1696.0985042090742,
"r_y1": 419.5788697734327,
"r_x2": 1696.0985042090742,
"r_y2": 349.4151792972422,
"r_x3": 234.08627147881114,
"r_y3": 349.4151792972422,
"r_x0": 234.09,
"r_y0": 419.58,
"r_x1": 1696.1,
"r_y1": 419.58,
"r_x2": 1696.1,
"r_y2": 349.42,
"r_x3": 234.09,
"r_y3": 349.42,
"coord_origin": "TOPLEFT"
},
"text": "JSON and Markdown in an easy self contained",
@@ -135,14 +135,14 @@
"a": 255
},
"rect": {
"r_x0": 242.29979922858777,
"r_y0": 509.8779072023336,
"r_x1": 513.3470125989277,
"r_y1": 509.8779072023336,
"r_x2": 513.3470125989277,
"r_y2": 439.9752910477536,
"r_x3": 242.29979922858777,
"r_y3": 439.9752910477536,
"r_x0": 242.3,
"r_y0": 509.88,
"r_x1": 513.35,
"r_y1": 509.88,
"r_x2": 513.35,
"r_y2": 439.98,
"r_x3": 242.3,
"r_y3": 439.98,
"coord_origin": "TOPLEFT"
},
"text": "package",
@@ -165,13 +165,13 @@
"id": 0,
"label": "text",
"bbox": {
"l": 234.08627147881114,
"t": 258.9040166758338,
"r": 1696.0985042090742,
"b": 509.8779072023336,
"l": 234.09,
"t": 258.9,
"r": 1696.1,
"b": 509.88,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9721011519432068,
"confidence": 0.972,
"cells": [
{
"index": 0,
@@ -182,14 +182,14 @@
"a": 255
},
"rect": {
"r_x0": 246.4065456254215,
"r_y0": 329.06770715202435,
"r_x1": 1691.991797818404,
"r_y1": 329.06770715202435,
"r_x2": 1691.991797818404,
"r_y2": 258.9040166758338,
"r_x3": 246.4065456254215,
"r_y3": 258.9040166758338,
"r_x0": 246.41,
"r_y0": 329.07,
"r_x1": 1691.99,
"r_y1": 329.07,
"r_x2": 1691.99,
"r_y2": 258.9,
"r_x3": 246.41,
"r_y3": 258.9,
"coord_origin": "TOPLEFT"
},
"text": "Docling bundles PDF document conversion to",
@@ -207,14 +207,14 @@
"a": 255
},
"rect": {
"r_x0": 234.08627147881114,
"r_y0": 419.5788697734327,
"r_x1": 1696.0985042090742,
"r_y1": 419.5788697734327,
"r_x2": 1696.0985042090742,
"r_y2": 349.4151792972422,
"r_x3": 234.08627147881114,
"r_y3": 349.4151792972422,
"r_x0": 234.09,
"r_y0": 419.58,
"r_x1": 1696.1,
"r_y1": 419.58,
"r_x2": 1696.1,
"r_y2": 349.42,
"r_x3": 234.09,
"r_y3": 349.42,
"coord_origin": "TOPLEFT"
},
"text": "JSON and Markdown in an easy self contained",
@@ -232,14 +232,14 @@
"a": 255
},
"rect": {
"r_x0": 242.29979922858777,
"r_y0": 509.8779072023336,
"r_x1": 513.3470125989277,
"r_y1": 509.8779072023336,
"r_x2": 513.3470125989277,
"r_y2": 439.9752910477536,
"r_x3": 242.29979922858777,
"r_y3": 439.9752910477536,
"r_x0": 242.3,
"r_y0": 509.88,
"r_x1": 513.35,
"r_y1": 509.88,
"r_x2": 513.35,
"r_y2": 439.98,
"r_x3": 242.3,
"r_y3": 439.98,
"coord_origin": "TOPLEFT"
},
"text": "package",
@@ -270,13 +270,13 @@
"id": 0,
"label": "text",
"bbox": {
"l": 234.08627147881114,
"t": 258.9040166758338,
"r": 1696.0985042090742,
"b": 509.8779072023336,
"l": 234.09,
"t": 258.9,
"r": 1696.1,
"b": 509.88,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9721011519432068,
"confidence": 0.972,
"cells": [
{
"index": 0,
@@ -287,14 +287,14 @@
"a": 255
},
"rect": {
"r_x0": 246.4065456254215,
"r_y0": 329.06770715202435,
"r_x1": 1691.991797818404,
"r_y1": 329.06770715202435,
"r_x2": 1691.991797818404,
"r_y2": 258.9040166758338,
"r_x3": 246.4065456254215,
"r_y3": 258.9040166758338,
"r_x0": 246.41,
"r_y0": 329.07,
"r_x1": 1691.99,
"r_y1": 329.07,
"r_x2": 1691.99,
"r_y2": 258.9,
"r_x3": 246.41,
"r_y3": 258.9,
"coord_origin": "TOPLEFT"
},
"text": "Docling bundles PDF document conversion to",
@@ -312,14 +312,14 @@
"a": 255
},
"rect": {
"r_x0": 234.08627147881114,
"r_y0": 419.5788697734327,
"r_x1": 1696.0985042090742,
"r_y1": 419.5788697734327,
"r_x2": 1696.0985042090742,
"r_y2": 349.4151792972422,
"r_x3": 234.08627147881114,
"r_y3": 349.4151792972422,
"r_x0": 234.09,
"r_y0": 419.58,
"r_x1": 1696.1,
"r_y1": 419.58,
"r_x2": 1696.1,
"r_y2": 349.42,
"r_x3": 234.09,
"r_y3": 349.42,
"coord_origin": "TOPLEFT"
},
"text": "JSON and Markdown in an easy self contained",
@@ -337,14 +337,14 @@
"a": 255
},
"rect": {
"r_x0": 242.29979922858777,
"r_y0": 509.8779072023336,
"r_x1": 513.3470125989277,
"r_y1": 509.8779072023336,
"r_x2": 513.3470125989277,
"r_y2": 439.9752910477536,
"r_x3": 242.29979922858777,
"r_y3": 439.9752910477536,
"r_x0": 242.3,
"r_y0": 509.88,
"r_x1": 513.35,
"r_y1": 509.88,
"r_x2": 513.35,
"r_y2": 439.98,
"r_x3": 242.3,
"r_y3": 439.98,
"coord_origin": "TOPLEFT"
},
"text": "package",
@@ -368,13 +368,13 @@
"id": 0,
"label": "text",
"bbox": {
"l": 234.08627147881114,
"t": 258.9040166758338,
"r": 1696.0985042090742,
"b": 509.8779072023336,
"l": 234.09,
"t": 258.9,
"r": 1696.1,
"b": 509.88,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9721011519432068,
"confidence": 0.972,
"cells": [
{
"index": 0,
@@ -385,14 +385,14 @@
"a": 255
},
"rect": {
"r_x0": 246.4065456254215,
"r_y0": 329.06770715202435,
"r_x1": 1691.991797818404,
"r_y1": 329.06770715202435,
"r_x2": 1691.991797818404,
"r_y2": 258.9040166758338,
"r_x3": 246.4065456254215,
"r_y3": 258.9040166758338,
"r_x0": 246.41,
"r_y0": 329.07,
"r_x1": 1691.99,
"r_y1": 329.07,
"r_x2": 1691.99,
"r_y2": 258.9,
"r_x3": 246.41,
"r_y3": 258.9,
"coord_origin": "TOPLEFT"
},
"text": "Docling bundles PDF document conversion to",
@@ -410,14 +410,14 @@
"a": 255
},
"rect": {
"r_x0": 234.08627147881114,
"r_y0": 419.5788697734327,
"r_x1": 1696.0985042090742,
"r_y1": 419.5788697734327,
"r_x2": 1696.0985042090742,
"r_y2": 349.4151792972422,
"r_x3": 234.08627147881114,
"r_y3": 349.4151792972422,
"r_x0": 234.09,
"r_y0": 419.58,
"r_x1": 1696.1,
"r_y1": 419.58,
"r_x2": 1696.1,
"r_y2": 349.42,
"r_x3": 234.09,
"r_y3": 349.42,
"coord_origin": "TOPLEFT"
},
"text": "JSON and Markdown in an easy self contained",
@@ -435,14 +435,14 @@
"a": 255
},
"rect": {
"r_x0": 242.29979922858777,
"r_y0": 509.8779072023336,
"r_x1": 513.3470125989277,
"r_y1": 509.8779072023336,
"r_x2": 513.3470125989277,
"r_y2": 439.9752910477536,
"r_x3": 242.29979922858777,
"r_y3": 439.9752910477536,
"r_x0": 242.3,
"r_y0": 509.88,
"r_x1": 513.35,
"r_y1": 509.88,
"r_x2": 513.35,
"r_y2": 439.98,
"r_x3": 242.3,
"r_y3": 439.98,
"coord_origin": "TOPLEFT"
},
"text": "package",