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
質問済み 7ヶ月前454ビュー
1回答
1
承認された回答

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
エキスパート
回答済み 7ヶ月前
profile picture
エキスパート
レビュー済み 7ヶ月前
  • 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 :)

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ