'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.

gefragt vor 2 Jahren629 Aufrufe
1 Antwort
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
EXPERTE
James_S
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen