I am running this code:
response = textract.start_document_analysis( DocumentLocation={
'S3Object': { 'Bucket': bucketname, 'Name': filename } }, FeatureTypes= ['QUERIES'], QueriesConfig={'Queries':[ {'Text':'{}'.format("Who are
you?")} ]}, NotificationChannel={ 'SNSTopicArn': SNS_TOPIC_ARN, 'RoleArn': SNS_ROLE_ARN }, OutputConfig={ 'S3Bucket': OUTPUT_BUCKET_NAME } )
This is the error I am getting:
[ERROR] ParamValidationError: Parameter validation failed:
Unknown parameter in input: "QueriesConfig", must be one of: DocumentLocation, FeatureTypes, ClientRequestToken, JobTag, NotificationChannel, OutputConfig, KMSKeyId
Traceback (most recent call last):
If I run it without QueriesConfig and give ‘QUERIES’ as FeatureTypes, I am getting the error as below:
"errorMessage": "An error occurred (InvalidParameterException) when calling the StartDocumentAnalysis operation: QueriesConfig must be used with QUERIES FeatureType.",
"errorType": "InvalidParameterException"
How do I resolve this?
2
Answers
Install the latest version of boto3 in your lambda temp workspace.
I recommend adding a layer using the latest version of boto3.