[{"data":1,"prerenderedAt":60},["ShallowReactive",2],{"pattern-lambda-comprehend":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":16,"extension":17,"framework":18,"gitHub":19,"highlight":6,"introBox":25,"language":29,"level":30,"meta":31,"patternArch":32,"resources":46,"s3URL":6,"services":6,"stem":52,"testing":53,"videoId":6,"__hash__":59},"patterns\u002Fpatterns\u002Flambda-comprehend.json","AWS Lambda to Amazon Comprehend",null,{"headline":8,"text":9},"Cleanup",[10],"See the GitHub repo for testing instructions.",[12],"content\u002Fcontributors\u002Ftommy-whelan.json",{"text":14},[15],"sam deploy --guided","Create a Lambda function that uses Amazon Comprehend for sentiment analysis.","json","AWS SAM",{"template":20},{"projectFolder":21,"repoURL":22,"templateURL":23,"templateFile":24},"lambda-comprehend","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-comprehend","serverless-patterns\u002Flambda-comprehend","template.yaml",{"headline":26,"text":27},"How it works",[28],"This pattern shows how to deploy a SAM template that builds a Lambda function which triggers Comprehend for sentiment analysis.","Python","200",{},{"icon1":33,"icon2":38,"line1":42},{"x":34,"y":35,"service":36,"label":37},20,50,"lambda","AWS Lambda",{"x":39,"y":35,"service":40,"label":41},80,"comprehend","Amazon Comprehend",{"from":43,"to":44,"label":45},"icon1","icon2","",{"headline":47,"bullets":48},"Additional resources",[49],{"text":50,"link":51},"Using AWS Lambda and Amazon Comprehend for sentiment analysis","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fusing-aws-lambda-and-amazon-comprehend-for-sentiment-analysis\u002F","patterns\u002Flambda-comprehend",{"headline":54,"text":55},"Testing",[56,57,58],"Use the AWS CLI to invoke the Lambda function. The function name is in the outputs of the AWS SAM deployment (the key is QueuePublisherFunction):","1. Invoke the Lambda function to publish a message to the SQS queue: \u003Ccode>aws lambda invoke --function-name ENTER_YOUR_FUNCTION_NAME outfile.txt\u003C\u002Fcode>.","2. Retrieve the message from the SQS queue, using the queue URL from the AWS SAM deployment outputs: \u003Ccode>aws sqs receive-message --queue-url ENTER_YOUR_QUEUE_URL\u003C\u002Fcode>","2dXD7flf6_rH3Ejz-4PMNfz7WW3pWEnBL1TaOWfCy8M",1778846885919]