SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.07502 · 2024

ClusterTabNet: Supervised clustering method for table detection and table structure recognition

arXiv · PDF · Open in the Atlas

Code that ran

16 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 12 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.07502.json · badge: /api/ran/2402.07502.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
sap-samples/clustertabnet canonical (classifier label)
classifier basis: census
16 ran · 0 no recorded run
FunctionStatusWhere it lives
all_gather Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/train/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from kellyiss/situformer, is pointer only (licence: NONE) · get_code("aa6da43d05cfaf65")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from kellyiss/situformer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

alternative_clustering Ran
ran, honoured the contract we drafted
sap-samples/clustertabnet/train/table_extraction.py
code served (permissive licence) · get_code("29033eca01a298ea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family int, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a prediction matrix
# The function expects a square matrix (n x n) where n is the number of elements
# We'll create a small 4x4 prediction matrix with values that will trigger clustering
np.random.seed(0)
preds = np.array([
    [2.5, 1.2, 0.3, 0.1],
    [1.1, 2.4, 0.2, 0.05],
    [0.4, 0.3, 2.6, 1.3],
    [0.2, 0.1, 1.2, 2.5]
], dtype=np.float32)

ARGS = {
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bounding_boxes_of_rotated_boxes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/train_data_preparation/bbox.py
code served (permissive licence) · get_code("a36f1ea807e4020b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small batch of rotated bounding boxes
# Shape should be (N, 4, 2) where N is number of boxes, 4 is number of corners, 2 is (x, y) coordinates
# Using batch size 2, so shape is (2, 4, 2)
b = np.array([
    # First rotated box with 4 corner points
    [
        [1.0, 2.0],   # top-left
        [3.0, 1.0],   # top-right
        [4.0, 4.0],   # bottom-right
        [2.0, 5.0]    # bottom-left
    ],
    # Second rotated box with 4 corner points
    [
        [5.0, 6.0],
        [7.0, 5.0],
        [8.0, 8.0],
        [6.0, 9.0]
    ]
], dtype=np.float32)

ARGS = {
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
collate_fn Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/train/util.py
code served (permissive licence) · get_code("5765519a06dcbdbd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from typing import List

torch.manual_seed(0)

# Build a batch: list of tuples where each tuple is (image_tensor, label)
# Images need to be 3D tensors (C, H, W) based on the function checking tensor_list[0].ndim == 3

# Create images of different sizes to test the padding logic
img1 = torch.randn(3, 4, 5)  # (C=3, H=4, W=5)
img2 = torch.randn(3, 6, 7)  # (C=3, H=6, W=7)

label1 = 0
label2 = 1

# batch is a list of (image, label) tuples
batch = [(img1, label1), (img2, label2)]

ARGS = {
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_intersection_batch_parallel Ran
ran, honoured the contract we drafted
sap-samples/clustertabnet/train_data_preparation/bbox.py
code served (permissive licence) · get_code("3f4039d4e717c983")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample bounding boxes in (x1, y1, x2, y2) format
# b1: 2 boxes
b1 = np.array([
    [10, 20, 30, 40],
    [15, 25, 35, 45]
], dtype=np.float32)

# b2: 3 boxes
b2 = np.array([
    [20, 30, 40, 50],
    [5, 10, 25, 35],
    [25, 30, 45, 55]
], dtype=np.float32)

ARGS = {
    'b1': b1,
    'b2': b2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_to_xywh Ran
ran, honoured the contract we drafted
sap-samples/clustertabnet/train/coco_eval.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yuhangzang/contextdet, is pointer only (licence: NOASSERTION) · get_code("f31a58bf6457ced5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yuhangzang/contextdet, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

estimate_min_angle Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/train_data_preparation/bbox.py
code served (permissive licence) · get_code("c5f2f85533847d03")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small batch of rotated bounding boxes
# Shape: (N, 4, 2) where N=2 boxes, each with 4 points in 2D
# Points are sequentially ordered (clockwise or counter-clockwise)
np.random.seed(0)

# Create 2 bounding boxes, each with 4 corner points in 2D
box1 = np.array([
    [0.0, 0.0],      # point 0
    [1.0, 0.5],      # point 1
    [1.5, 1.5],      # point 2
    [0.5, 1.0]       # point 3
])

box2 = np.array([
    [2.0, 2.0],      # point 0
    [3.0, 2.2],      # point 1
    [3.2, 3.2],      # point 2
    [2.2, 3.0]       # point 3
])

# Stack into shape (2, 4, 2)
b = np.stack([box1, box2], axis=0)

ARGS = {
    "b": b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/train/coco_eval.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from yuhangzang/contextdet, is pointer only (licence: NOASSERTION) · get_code("fe0ddcc2d420c9a0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from yuhangzang/contextdet, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_angle Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/utils/table.py
code served (permissive licence) · get_code("c02ce6c44f07d3c6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct valid arguments for get_angle function
# The function expects:
# - id: an integer index
# - boxes: a numpy array of shape (batch_size, num_boxes, 2) where it accesses boxes[:, id+1, :] and boxes[:, id, :]

# Create a batch of boxes
# Shape: (batch_size=2, num_boxes=4, coordinates=2)
# This allows us to access boxes[:, id, :] and boxes[:, id+1, :] safely
boxes = np.array([
    [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]],
    [[2.0, 3.0], [4.0, 5.0], [6.0, 7.0], [8.0, 9.0]]
], dtype=np.float32)

# id should be a valid index such that id+1 < num_boxes
# Since we have 4 boxes (indices 0-3), id can be 0, 1, or 2
id = 1

ARGS = {
    'id': id,
    'boxes': boxes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_image_and_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/evaluation/debug_output/save_and_plot.py
code served (permissive licence) · get_code("0eac6fdc0b1a9a63")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from PIL import Image
import io

# Create a small test image as a numpy array
# Shape: (height, width, channels) - using (4, 3, 1) for distinct dimensions
test_image_array = np.random.rand(4, 3, 1)

# Create a test image file as bytes in memory
test_pil_image = Image.new('RGB', (4, 3), color='red')
image_bytes = io.BytesIO()
test_pil_image.save(image_bytes, format='PNG')
image_bytes.seek(0)
image_bytes_data = image_bytes.getvalue()

ARGS = {
    'image': test_image_array,
    'image_filename': image_bytes_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_page_ids Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/train_data_preparation/tables_dataset.py
code served (permissive licence) · get_code("d084e679aa5e2ce1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import json
from pathlib import Path

# Create temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create root directories
root1 = os.path.join(temp_dir, 'root1')
root2 = os.path.join(temp_dir, 'root2')
os.makedirs(root1)
os.makedirs(root2)

# Create dataset_type subdirectories and JSON files
dataset_type = 'annotations'
for root in [root1, root2]:
    ds_dir = os.path.join(root, dataset_type)
    os.makedirs(ds_dir, exist_ok=True)
    # Create some JSON files
    with open(os.path.join(ds_dir, 'page1.json'), 'w') as f:
        json.dump({'data': 'test'}, f)
    with open(os.path.join(ds_dir, 'page2.json'), 'w') as f:
        json.dump({'data': 'test'}, f)

# Create image directories and image files
for root in [root1, root2]:
    img_dir = os.path.join(root, 'images')
    os.makedirs(img_dir, exist_ok=True)
    # Create dummy image files
    Path(os.path.join(img_dir, 'page1.jpg')).touch()
    Path(os.path.join(img_dir, 'page2.png')).touch()

# Create OCR labels folder and OCR JSON files
ocr_labels_folder = 'ocr_labels'
for root in [root1, root2]:
    ocr_dir = os.path.join(root, ocr_labels_folder)
    os.makedirs(ocr_dir, exist_ok=True)
    # Create OCR files matching the page IDs
    with open(os.path.join(ocr_dir, 'page1_words.json'), 'w') as f:
        json.dump({'words': []}, f)
    with open(os.path.join(ocr_dir, 'page2.ocr.json'), 'w') as f:
        json.dump({'words': []}, f)

ARGS = {
    'roots': [root1, root2],
    'dataset_type': dataset_type,
    'ocr_labels_folder': ocr_labels_folder
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_side_length Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/utils/table.py
code served (permissive licence) · get_code("c6ac3547792b8c2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Test case 1: boxes with shape (batch, 2, 4) - 2 box corners, 4D coordinates
# This triggers the first branch: boxes.shape[1] == 4 is False, so goes to return statement
# Actually, let me re-read: boxes.shape[1] == 4 checks second dimension
# If shape is (batch, 4, something), first branch executes
# If shape is (batch, 2, 4), then boxes.shape[1] == 2, goes to second branch

# Let me trace through:
# First branch: boxes[:, id+1, :] - boxes[:, id, :] requires at least id+1 < boxes.shape[1]
# This suggests boxes is (batch_size, num_points, coord_dim)
# Second branch: boxes[:, 1, id] - boxes[:, 0, id] requires boxes.shape[1] >= 2
# This also suggests (batch_size, num_points, coord_dim) but shape[1] != 4

# Let's provide both valid cases:

# Case: boxes.shape[1] == 4 (first branch)
boxes_case1 = np.random.randn(2, 4, 3)  # batch=2, 4 points, 3D coords
id_case1 = 1

# Case: boxes.shape[1] != 4 (second branch)
boxes_case2 = np.random.randn(2, 2, 5)  # batch=2, 2 points, 5D coords
id_case2 = 2

# Use case 1 as default
ARGS = {
    "id": 1,
    "boxes": np.array([
        [[0.0, 0.0, 0.0], [1.0, 1.0, 1.0], [2.0, 2.0, 2.0], [3.0, 3.0, 3.0]],
        [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0], [3.0, 3.0, 3.0], [4.0, 4.0, 4.0]]
    ])  # shape (2, 4, 3)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reduce_dict Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/train/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from kellyiss/situformer, is pointer only (licence: NONE) · get_code("05992505df9ef0cd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from kellyiss/situformer, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_based_on_exif Ran
ran, violated the contract we drafted
sap-samples/clustertabnet/evaluation/debug_output/save_and_plot.py
code served (permissive licence) · get_code("3486f5c9f5c57b11")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Image. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from PIL import Image
import io

# Create a minimal PIL Image with EXIF data
# We'll create a simple RGB image and add EXIF orientation metadata
img = Image.new('RGB', (100, 100), color='red')

# Create EXIF data with orientation tag (274)
# Orientation value 6 means 90 degrees clockwise (a common case)
exif_dict = {274: 6}

# For PIL Images, we need to simulate EXIF data
# We'll create a new image and manually set its exif attribute
# using PIL's Exif class if available, otherwise just use the image as-is
try:
    from PIL.Image import Exif
    exif = Exif()
    exif[274] = 6
    img.info['exif'] = exif.tobytes()
except (ImportError, AttributeError):
    # Fallback: just use the image without explicit EXIF setting
    # The function will still work, just won't rotate
    pass

# Alternative approach: create image with EXIF orientation
# by using a temporary approach that PIL understands
simple_img = Image.new('RGB', (50, 50), color='blue')

ARGS = {
    'img': simple_img
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
thumbnail Ran
ran; our contract draft was wrong, not the code
sap-samples/clustertabnet/evaluation/debug_output/save_and_plot.py
code served (permissive licence) · get_code("a1669488e47d595a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Image. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from PIL import Image

# Create a small test image
image = Image.new('RGB', (1920, 1080))

ARGS = {
    'image': image,
    'max_size': 1500
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
validate_coco Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sap-samples/clustertabnet/train/table_extraction.py
code served (permissive licence) · get_code("29505c7172ecd328")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock CocoEvaluator to avoid import errors
class MockCocoEval:
    def __init__(self):
        self.stats = np.array([0.5, 0.6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7, 0.0, 0.0, 0.0])

class MockCocoEvaluator:
    def __init__(self, valid_dataset, eval_types):
        self.valid_dataset = valid_dataset
        self.coco_eval = {'bbox': MockCocoEval()}
    
    def update(self, results):
        pass
    
    def synchronize_between_processes(self):
        pass
    
    def accumulate(self):
        pass
    
    def summarize(self):
        pass

# Mock the import
import sys
from types import ModuleType
mock_train = ModuleType('train')
mock_coco_eval = ModuleType('coco_eval')
mock_coco_eval.CocoEvaluator = MockCocoEvaluator
mock_train.coco_eval = mock_coco_eval
sys.modules['train'] = mock_train
sys.modules['train.coco_eval'] = mock_coco_eval

# Create a minimal valid_dataset mock
class MockDataset:
    def __init__(self):
        self.coco_eval_n_classes = 80
    
    def __len__(self):
        return 2

valid_dataset = MockDataset()

# Create prediction data structures
# 2 images, variable number of detections
pred_boxes = {
    0: [[10.0, 20.0, 100.0, 150.0], [50.0, 60.0, 120.0, 180.0]],  # 2 boxes for image 0
    1: [[5.0, 15.0, 95.0, 145.0]]  # 1 box for image 1
}

pred_classes = {
    0: [1, 3],  # 2 class labels for image 0
    1: [2]  # 1 class label for image 1
}

pred_probs = {
    0: [0.95, 0.87],  # 2 confidence scores for image 0
    1: [0.92]  # 1 confidence score for image 1
}

ARGS = {
    'valid_dataset': valid_dataset,
    'pred_boxes': pred_boxes,
    'pred_classes': pred_classes,
    'pred_probs': pred_probs,
    'restrict_to_classes': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, train — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 5 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
reduce_dict 33 other papers
27 dated earlier, 5 later, 1 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
2007.02419 (2020-07)
Attention-based Joint Detection of Object and Semantic Part
and 30 more not named here
all_gather 30 other papers
22 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
2007.02419 (2020-07)
Attention-based Joint Detection of Object and Semantic Part
and 27 more not named here
convert_to_xywh 24 other papers
19 dated earlier, 4 later, 1 same year, order not determinable
1512.02325 (2015-12)
SSD: Single Shot MultiBox Detector
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 21 more not named here
evaluate 23 other papers
18 dated earlier, 4 later, 1 same year, order not determinable
1512.02325 (2015-12)
SSD: Single Shot MultiBox Detector
2010.04159 (2020-10)
Deformable DETR: Deformable Transformers for End-to-End Object Detection
2103.11731 (2021-03)
Meta-DETR: Image-Level Few-Shot Object Detection with Inter-Class Correlation Exploitation
and 20 more not named here
collate_fn 16 other papers
13 dated earlier, 3 later
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
2104.00969 (2021-04)
TubeR: Tubelet Transformer for Video Action Detection
2104.08541 (2021-04)
TransVG: End-to-End Visual Grounding with Transformers
and 13 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present a novel deep-learning-based method to cluster words in documents which we apply to detect and recognize tables given the OCR output. We interpret table structure bottom-up as a graph of relations between pairs of words (belonging to the same row, column, header, as well as to the same table) and use a transformer encoder model to predict its adjacency matrix. We demonstrate the performance of our method on the PubTables-1M dataset as well as PubTabNet and FinTabNet datasets. Compared to the current state-of-the-art detection methods such as DETR and Faster R-CNN, our method achieves similar or better accuracy, while requiring a significantly smaller model.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.07502")
get_code_for_paper("2402.07502")
have("2402.07502")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2402.07502.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2402.07502.svg)](https://syntology.ai/paper/2402.07502)

Connect an agent — have() is free.