Textrack - An error occurred (InvalidParameterException) when calling the AnalyzeDocument operation: Request has invalid parameters

0

Hi everyone, this is my first postQuestion, so im sorry if i broke any rule 😅. I try to extract some text from a PDF file and when the script run i have this message error with queries method analyze document. The thing is, the bucket is enable, the file exists in this path and the queries object are too simple. There is something on my syntax what be wrong or missing some params?

Error message An error occurred (InvalidParameterException) when calling the AnalyzeDocument operation: Request has invalid parameters

My boto3 version is 1.34.54

queries = [ {'Text': 'TextOnDoc', 'Alias': 'AliasName'} ]

TextrackClient.analyze_document(
      Document={'S3Object': {'Bucket': 'ActiveBucketName', 'Name': "folderOnBucket/file.pdf"}},
      FeatureTypes=["QUERIES"],
      QueriesConfig={ "Queries": queries }
)

if someone would be helpme, i really will preciate it I have seen some similar unanswered cases in the forum

Claudio Alvarez

profile picture
Claudio
gefragt vor 7 Monaten442 Aufrufe
1 Antwort
1
Akzeptierte Antwort

Hello.

I looked at the documentation below and I thought your Python code was correct.
If possible, why not try using a different version of Boto3?
It is possible that changing the version may resolve the issue.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/textract/client/analyze_document.html

By the way, were there any other error messages output?
For example, can you check if there are any messages stating that there is a problem with a particular parameter?

profile picture
EXPERTE
beantwortet vor 7 Monaten
profile picture
EXPERTE
ĂŒberprĂŒft vor 7 Monaten
  • I'll try made a downgrade of boto3 and run the same script. For the other hand i try configured cloudwatch logs in My aws console but i failed ajjajaj đŸ«  just to know where textract has the conflict

    Thanks for your answer

  • Hi Riku, after some hours ajajaj i solved this issue about the invalid params. The thing is the document are in Spanish and some Text inside the queries object have a special character like "ĂĄ". I just remove from the text and it works

    Again, thanks for your support :)

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