Amazon Lex is a service for building conversational interfaces into any application using voice and text. Amazon Lex provides the advanced deep learning functionalities of automatic speech recognition (ASR) for converting speech to text, and natural language understanding (NLU) to recognize the intent of the text, to enable you to build applications with highly engaging user experiences and lifelike conversational interactions. With Amazon Lex, the same deep learning technologies that power Amazon Alexa are now available to any developer, enabling you to quickly and easily build sophisticated, natural language, conversational bots (“chatbots”).
Sign-up for a PubNub account, if you don't have one already.
Import the Integration Block into your PubNub account. You can choose to add this to an existing application or create a new one.
Configure the Integration Block module code, connecting it to your AWS account:
Create a Secret in PubNub Vault, named AWS_ACCESS_KEY_ID, with value equal to your AWS Access Key ID for this service.
Create a Secret in PubNub Vault, named AWS_SECRET_ACCESS_KEY, with value equal to your AWS Secret Key for this service.
Create a Secret in PubNub Vault, named AWS_REGION, with value equal to your AWS Region for the target queue .
Update the Integration code to set the following variables:
const AWS_REGION = 'YOUR_LEX_REGION'; // set to your region
const BOT_ALIAS = 'YOUR_LEX_BOT_ALIAS'; // set to bot alias
const BOT_NAME = 'YOUR_LEX_BOT_NAME'; // set to bot name
Start the Integration Block module.
Try a test message (you can click on
Publish to do this).
This Integration Block is setup to listen to a specific PubNub channel (
CHANNEL-to-send-to-LEX) but you can configure it to listen to all channels or a subset, using wildcards, e.g.
chat.*. Thus, you can route message data sent through PubNub over to an Amazon Lex application for cross chat room bot integration, for example. The bot response will be published back on to the channel of the incoming message.
Need help? Contact PubNub Support.
Copyright (c) 2018 PubNub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Use natural language processing (NLP) to find insights and relationships in...Learn more