Cloudreach .create(v=4.0) Hackathon winner: NoComprehend
It’s always great when .create() time comes around. We especially liked this edition as we could play with some of the services recently announced at AWS re:Invent 2017.
NoComprehend is a Slack chatbot that uses a natural language processing (NLP) backend provided by Amazon Comprehend to identify keywords in Slack messages and populates a phrasal template inspired by the popular game Mad Libs. The interesting/fun part is that NoComprehend will take the chat history of a given Cloudreach Slack channel as a source of keywords, providing us with a very Cloudy and fun Mad Libs!
The following architecture diagram illustrates how NoComprehend works:Cloudreach Slack users message the NoComprehend bot and trigger a Slack event that will send a request to API Gateway & Lambda in order to:
- Query Slack channels.history API, retrieve the last 1000 messages on a given channel (defined in Lambda Environment variables)
- Call Amazon Comprehend API and pass back the sanitized text for natural language processing.
- Amazon Comprehend will identify key entities among the unstructured text such as Person, Organization, Location, etc and pass them back to the Lambda function.
- The Lambda function will retrieve pre-existing templates in S3 with blanks that will be replaced by the keywords identified by Amazon Comprehend
- Finally, the S3 Blanks will be filled by the Lambda function and returned to the Slack channel
It was a lot of fun to get this up a running in less than a weekend! Currently NoComprehend is only being used by a small group of brave Alpha Cloudreachers but we plan to roll out to the wider Cloudreach team when we make a few little additions such as allowing Cloudreachers to add more text templates by using Slash commands.
The laughs have only started…
See you all on the next edition of .create()!
The Comprehend team: Alberto Alvarez and Phil Misiurak