Unable to include a QUERY in either analyze_document or start_document_analysis

2

I am trying to send a query with the function analyze_document (or start_document_analysis) as described in the docs , however I get the error: Unknown parameter in input: "QueriesConfig", must be one of: Document, FeatureTypes, HumanLoopConfig

If I then remove "QueriesConfig", I get the error : An error occurred (InvalidParameterException) when calling the AnalyzeDocument operation: QueriesConfig must be used with QUERIES FeatureType.

I do not know hence what to do. I leave the full script code.

    client = boto3.client('textract')
    
    image_binary = stream.getvalue()
    response = client.analyze_document(Document={'Bytes': image_binary},
        FeatureTypes=["QUERIES"], 
        QueriesConfig={ 'Queries': [ { 'Text': 'what is the document date?' } ] })

Thanks!

asked 2 years ago843 views
1 Answer
0

Hello,

Thank you for trying Amazon Textract. It looks like you are using an older version of SDK. Can you please check if you have the latest version of SDK? If not, please update it and then try to run the script again and let us know if you are still seeing the first exception.

Thanks.

answered 2 years ago
  • I had the same issue and tried out with latest sdk. Still getting the same error. Boto3 version 1.23.1.

  • The SDK version is not the problem. I have the same issue with the newest version boto3 1.24.34, also i saw another similar question with the similar response which is not the solution also. Are you going to solve this issue soon or not ?

  • I have the same issue with boto3 version 1.24.34, thus, this is not the issue. In my case Forms works, but Queries not. Could you help us to solve this issue?

  • this seems to still be an issue. Any fix coming?

  • I have exactly the same problem as the poster, using the latest version of the PHP SDK. Are there any updates?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions