You can ask about social media, concerts (of El Dorado tour), her discography and more coming. This bot is available in Facebook Messenger. Unfortunately it is not yet ready for public access but authorized users can chat with it here.
- Datasources for this chatbot can be found in the resources folder in this repository. I didn't create a database because didn't think it was that interesting for this challenge.
- Custom slot types concerts and albums values are generated from the datasource itself. See lex slot builder
- There's a deployment script that I use to rapidly deploy my AWS Lambda function without touching anything in AWS Lex.
- Something really cool! Custom slot types values are generated straight from the datasources! With this I got rid of a bunch of maintainance time for Custom Slot types, since they take care of themselves. See here
AWS Lex powers up this chatbot through 10 intents:
Intent name | Functionality | What's interesting? |
---|---|---|
Sing |
Creates an audio file using AWS Polly on the fly, stores it in a S3 bucket. Uses ElicitSlot and SessionAttributes , reproduces the audio file in Facebook Messenger. |
On july 2017 (when this project was created), in the official Lex docs, 'voice' and 'audio' are mentioned, but there aren't any examples. I wanted to include it here just to experiment the whole generate/store/reproduce flow. |
DealWithIt |
This intent is created solely with the purpose of handling hate/love feelings towards the chatbot. I didn't want to create two intents for hate and love, so this one uses a sentiment analysis API. | Until developing this project, sentiment analysis felt to me like something very demanding and time-consuming to include in a project. Although, here I do it very simplistic, it wasn't such a hassle to implement. |
AboutAlbum , AboutSong , RandomGif , WhenConcert |
Reply based on context (slots), uses slot validations, ElicitSlot , Close . |
Custom slot types values generated from the datasource itself. |
Greeting , Helper , SocialMedia , Thanks |
These intents provide plain simple answers, necessary to fulfill some basic "human" interactions. | IMHO, a chatbot should handle the most basic human interactions (hello, please, thanks) properly. |
- Configure your AWS access key and secret key properly. DO NOT publish your access key and secret key to public sites such as GitHub!
- Configure your AWS account id in an environment variable
AWS_ACCOUNT_ID
- Configure a
MASHAPE_API_KEY
environment variable (Necessary for theDealWithIt
intent, this is the Twinword sentiment analysis API), you can get one here (If you want to skip this step you can just comment the lines that rely on Twinword API, but theDealWithIt
intent won't work) - Create a virtual env for the bot.
- Run:
source bin/activate
- Run:
pip install -r requirements.txt
- Run:
python setup.py
- Go to AWS Lex console, and deploy the bot in a Facebook Messenger channel following these instructions.
- Enjoy!
- This bot was created from a sample bot version given for the GOTO Amazon Chatbot Challenge.
- Somewhere, I have a problem with encoding from Lex to Lambda (Not the other way around) since many of the songs have spanish accents. That really is the very next thing.
- I should find a way to receive cities in a friendlier way. Fow now, people should type for example, New York, not NYC.
- Give this bot such a personality and fluency while adding more functionalities that even Shakira herself would like to chat with it!
- AWS Lex is a 'new' service, this chatbot brought a lot of insights, I have made a blog post about it if you want to take a look :)