Langsung ke konten
Skillpedia
PDF, Word & slide9.5k ยท #12271

xberg-extracting-tables

Fungsinya

Skill ini menunjukkan cara mengambil tabel dari dokumen dengan deteksi tata letak. Skill ini ditujukan untuk orang yang membutuhkan laporan keuangan, faktur, atau tabel penelitian dalam bentuk yang bisa dipakai.

Kapan dipakai

  • โœ“Saat Anda membutuhkan tabel dari laporan PDF, faktur, atau laporan keuangan.
  • โœ“Saat Anda ingin data tabel dalam markdown yang bersih agar bisa dibaca AI.
  • โœ“Saat Anda membutuhkan nilai sel yang tepat dalam file terstruktur untuk perangkat lunak lain.

Link skill

https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-tables/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-tables/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œAmbil semua tabel dari PDF laporan keuangan ini sebagai file terstruktur yang bisa saya buka di spreadsheet.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent mengaktifkan deteksi tata letak agar alat menemukan batas tabel, lalu mengembalikan tabel markdown di dalam teks atau daftar sel terstruktur, sesuai keluaran yang Anda pilih.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Extracting tables

Use this when the user wants structured tabular data โ€” financial statements, scientific tables, invoices, spreadsheet-style PDFs. Xberg detects tables via a layout model (RT-DETR v2) and reconstructs cell structure with a configurable table model.

Basic usage

# Markdown tables embedded in the content stream
xberg extract report.pdf --layout --content-format markdown

# Structured JSON output, tables appear under result.tables
xberg extract report.pdf --layout --format json

--layout turns on layout-aware extraction; without it, tables fall back to plain text reflow and you lose cell boundaries.

Output shapes

Two surfaces, picked via --format (CLI shape) and --content-format (content rendering):

  • Markdown tables in content โ€” --content-format markdown. Tables appear inline as | col | col | blocks. Good for LLM ingestion.
  • Structured tables array โ€” --format json. Each entry has cells[][] (rows ร— cols), markdown (pre-rendered), page_number, bounding_box. Use this when downstream code needs exact cell access. (bounding_box is omitted when no position data is available.)

Both are populated at once when --layout is on. The tables array is always structured; the content stream switches representation.

xberg extract financials.pdf --layout --format json \
  | jq '.result.tables[] | {page: .page_number, rows: (.cells | length)}'

Table models

--layout-table-model picks the reconstruction backend:

Model Best for Notes
tatr dense complex tables (academic, financial) Default. Heaviest, highest accuracy.
slanet_auto dispatches per-table to wired/wireless Good when table styles are mixed.
slanet_wired tables with visible borders Faster than tatr.
slanet_wireless tables without borders (whitespace-separated) For invoices, simple grids.
slanet_plus hybrid wired / wireless Lighter than slanet_auto.
disabled layout detection only, no table structure Use to skip table model cost.
xberg extract bank-statement.pdf \
  --layout --layout-table-model tatr --content-format markdown

Drop --layout-confidence when the layout model misses tables (default threshold ~0.5):

xberg extract noisy-scan.pdf --layout --layout-confidence 0.3

Spreadsheets

.xlsx, .ods, .csv, .tsv are extracted by dedicated parsers โ€” no layout model needed. Each sheet becomes a markdown table (or structured table) automatically:

xberg extract workbook.xlsx --content-format markdown
xberg extract data.csv --format json

Pass --no-cache=true only when iterating on the same file with different configs.

Config file alternative

# `output_format` in config files equals `--content-format` on the CLI.
output_format = "markdown"

[layout]
confidence_threshold = 0.5
table_model = "tatr"

Then:

xberg extract report.pdf --format json

Programmatic access

From Python, structured tables live on the document in the result envelope (result.results[0].tables):

from xberg import ExtractInput, extract, ExtractionConfig, LayoutDetectionConfig

config = ExtractionConfig(
    layout=LayoutDetectionConfig(table_model="tatr"),
    output_format="markdown",
)
result = await extract(ExtractInput(uri="report.pdf"), config)
for table in result.results[0].tables:
    print(table.markdown)        # rendered markdown
    print(table.cells[0][0])     # cell access

Node.js mirrors this (extract, output.results[0].tables, camelCase fields). See ../../references/python-api.md and ../../references/nodejs-api.md for full type signatures.

Known limitations

  • Merged cells โ€” reconstructed as repeated values across the spanned region; the merge is not preserved as metadata.
  • Rotated tables โ€” enable --ocr-auto-rotate true for image-based PDFs before extraction.
  • Nested tables โ€” flattened. Detection succeeds; structural nesting is lost.
  • **Multi-page table
Pertanyaan umum

Mengapa pengaturan tata letak perlu diaktifkan?

Tanpa pengaturan itu, tabel diatur ulang sebagai teks biasa dan batas sel hilang.

Keluaran mana yang sebaiknya dipilih?

Tabel markdown cocok untuk dibaca AI, sedangkan daftar terstruktur cocok untuk perangkat lunak yang membutuhkan sel yang tepat.

Apakah tabelnya selalu tepat?

Tidak. Skill mencantumkan batasan yang diketahui, jadi periksa hasilnya terhadap dokumen asli.

Detail

Deskripsi asli dari pembuat

Use when extracting tabular data from PDFs, spreadsheets, or images. Covers layout-aware table detection, table model selection, output formats (markdown / JSON cells), and known limits.

repo: xberg-io/xberg

Popularitas

Bintang GitHub
9.5k
Peringkat
#12271
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa