在Python中使用Amazon Textract从多个图像中提取多个表
我是Python的初学者。我正在做一个关于发票分类的项目。我正在使用AmazonTextract从Python中的图像中提取信息 为了遍历大量文件(以3幅图像为例),我创建了这些代码在Python中使用Amazon Textract从多个图像中提取多个表,python,amazon-textract,Python,Amazon Textract,我是Python的初学者。我正在做一个关于发票分类的项目。我正在使用AmazonTextract从Python中的图像中提取信息 为了遍历大量文件(以3幅图像为例),我创建了这些代码 import boto3 from trp import Document #Document s3BucketName = "Your Bucket Name" Name = ['Image1.jpg','Image2.jpg','Image3
import boto3
from trp import Document
#Document
s3BucketName = "Your Bucket Name"
Name = ['Image1.jpg','Image2.jpg','Image3.jpg']
for i in Name:
documentName = i
#Amazon Textract client
textract = boto3.client('textract')
#Call Amazon Textract
response = textract.analyze_document(
Document={
'S3Object': {
'Bucket': s3BucketName,
'Name': documentName
}
},
FeatureTypes=["TABLES"])
#print(response)
doc = Document(response)
print(doc)
####Table Extraction###
for page in doc.pages:
# Print tables
for table in page.tables:
for r, row in enumerate(table.rows):
for c, cell in enumerate(row.cells):
print("Table[{}][{}] = {}".format(r, c, cell.text))
但是,我无法使用此循环提取每个表。你能帮我解决这个问题吗?谢谢 你能告诉我你收到了什么错误信息吗?