Pdf parsing

From aifinlab/FinClaw · View interactive version

Pdf parsing is an AI agent skill from the GitHub repository aifinlab/FinClaw. 用于PDF文本与结构解析的PDF解析原子 skill,适用于通用行业文档解析场景。

How to use this skill

Skill file

PDF解析 Skill

数据来源

本 Skill 支持多种PDF文档输入格式,核心数据来源包括:

1. PDF文档类型

2. 文档内容类型

3. 文档特征

4. 数据格式要求

说明:本 Skill 不包含文档采集功能,需要用户提供PDF文档文件。建议文档格式规范,以便进行准确的解析。


功能

本 Skill 提供全面的PDF文档解析能力,涵盖多种解析功能:

1. 文本提取

2. 结构识别

3. 表格识别

4. 图表识别

5. OCR识别

6. 格式信息提取

7. 高级处理功能


使用示例

输出示例

{
  "document_info": {
    "filename": "document.pdf",
    "file_size": 2048000,
    "page_count": 50,
    "language": "zh-CN",
    "created_date": "2024-01-15",
    "modified_date": "2024-03-20",
    "encrypted": false
  },
  "structure": {
    "title": "2024年度报告",
    "bookmarks": [
      {
        "level": 1,
        "title": "第一章 公司概况",
        "page": 1,
        "children": [
          {
            "level": 2,
            "title": "1.1 公司基本信息",
            "page": 1
          }
        ]
      }
    ],
    "sections": [
      {
        "level": 1,
        "title": "第一章 公司概况",
        "content": "公司概况内容...",
        "page": 1,
        "subsections": [
          {
            "level": 2,
            "title": "1.1 公司基本信息",
            "content": "基本信息内容...",
            "page": 1
          }
        ]
      }
    ]
  },
  "tables": [
    {
      "table_id": 1,
      "position": {
        "page": 5,
        "bbox": [100, 200, 500, 400]
      },
      "rows": 10,
      "columns": 5,
      "data": [
        ["项目", "2024年", "2023年", "2022年", "2021年"],
        ["营业收入", "1000", "900", "800", "700"]
      ]
    }
  ],
  "images": [
    {
      "image_id": 1,
      "position": {
        "page": 8,
        "bbox": [150, 300, 450, 500]
      },
      "format": "png",
      "size": [800, 600]
    }
  ],
  "metadata": {
    "author": "张三",
    "company": "示例公司",
    "keywords": ["年报", "财务报告"]
  }
}

注意事项与限制

1. 文档格式要求

2. 解析准确性

3. 性能考虑

4. OCR限制

5. 使用限制


参考资料

License

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.