'S3' object has no attribute 'detect_document_text' (python code)

0

'S3' object has no attribute 'detect_document_text' this error show when try to extract raw text data from invoice document using AWS Textract python function detect_document_text inside AWS Lambda.

질문됨 2년 전629회 조회
1개 답변
2

Sounds like you're doing something like this:

s3 = boto3.client("s3")
# maybe some other code here
s3.detect_document_text(...)

But you need to create a textract client:

textract = boto3.client("textract")
# maybe some other code here
response = textract.detect_document_text(
    Document={
        "S3Object": { "Bucket": "mybucketname", "Name": "my-object-name.jpg" }
    }
)

Check out the boto3 documentation for textract, and for detect_document_text() specifically for more info, including the value of the response you'll get back.

profile pictureAWS
전문가
James_S
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠