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
preguntada hace 7 meses442 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace 7 meses
profile picture
EXPERTO
revisado hace 7 meses
  • 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 :)

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas