jpskill.com
📄 ドキュメント コミュニティ

doc-parser

複雑なレイアウトの文書や表、図を含むPDFから、必要な情報を構造化データとして抽出したり、論文の内容を解析したりするなど、様々な形式の文書を解析してビジネスに活用できる情報を取り出すSkill。

📜 元の英語説明(参考)

Parse complex documents with IBM docling. Use when a user asks to parse a document with tables, extract figures from a document, handle multi-column layouts, convert a complex PDF to structured data, extract content from academic papers, or process documents with mixed layouts. Handles tables, figures, headers, footers, and multi-column text.

🇯🇵 日本人クリエイター向け解説

一言でいうと

複雑なレイアウトの文書や表、図を含むPDFから、必要な情報を構造化データとして抽出したり、論文の内容を解析したりするなど、様々な形式の文書を解析してビジネスに活用できる情報を取り出すSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o doc-parser.zip https://jpskill.com/download/14841.zip && unzip -o doc-parser.zip && rm doc-parser.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/14841.zip -OutFile "$d\doc-parser.zip"; Expand-Archive "$d\doc-parser.zip" -DestinationPath $d -Force; ri "$d\doc-parser.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して doc-parser.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → doc-parser フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

ドキュメントパーサー

概要

IBMの docling ライブラリを使用して、テーブル、図、複数段組みレイアウト、ヘッダー、および混合コンテンツを含む複雑なドキュメントを解析します。このスキルは、ドキュメント構造を理解し、レイアウト領域を検出し、複雑な書式設定全体で論理的な読み取り順序を維持することにより、単純なテキスト抽出を超えています。

手順

ユーザーが複雑なドキュメントを解析したり、テーブル、図、または複数段組みレイアウトを含むドキュメントから構造化されたコンテンツを抽出したりするように要求した場合、次の手順に従います。

ステップ 1: docling のインストール

pip install docling

ステップ 2: ドキュメントのロードと変換

docling の DocumentConverter を使用してドキュメントを解析します。

from docling.document_converter import DocumentConverter

def parse_document(file_path):
    converter = DocumentConverter()
    result = converter.convert(file_path)
    return result

サポートされている入力形式: PDF, DOCX, PPTX, HTML, 画像 (PNG, JPG)。

ステップ 3: 目的の形式へのエクスポート

Markdown としてエクスポート (見出し、テーブル、リストを保持):

def to_markdown(result):
    return result.document.export_to_markdown()

構造化された JSON としてエクスポート (ドキュメントツリー全体):

import json

def to_json(result):
    doc_dict = result.document.export_to_dict()
    return json.dumps(doc_dict, indent=2)

テーブルのみを抽出:

def extract_tables(result):
    tables = []
    for table in result.document.tables:
        df = table.export_to_dataframe()
        tables.append(df)
    return tables

ステップ 4: 特定のコンテンツタイプの処理

テーブルの場合: 各テーブルを pandas DataFrame または CSV としてエクスポートします。

import pandas as pd

def save_tables(result, output_dir="."):
    for i, table in enumerate(result.document.tables):
        df = table.export_to_dataframe()
        output_path = f"{output_dir}/table_{i+1}.csv"
        df.to_csv(output_path, index=False)
    return f"Saved {len(result.document.tables)} tables"

図の場合: 図のメタデータとキャプションを抽出します。

def extract_figures(result):
    figures = []
    for item in result.document.items:
        if hasattr(item, 'image') and item.image:
            figures.append({
                "caption": getattr(item, 'caption', 'No caption'),
                "page": getattr(item, 'page_no', None)
            })
    return figures

ステップ 5: 結果の提示

ユーザーのニーズに基づいて出力をフォーマットします。

  • ドキュメント全体: すべてのコンテンツが保持された Markdown エクスポート
  • テーブルのみ: CSV ファイルまたはフォーマットされた Markdown テーブル
  • 概要: セクション見出しと見つかったコンテンツタイプを含むドキュメント構造のアウトライン
  • 特定のセクション: 見出しまたはページ範囲でターゲットを絞った部分を抽出

例 1: 学術論文の解析

ユーザーリクエスト: "この研究論文を解析して、すべてのテーブルを抽出してください: paper.pdf"

実行されたアクション:

  1. docling を使用して paper.pdf を変換
  2. 12 ページにわたって 4 つのテーブルを特定
  3. 各テーブルを CSV としてエクスポート

出力:

Parsed paper.pdf (12 pages)

Document structure:
  - Title: "Machine Learning Approaches for Climate Prediction"
  - Sections: Abstract, Introduction, Methods, Results, Discussion, References
  - Tables found: 4
  - Figures found: 6

Tables extracted:
  1. table_1.csv - "Dataset Characteristics" (5 cols, 8 rows) - Page 4
  2. table_2.csv - "Model Hyperparameters" (4 cols, 12 rows) - Page 6
  3. table_3.csv - "Performance Comparison" (6 cols, 5 rows) - Page 8
  4. table_4.csv - "Ablation Study Results" (5 cols, 7 rows) - Page 9

All tables saved to current directory.

例 2: 財務レポートを Markdown に変換

ユーザーリクエスト: "この四半期レポートを Markdown に変換して編集できるようにしてください: Q3-report.pdf"

実行されたアクション:

  1. docling で Q3-report.pdf を解析 (複数段組みレイアウトを処理)
  2. 構造を保持したクリーンな Markdown としてエクスポート

出力:

Converted Q3-report.pdf to Markdown

Document details:
  - Pages: 24
  - Layout: Multi-column (2-column on pages 3-20)
  - Tables: 8 (all converted to Markdown tables)
  - Figures: 5 (referenced with captions)
  - Sections: 12 headings detected

Output saved to: Q3-report.md (14,200 words)

The multi-column layout has been linearized into single-column reading order.
All tables are preserved as Markdown tables.

例 3: 請求書から構造化されたデータを抽出

ユーザーリクエスト: "この請求書を解析して、明細項目を JSON として教えてください"

実行されたアクション:

  1. docling で invoice.pdf を解析
  2. メインの明細項目テーブルを特定
  3. 構造化された JSON としてエクスポート

出力:

{
  "invoice_number": "INV-2024-0847",
  "date": "2024-11-15",
  "vendor": "Acme Supplies Inc.",
  "line_items": [
    {"item": "Office Chairs", "qty": 10, "unit_price": 299.99, "total": 2999.90},
    {"item": "Standing Desks", "qty": 5, "unit_price": 549.00, "total": 2745.00},
    {"item": "Monitor Arms", "qty": 15, "unit_price": 89.50, "total": 1342.50}
  ],
  "subtotal": 7087.40,
  "tax": 637.87,
  "total": 7725.27
}

ガイドライン

  • docling は、複数段組みテキスト、ネストされたテーブル、混合コンテンツなど、複雑なレイアウトを自動的に処理します。重労働は docling に任せてください。
  • 非常に大きなドキュメント (200 ページ以上) の場合は、メモリを管理するためにセクションごとに処理します。
  • テーブルに結合されたセルまたは不規則な構造がある場合は、DataFrame 出力を検証し、解析の異常をフラグ付けします。
  • 人間が読める出力には Markdown エクスポートを、プログラムで使用するには JSON/dict エクスポートを推奨します。
  • docling のインストールまたは特定の形式の解析に失敗した場合は、PDF の場合は pdfplumber、DOCX ファイルの場合は python-docx にフォールバックします。
  • 詳細な出力の前に、ドキュメント構造 (セクション、テーブル、見つかった図) を常に報告して、ユーザーが何が利用可能かを知ることができるようにします。
  • テキストレイヤーのないスキャンされたドキュメントの場合、docling は組み込みの OCR を使用する場合があります。品質が低い場合は、より良い前処理のために pdf-ocr スキルを提案してください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Document Parser

Overview

Parse complex documents containing tables, figures, multi-column layouts, headers, and mixed content using IBM's docling library. This skill goes beyond simple text extraction by understanding document structure, detecting layout regions, and preserving the logical reading order across complex formatting.

Instructions

When a user asks to parse a complex document or extract structured content from a document with tables, figures, or multi-column layouts, follow these steps:

Step 1: Install docling

pip install docling

Step 2: Load and convert the document

Use docling's DocumentConverter to parse the document:

from docling.document_converter import DocumentConverter

def parse_document(file_path):
    converter = DocumentConverter()
    result = converter.convert(file_path)
    return result

Supported input formats: PDF, DOCX, PPTX, HTML, images (PNG, JPG).

Step 3: Export to the desired format

Export as Markdown (preserves headings, tables, lists):

def to_markdown(result):
    return result.document.export_to_markdown()

Export as structured JSON (full document tree):

import json

def to_json(result):
    doc_dict = result.document.export_to_dict()
    return json.dumps(doc_dict, indent=2)

Extract only tables:

def extract_tables(result):
    tables = []
    for table in result.document.tables:
        df = table.export_to_dataframe()
        tables.append(df)
    return tables

Step 4: Handle specific content types

For tables: Export each table as a pandas DataFrame or CSV:

import pandas as pd

def save_tables(result, output_dir="."):
    for i, table in enumerate(result.document.tables):
        df = table.export_to_dataframe()
        output_path = f"{output_dir}/table_{i+1}.csv"
        df.to_csv(output_path, index=False)
    return f"Saved {len(result.document.tables)} tables"

For figures: Extract figure metadata and captions:

def extract_figures(result):
    figures = []
    for item in result.document.items:
        if hasattr(item, 'image') and item.image:
            figures.append({
                "caption": getattr(item, 'caption', 'No caption'),
                "page": getattr(item, 'page_no', None)
            })
    return figures

Step 5: Present the results

Format output based on user needs:

  • Full document: Markdown export with all content preserved
  • Tables only: CSV files or formatted markdown tables
  • Summary: Document structure outline with section headings and content types found
  • Specific sections: Extract targeted parts by heading or page range

Examples

Example 1: Parse an academic paper

User request: "Parse this research paper and extract all the tables: paper.pdf"

Actions taken:

  1. Convert paper.pdf using docling
  2. Identify 4 tables across 12 pages
  3. Export each table as CSV

Output:

Parsed paper.pdf (12 pages)

Document structure:
  - Title: "Machine Learning Approaches for Climate Prediction"
  - Sections: Abstract, Introduction, Methods, Results, Discussion, References
  - Tables found: 4
  - Figures found: 6

Tables extracted:
  1. table_1.csv - "Dataset Characteristics" (5 cols, 8 rows) - Page 4
  2. table_2.csv - "Model Hyperparameters" (4 cols, 12 rows) - Page 6
  3. table_3.csv - "Performance Comparison" (6 cols, 5 rows) - Page 8
  4. table_4.csv - "Ablation Study Results" (5 cols, 7 rows) - Page 9

All tables saved to current directory.

Example 2: Convert a financial report to Markdown

User request: "Convert this quarterly report to Markdown so I can edit it: Q3-report.pdf"

Actions taken:

  1. Parse Q3-report.pdf with docling (handles multi-column layout)
  2. Export as clean Markdown preserving structure

Output:

Converted Q3-report.pdf to Markdown

Document details:
  - Pages: 24
  - Layout: Multi-column (2-column on pages 3-20)
  - Tables: 8 (all converted to Markdown tables)
  - Figures: 5 (referenced with captions)
  - Sections: 12 headings detected

Output saved to: Q3-report.md (14,200 words)

The multi-column layout has been linearized into single-column reading order.
All tables are preserved as Markdown tables.

Example 3: Extract structured data from an invoice

User request: "Parse this invoice and give me the line items as JSON"

Actions taken:

  1. Parse invoice.pdf with docling
  2. Identify the main line items table
  3. Export as structured JSON

Output:

{
  "invoice_number": "INV-2024-0847",
  "date": "2024-11-15",
  "vendor": "Acme Supplies Inc.",
  "line_items": [
    {"item": "Office Chairs", "qty": 10, "unit_price": 299.99, "total": 2999.90},
    {"item": "Standing Desks", "qty": 5, "unit_price": 549.00, "total": 2745.00},
    {"item": "Monitor Arms", "qty": 15, "unit_price": 89.50, "total": 1342.50}
  ],
  "subtotal": 7087.40,
  "tax": 637.87,
  "total": 7725.27
}

Guidelines

  • Docling handles complex layouts automatically including multi-column text, nested tables, and mixed content. Let it do the heavy lifting.
  • For very large documents (200+ pages), process in sections to manage memory.
  • When tables have merged cells or irregular structures, validate the DataFrame output and flag any parsing anomalies.
  • Prefer Markdown export for human-readable output and JSON/dict export for programmatic use.
  • If docling fails to install or parse a specific format, fall back to pdfplumber for PDFs or python-docx for DOCX files.
  • Always report the document structure (sections, tables, figures found) before detailed output so the user knows what is available.
  • For scanned documents without a text layer, docling may use its built-in OCR. If quality is poor, suggest the pdf-ocr skill for better preprocessing.