feat: support xlsm files (#1520)

* code for xlsm support

* updated support for xlsm

* updated code for xlsm support

* Update docling_parse_v4_backend.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update docling_parse_v4_backend.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update test_backend_msexcel_xlsm.py

 updated the tests/test_backend_msexcel_xlsm.py:

 have a function starting with test
removed all print statements
** To add an explicit assert {test}=={pred}

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update base_models.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update test_backend_msexcel.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update test_backend_msexcel_xlsm.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Update document_converter.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* Delete tests/test_backend_msexcel_xlsm.py

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* xlsm file

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>

* run tests

* ran tests

* Fix tests, upgrade XSLM example to a valid file

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>

---------

Signed-off-by: ShiroYasha18 <85089952+ShiroYasha18@users.noreply.github.com>
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
Co-authored-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
Ayraf
2025-06-10 20:25:59 +05:30
committed by GitHub
parent 6613b9e98b
commit df140227c3
19 changed files with 4834 additions and 632 deletions

View File

@@ -213,10 +213,10 @@
"prov": [
{
"bbox": [
139.6674041748047,
139.66741943359375,
322.5054626464844,
475.00927734375,
454.4546203613281
454.45458984375
],
"page": 1,
"span": [

View File

@@ -2646,7 +2646,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9373533129692078,
"confidence": 0.9373534917831421,
"cells": [
{
"index": 0,
@@ -2686,7 +2686,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.8858679533004761,
"confidence": 0.8858680725097656,
"cells": [
{
"index": 1,
@@ -2726,7 +2726,7 @@
"b": 152.90697999999998,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9806435108184814,
"confidence": 0.9806433916091919,
"cells": [
{
"index": 2,
@@ -2881,7 +2881,7 @@
"b": 255.42400999999995,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9850425124168396,
"confidence": 0.98504239320755,
"cells": [
{
"index": 7,
@@ -3096,7 +3096,7 @@
"b": 327.98218,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9591907262802124,
"confidence": 0.9591909050941467,
"cells": [
{
"index": 15,
@@ -3280,8 +3280,8 @@
"id": 0,
"label": "table",
"bbox": {
"l": 139.6674041748047,
"t": 337.5453796386719,
"l": 139.66741943359375,
"t": 337.54541015625,
"r": 475.00927734375,
"b": 469.4945373535156,
"coord_origin": "TOPLEFT"
@@ -7787,7 +7787,7 @@
"b": 518.17419,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9589295387268066,
"confidence": 0.9589294195175171,
"cells": [
{
"index": 91,
@@ -7852,7 +7852,7 @@
"b": 618.3,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9849976301193237,
"confidence": 0.9849975109100342,
"cells": [
{
"index": 93,
@@ -8184,8 +8184,8 @@
"id": 0,
"label": "table",
"bbox": {
"l": 139.6674041748047,
"t": 337.5453796386719,
"l": 139.66741943359375,
"t": 337.54541015625,
"r": 475.00927734375,
"b": 469.4945373535156,
"coord_origin": "TOPLEFT"
@@ -13582,7 +13582,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9373533129692078,
"confidence": 0.9373534917831421,
"cells": [
{
"index": 0,
@@ -13628,7 +13628,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.8858679533004761,
"confidence": 0.8858680725097656,
"cells": [
{
"index": 1,
@@ -13674,7 +13674,7 @@
"b": 152.90697999999998,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9806435108184814,
"confidence": 0.9806433916091919,
"cells": [
{
"index": 2,
@@ -13841,7 +13841,7 @@
"b": 255.42400999999995,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9850425124168396,
"confidence": 0.98504239320755,
"cells": [
{
"index": 7,
@@ -14062,7 +14062,7 @@
"b": 327.98218,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9591907262802124,
"confidence": 0.9591909050941467,
"cells": [
{
"index": 15,
@@ -14252,8 +14252,8 @@
"id": 0,
"label": "table",
"bbox": {
"l": 139.6674041748047,
"t": 337.5453796386719,
"l": 139.66741943359375,
"t": 337.54541015625,
"r": 475.00927734375,
"b": 469.4945373535156,
"coord_origin": "TOPLEFT"
@@ -19642,7 +19642,7 @@
"b": 518.17419,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9589295387268066,
"confidence": 0.9589294195175171,
"cells": [
{
"index": 91,
@@ -19713,7 +19713,7 @@
"b": 618.3,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9849976301193237,
"confidence": 0.9849975109100342,
"cells": [
{
"index": 93,
@@ -20057,7 +20057,7 @@
"b": 152.90697999999998,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9806435108184814,
"confidence": 0.9806433916091919,
"cells": [
{
"index": 2,
@@ -20224,7 +20224,7 @@
"b": 255.42400999999995,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9850425124168396,
"confidence": 0.98504239320755,
"cells": [
{
"index": 7,
@@ -20445,7 +20445,7 @@
"b": 327.98218,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9591907262802124,
"confidence": 0.9591909050941467,
"cells": [
{
"index": 15,
@@ -20635,8 +20635,8 @@
"id": 0,
"label": "table",
"bbox": {
"l": 139.6674041748047,
"t": 337.5453796386719,
"l": 139.66741943359375,
"t": 337.54541015625,
"r": 475.00927734375,
"b": 469.4945373535156,
"coord_origin": "TOPLEFT"
@@ -26025,7 +26025,7 @@
"b": 518.17419,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9589295387268066,
"confidence": 0.9589294195175171,
"cells": [
{
"index": 91,
@@ -26096,7 +26096,7 @@
"b": 618.3,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9849976301193237,
"confidence": 0.9849975109100342,
"cells": [
{
"index": 93,
@@ -26440,7 +26440,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.9373533129692078,
"confidence": 0.9373534917831421,
"cells": [
{
"index": 0,
@@ -26486,7 +26486,7 @@
"b": 102.78223000000003,
"coord_origin": "TOPLEFT"
},
"confidence": 0.8858679533004761,
"confidence": 0.8858680725097656,
"cells": [
{
"index": 1,