-
Notifications
You must be signed in to change notification settings - Fork 5
MovieMate A chatbot that knows everything about movies!
Amitha R edited this page Oct 13, 2018
·
4 revisions
- It uses the wit.ai services.
- It was acquired in 2015 by Facebook.
- Provides speech & text recognition and processing as a service.
- Uses machine learning and natural language processing.
- wit.ai - 40+ languages, large community, free for commercial applications as well.
- wit can be used directly over http.
- It has ready to use SDKs for Ruby, Python and Nodejs.
- Login in - your developed apps will be displayed on the dashboard.
- In order to create new App - "+" , language, private/public.
- Click on the app -> understanding -> Create the intent and entities.
- tell me about war of the worlds.
- intent - movieinfo
- movie - "war of the worlds" (entites)
- validate
- click on the entities - see all the training data.
- tell me about war of the worlds.
- Built-in NLP <------> FB Messenger <-------> Chatbot (Nodejs APP)
- Built-in NLP automatically parse messages into fundamental entities.
- Hi, I'll meet you tomorrow at 10 am.
- entities:{ greetings: [{confidence: 0.9689, value: true}], datetime: [{confidence: 0.9509, value: 'Sun...}]}
- developers.facebook App - built-in NLP section - Turn it on.
- wit.ai - settings - server access token - copy.
- Back in developers.facebook App ---> built-in NLP section
- select the page.
- Paste Wit Token - save.
FB Messenger <---> FBeamer <--> Extract entity values <---> getMoviesData --(The MOVIE DB) -- getDirector() ---> createResponse --> FBeamer <--> FBMessenger
- themoviedb
- Sign up and login.
- Profile -> Settings -> API
- Generate the API Key -> by providing basic Info.
- Insert the generated key in the (tmdb) config/development.json file.
- Developers - themoviedb
- For movies -> Search -> Search movies
- GET / search/movie
- Try it out tab
- Variables: api.key -> insert the tmdb key generated previously.
- Query String - Query - (Movie Name)
- Send Request.
- Try it out tab
- GET /movie/{movie_id}/credits
- Built a simple Q&A chatbot.
- Understood NLP helps build smarter chatbots.
- Introduced to Wit.ai.
- Used Movie DB to fetch movie related information.
I. Creation of a Page
- Facebook - create a page.
- Choose the category - Business or brand.
- Update the information accordingly - Test the button to update the messager chat.
II. Creation of Application Id
- Facebook for developers - https://developers.facebook.com/;
- MyApps - Add New App
- Create a New App Id - Display Name , create App Id.
- Developers Facebook Page opens - Messanger - Settings
- Token Generation - Link the respective created page and generate the Access token.
- In the code base - config/development.json file - page access token.
- Verify Token Generation
- In cmd
- node
- require('crypto').randomBytes(24).toString('hex')
- In cmd
- Token Generation - Link the respective created page and generate the Access token.
III. Creation of Webhooks
- Downloads Ngrok - Run it.
- http E.g D:/.../ngrok http 3000
- This generate url -> https://1332f745.ngrok.io;
- Set up Webhooks
- Callback URL - the generated url from ngrok.
- Verify Token - generated crypto 24 byte token - config/development.json file.
- Subscription field - messages.
- Choose the Page (Movie Mate) -> Subscribe;
IV. Wit.ai (Natural Language Processing - Tool)
- wit.ai homepage.
- login - github, etc;
- Create a new App
V. Movie Database Application
- URL -> https://www.themoviedb.org
- Sign up and login.
- Profile -> Settings -> API
- Generate the API Key -> by providing basic Info.
- Insert the generated key in the (tmdb) config/development.json file.
VI. Understanding the Movie API
- URL -> https://developers.themoviedb.org
- For movies -> Search -> Search movies
- GET / search/movie
- Try it out tab
- Variables: api.key -> insert the tmdb key generated previously.
- Query String - Query - (Movie Name)
- Send Request.
- Try it out tab
- GET /movie/{movie_id}/credits
VII. Deploying it in Heroku Cloud
- URL -> https://dashboard.heroku.com/login;
- Create a free account -> go to the dashboard.
- Install the Heroku CLI for windows.
- URL -> https://devcenter.heroku.com/articles/heroku-cli
- While Deploying on Heroku
- package.json file -> remove the main key, mention the exact node version.
- invoke the start, engine -> node engine.
- delete app.js file as it not necessary.
- create .gitignore file.
- node_modules
- config/development.json
- Ensure to have git install.
- In cmd -> git init
- Login in to the heroku account from the cmd
- heroku login
- email id, password
- git add , git commit, git push heroku master
- Heroku offers cloud computing
- heroku create
- an app is created and a https link is also provided.
- In the facebook developers page -> Webhooks
- Edit Subsciption -> the https link, verify token.
- Back to the Heroku Dashborad -> settings
- reveal config var -> define the key values.
- Test the chatbot of Facebook.
- In case it doesn't work.
- messanger - settings - [webhook]
- select the page.
- unsubscribe and then subscribe it.
- In case it doesn't work.
VIII. Making an APP public on Facebook / Approval Process
- URL -> Facebook.developers.com
- App Review :
- Face developers page
- Messenger - settings - bottom part - review.
- Click on Add to submission - show the required actions.
- privacy policy - iubenda.com;
- provide examples and complete the approval process.
- On approval, click the slide -> turn on the chat bot and make it publically available.
- Tester - add ppl to test the chatbot.