Table structure recognition

From aifinlab/FinClaw · View interactive version

Table structure recognition is an AI agent skill from the GitHub repository aifinlab/FinClaw. 用于表头行列识别的表格结构识别原子 skill,适用于通用行业文档解析场景。

How to use this skill

Skill file

表格结构识别 Skill

数据来源

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

1. 表格文件类型

2. 表格类型

3. 表格特征

4. 数据格式要求

说明:本 Skill 不包含表格采集功能,需要用户提供表格文件。建议表格格式规范,以便进行准确的结构识别。


功能

本 Skill 提供全面的表格结构识别能力,涵盖多种识别功能:

1. 表格检测

2. 表头识别

3. 行列结构识别

4. 数据区域识别

5. 表格内容提取

6. 高级处理功能


使用示例

输出示例

{
  "table_info": {
    "table_id": 1,
    "position": {
      "page": 5,
      "bbox": [100, 200, 500, 600]
    },
    "source_file": "document.pdf"
  },
  "structure": {
    "row_count": 10,
    "column_count": 5,
    "header_rows": 2,
    "data_rows": 8,
    "has_merged_cells": true
  },
  "headers": {
    "level_1": [
      {
        "cell_range": "A1:E1",
        "text": "2024年财务数据",
        "merged": true,
        "colspan": 5
      }
    ],
    "level_2": [
      {
        "cell_range": "A2",
        "text": "项目",
        "merged": false
      },
      {
        "cell_range": "B2",
        "text": "Q1",
        "merged": false
      },
      {
        "cell_range": "C2",
        "text": "Q2",
        "merged": false
      },
      {
        "cell_range": "D2",
        "text": "Q3",
        "merged": false
      },
      {
        "cell_range": "E2",
        "text": "Q4",
        "merged": false
      }
    ]
  },
  "merged_cells": [
    {
      "range": "A1:E1",
      "rowspan": 1,
      "colspan": 5,
      "text": "2024年财务数据"
    }
  ],
  "data": [
    {
      "row": 3,
      "cells": [
        {"col": 1, "text": "营业收入", "rowspan": 1, "colspan": 1},
        {"col": 2, "text": "1000", "rowspan": 1, "colspan": 1},
        {"col": 3, "text": "1100", "rowspan": 1, "colspan": 1},
        {"col": 4, "text": "1200", "rowspan": 1, "colspan": 1},
        {"col": 5, "text": "1300", "rowspan": 1, "colspan": 1}
      ]
    }
  ],
  "extracted_table": {
    "format": "csv",
    "data": [
      ["项目", "Q1", "Q2", "Q3", "Q4"],
      ["营业收入", "1000", "1100", "1200", "1300"],
      ["营业成本", "600", "650", "700", "750"]
    ]
  }
}

注意事项与限制

1. 表格格式要求

2. 识别准确性

3. 合并单元格处理

4. 表格复杂度

5. 使用限制


参考资料

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.