【发布时间】:2022-01-26 12:07:47
【问题描述】:
在使用 boto3 for python 实现 aws textract 分析费用异步 api 时,出现错误
'Textract' object has no attribute 'start_expense_analysis'.
另一方面,start_document_text_detection 在相同的环境中对我来说工作正常。
代码:
def startAnalyseJob(s3BucketName, objectName):
textract = boto3.client('textract')
response = textract.start_expense_analysis(
DocumentLocation={
'S3Object': {
'Bucket': s3BucketName,
'Name': objectName
}
})
return response["JobId"]
jobId = startAnalyseJob(bucket, key)
错误:
[ERROR] AttributeError: 'Textract' object has no attribute 'start_expense_analysis'
【问题讨论】:
-
可能的原因是什么?我在 lambda 函数上运行它,并提供了 SNS、S3、文本访问。我急需帮助。提前致谢。
标签: amazon-web-services boto3 amazon-textract