我们计划使用AWS Textract服务进行文档分析。当前结果以边界框格式出现。有谁知道如何通过此服务获取准确的pdf布局?
OCR Pdf文档文本提取以进行文档分析
jobId = startJob(s3BucketName, documentName)
print("Started job with id: {}".format(jobId))
if(isJobComplete(jobId)):
response = getJobResults(jobId)
#print(response)
# Print detected text
for resultPage in response:
for item in resultPage["Blocks"]:
if item["BlockType"] == "LINE":
print ('\033[94m' + item["Text"] + '\033[0m')