

Your folder structure should look like this: ROOT | |_ app.py |_ chatbot.py |_ chatty.py |_ config.py |_ skolo_intents.json Save all the files and run the application. The Github raw file can be found here: Run and test Automate Facebook Messenger with Deep Learning Chatbot App all the general high level topics that you clients would be enquiring about.įor every general topic: Think about all the possible ways someone might ask the question and write them down, also document the correct chatbot response that will be given if someone asks a question in that topic.īelow is an example of an intents object: '.format(senderPsid)) if 'message' in webhookEvent: handleMessage(senderPsid, webhookEvent) return 'EVENT_RECEIVED', 200 else: return 'ERROR', 404 if _name_ = '_main_': app.run(host='0.0.0.0', port='8888', debug=True) The Chatbot Intents Fileīreak down the chatbot in to general topics, like: (1) greeting, (2) goodbye, (3) location, (4) operating_hours. The idea is to (1) make the client feel like they are talking to a real person and to (2) cover all the realistic questions clients might ask.

Therefore 80% of your effort should go in to creating a good intents file, without contradictions and cover all the intents your clients might have when asking questions to the chatbot. It does not mater how deep, complex or well developed your model is - if you feed it junk training data, it will output junk predictions.

The first step is arguably the most important step, the intents file will be the input data that will be used to train the chatbot - so as mathematicians say: “Junk in, junk out”. There are three important stages to creating our deep learning chatbot:

Creating our Deep Learning Chatbot with Python You need to follow the tutorial and ensure that the application is running - able to feedback any messages you send from your facebook page. Facebook Messenger Access token for the pageĪll these steps are covered in this Tutorial: Using Python to send messages to Facebook Messenger.A facebook developer app, with messenger activated.In order to get your application to talk to Facebook Messenger API you need the following:
CHATTY FOR FACEBOOK MESSENGER INSTALL
This will install an ssl certificate for the your-domain and Getting your application ready to talk your Facebook Messenger API You need to install an SSL certificate on your application, for that you can use certbot, start by installing certbot: sudo apt install certbot python3-certbot-nginxĪfter you have deployed your application using nginx and you have confirmed it is running on http - you can then run the following command to install an ssl certificate: sudo certbot -nginx -d your_domain -d www.your_domain Video Tutorial for Hosting Flask Application. This is simple to achieve - you can follow our online video tutorial to create a basic Flask application that can be hosted on Digital Ocean Droplet. Flask Web Applicationīefore we get started, you will need a Flask Application hosted on a https server.
CHATTY FOR FACEBOOK MESSENGER CODE
All the code is available from our Github repo and the entire tutorial is available on YouTube as well. It is an exciting real-life application of a chatbot, and can be immediately monetised as a skill, can form a great addition to your Python project portfolio. Install Deep Learning Chatbot to Facebook Messenger
