aws-solutions-constructs icon indicating copy to clipboard operation
aws-solutions-constructs copied to clipboard

New Pattern: lambda-comprehend

Open knihit opened this issue 4 years ago • 2 comments

Based on which feature and service of comprehend you plan to use, comprehend requires permission policy setup so that lambda functions can access them. Some of the API endpoints in Comprehend also require an S3 bucket to be setup for input and ouput. Specifically in case of topic modeling, the outputs are written to the S3 bucket after about 25-30 mins. Which would mean that we need a lambda function bound to an S3 notification to be notified once the data becomes available. Hence the need for a higher level construct to provide the plumbing required to integrate lambda with comprehend services.

Use Case

Comprehend is one of key NLP services for AWS AI/ML services. For my use-case, I ingest text data and subject that to various comprehend services to derives inferences. This helps understand public perception and our customers have a better understanding of customer feedback

Proposed Solution

The proposed solution is that

  1. Provide the flexibility to the user to specify which Amazon Comprehend services does he plan to integrate with
  2. Build the service role permissions required to access lambda
  3. If the service selected requires S3 bucket, create the bucket too and update the bucket permissions as required by comprehend to access it
  4. If the NLP output from comprehend is to be put in an S3 bucket (non-realtime inference), build the plumbing required to generate an S3 notification to a lambda function.

Other

I currently use this pattern in https://aws.amazon.com/solutions/implementations/discovering-hot-topics-using-machine-learning/

  • [x] :wave: I may be able to implement this feature request
  • [ ] :warning: This feature might incur a breaking change

This is a :rocket: Feature Request

knihit avatar Nov 02 '20 15:11 knihit

Overall the pattern seems like a good candidate, the only feedback is #4 can make use of the existing aws-s3-lambda pattern under the hood

hnishar avatar Nov 06 '20 15:11 hnishar

In general I believe yes we should be able to use existing pattern, there would be some additional setup on top of that construct to allow comprehend to write data to the S3 bucket.

knihit avatar Nov 06 '20 19:11 knihit