Skip to main content

No project description provided

Project description

Table Metrics

Table Metrics is a Python library implementing widely used evaluation metrics for table extraction and table structure recognition tasks.

Currently supported metrics:

  • GriTS - Grid Table Similarity (arXiv:2203.12555)

    • GriTS_Top – topology / structure similarity

    • GriTS_Con – cell content similarity

    • GriTS_Loc – spatial (layout) similarity using bounding boxes

  • TEDS – Tree Edit Distance-based Similarity (arXiv:2208.00385)

Installation

pip install table-metrics

Quick Start

from docling.document_converter import DocumentConverter
from table_metrics import (
    grits_top_score,
    grits_con_score,
    teds_score,
)


converter = DocumentConverter()
doc = converter.convert("your.pdf")

extracted_html_table = doc.document.tables[0].export_to_html()
true_html_table = (
    "<table><tr><td>We</td><td>love</td><td>open</td><td>source</td></tr></table>"
)

print("GriTS_Top:", grits_top_score(true_html_table, extracted_html_table))
print("GriTS_Con:", grits_con_score(true_html_table, extracted_html_table))
print("TEDS:", teds_score(true_html_table, extracted_html_table))

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

table_metrics-0.1.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

table_metrics-0.1.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file table_metrics-0.1.0.tar.gz.

File metadata

  • Download URL: table_metrics-0.1.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.1 Windows/11

File hashes

Hashes for table_metrics-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9b046cdb6f2681537926f96d3bf65513e27bbf378f833e032b33e9e878882501
MD5 18800f254102aad22909f9b1bf9cafdc
BLAKE2b-256 f068b01567e192e0748846d6abfe46375181d494e21913fb391daa16ceafb5e9

See more details on using hashes here.

File details

Details for the file table_metrics-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: table_metrics-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.13.1 Windows/11

File hashes

Hashes for table_metrics-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a54e7ee399e395effb3cc4d49fc04366a6ea887584a3941ce86acf8acd8ecd1
MD5 c22f39d87331b960c8af75c4efb62a1c
BLAKE2b-256 23ecd9605937616c76af8a646a96aaa9fc4b65c19de7f0edb397dcc068aa1b2f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page