본문으로 건너뛰기
Skillpedia
PDF, Word, 슬라이드9.5k · #12271

xberg-extracting-tables

하는 일

이 스킬은 레이아웃 인식을 사용해 문서에서 표를 가져오는 방법을 보여 줍니다. 재무제표, 청구서, 연구 표를 쓸 수 있는 형태로 얻어야 하는 사람을 위한 것입니다.

사용하는 경우

  • ✓PDF 보고서, 청구서, 재무제표에서 표가 필요할 때.
  • ✓AI가 읽을 수 있도록 표 데이터를 깔끔한 마크다운으로 얻고 싶을 때.
  • ✓다른 소프트웨어가 쓸 수 있도록 정확한 셀 값을 구조화된 파일로 얻어야 할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-tables/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 재무제표 PDF의 모든 표를 스프레드시트에서 열 수 있는 구조화된 파일로 뽑아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 도구가 표 경계를 찾도록 레이아웃 감지를 켠 뒤, 선택한 출력 형식에 따라 텍스트 안의 마크다운 표나 셀의 구조화된 목록을 돌려줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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
자주 묻는 질문

레이아웃 설정을 왜 켜나요?

이 설정이 없으면 표가 일반 텍스트로 흘러 나오고 셀의 경계가 사라집니다.

어떤 출력을 골라야 하나요?

마크다운 표는 AI가 읽기에 적합하고, 구조화된 목록은 정확한 셀이 필요한 소프트웨어에 적합합니다.

표를 항상 정확히 얻나요?

아니요. 이 스킬은 알려진 한계를 적어 두므로, 결과를 원본 문서와 대조해 확인하세요.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
9.5k
순위
#12271
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬