当前位置: 首页 > news >正文

表格解析调研

表格解析调研

TextInTools

TextInTools:https://tools.textin.com/table

可以将表格图片解析成可编辑的表格/json,效果不错

image-20240806082059832

image-20240806082240661

白描

地址:https://web.baimiaoapp.com/image-to-excel

可以将表格图片识别成可编辑的表格,可复制、导出为xlsx、txt。效果不错,但是免费有额度

image-20240806082712308

i2PDF

地址:https://www.i2pdf.com/cn/extract-tables-from-pdf

可以对pdf进行多种处理,提取表格效果不错,并且可以选择导出的格式,效果不错

image-20240808215201965

image-20240808215238430

Tabula-PDF

项目地址:https://github.com/tabulapdf/tabula

用于从PDF文档中识别和提取表格数据。它利用机器学习算法和计算机视觉技术,能够准确地识别PDF页面中的表格,并将其转换为结构化数据。Tabula-PDF会将识别到的表格转换为结构化数据,如CSV、Excel、json等格式。效果一般

image-20240808212513019

pdflux

项目地址:https://pdflux.com/

效果不错,会有免费额度

image-20240808213532592

iLoveOCR

地址:https://cn.iloveocr.com/

效果一般

ocr2edit

地址:https://www.ocr2edit.com/zh

识别效果不好

py代码

使用python-docx库

python代码实现将word中的表格解析出来

from docx import Documentdoc = Document('example.docx')
for table in doc.tables:for row in table.rows:cells = [cell.text for cell in row.cells]print(cells)

使用PyMuPDF

需要安装PyMuPDF,可以用来提取pdf内容,并且可以查找页面的表格。效果不错

import fitzdoc = fitz.open('../example.pdf')
page = doc[2]  # 下标从0开始
tables = page.find_tables()
df = tables[1].to_pandas()df.to_excel('table.xlsx', index=False)

image-20240809214217856

使用pdfplumber库

使用pdfplumber实现将pdf中的表格解析出来,效果一般,示例代码如下:

import pdfplumber
import pandas as pdwith pdfplumber.open("../example.pdf") as pdf:page = pdf.pages[3]for table in page.extract_tables():df = pd.DataFrame(table[1:], columns=table[0])df.to_excel('table.xlsx', index=False)

image-20240809203921032

使用camelot库

camelot专门用于从 PDF 文件中提取表格数据。效果不错

import camelottables = camelot.read_pdf('../example.pdf')tables.export('result.csv', f='csv', compress=True) # json, excel, html, markdown, sqliteprint(tables[0].parsing_report)tables[0].to_csv('result.csv') # to_json, to_excel, to_html, to_markdown, to_sqlite

image-20240809215502211


http://www.mrgr.cn/news/3568.html

相关文章:

  • 网络编程:OSI协议,TCP/IP协议,IP地址,UDP编程
  • jstack 使用经验笔记
  • 小阿轩yx-Kubernetes Pod入门
  • 【C++11】入门基础
  • leetcode_60. 排列序列
  • 一文学会用 Maven
  • 高性能内存对象缓存
  • Java 入门指南:集合概述
  • Spring中AnnotationConfigApplicationContext
  • Linux系统信息排查
  • Oracle23ai新特性FOR LOOP循环控制结构增强
  • 智能停车计费系统设计与实现_urqs9
  • 为BUG编程:头文件不一致导致的coredump
  • @RestController @Controller区别
  • Git-详解 :从入门到精通
  • 黑神话孙悟空:国产游戏的崛起传奇!
  • 流媒体服务器二 3学习 librtmp 库的配置使用
  • 2024省选复习计划
  • RM集团在造船中应用虚拟现实辅助工程技术
  • 设计模式 - 代理(proxy)