This document provides an agenda and information for a class on databases and chatbots. It discusses replicating a movies database, creating queries, and examples. It also reviews chatbots and the conversation_simple sample application. Finally, it outlines the grading criteria for Project 3 and homework assigning students to replicate the movies database and run queries.
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Untangling11
1. UNTANGLING THE WEB
FALL 2017 WEEK 11 – MORE ABOUT DATABASES, BACK TO CHATBOTS, GETTING
READY FOR PROJECT 3 NEXT WEEK
2. AGENDA
• A few things about replication and queries
• Query examples from the movies database
• Looking back at chatbots
• Project work time – this is your last in-person time with me before project 3 is due
3. DATABSE QUERIES
• Unlike SQL queries, querying the Cloudant DB involves indexes and queries, described as JSON
• We’ll mostly use the default indexes in the movies database example, but you may need to make one of
your own for your database
• https://youtu.be/yr73c5WiliY
10. QUERY REFERENCE DOCUMENT
• https://console.bluemix.net/docs/services/Cloudant/api/cloudant_query.html#query
• You probably won’t need all of it, though
• https://youtu.be/B3ZkxSFau8U
11. EXERCISE
• Go ahead and replicate the movies database to your cloudant instance
• Create a couple queries, for instance all films with Matt Damon
12. BACK TO CHATBOTS
• Designing the UI for the chatbot, conversational turns, etc is pretty straightforward
• Hooking it into the website is more challenging
• I’ll describe how the conversation_simple sample works
• https://github.com/derekja/conversation-simple
13. CLONING AND USING THE SAMPLE
• Cloning from https://github.com/derekja/conversation-simple is as usua
• A bit different than before, , though, you can use the cf command line tools instead of the bluemix
console
• Most of these operations can be done through the bluemix UI as well
14. SETTING UP THE SERVICE
• Setting up the Conversation service
• You can use an existing instance of the Conversation service. Otherwise, follow these steps.
• At the command line, go to the local project directory (conversation-simple).
• cf login
• Create an instance of the Conversation service in Bluemix. For example:
• cf create-service conversation free my-conversation-service
15. CF LOGIN ISSUES
• I had some problems with “cf login” where it kept rejecting my credentials
• I finally instead used “cf auth derekja@gmail.com pwd” and then “cf target –o derekja@gmail.com –s
dev” to authenticate and set my organization and space
• “cf login” is supposed to do all these steps, but didn’t
• Of course, you’ll use your own space and org and login credentials
16. BRING IN THE TRAINING DATA
• This is basically the set of test sentences you’ll use with the intents identified
• (https://console.ng.bluemix.net/dashboard/services)
17. SET SERVICE CREDENTIALS
• Unlike with vcap-local.json, there is little risk of misuse with these service credentials because they can
ONLY access the service you’ve defined, so might as well leave them in the open repo
18. NPM INSTALL AND START
• Then go to localhost:3000 to run and play with the chatbot
19. CODE WALKTHROUGH
• App.js again is the root of the application
• Index.html handles the display
• Instead of routes, it is mostly handled in javascript in this example
• Conversation.js and api.js are the two main ones to be aware of. The rest is basically just taking the
response and making nice HTML out of it
20. PROJECT 3 GRADING (ORIGINAL)
• All project 3 presentation are due on November 29th in class, late projects will not be accepted
• If you are horribly ill and nobody in your group can come in to present, the project itself is still due and the
presentation marks will be forfeit, or if absolutely necessary you can send me a demo video
• 15 points total
• 4 points presentation
• Is the demo good, is the website working, is the story about why it is interesting smooth
• 4 points database design and function (do things actually work)
• What is your table structure like? Talk about any problems you ran into. How was connecting it to the front end?
• 3 points chatbot implementation – is it effectively designed and well implemented?
• 4 points code quality and robustness
• Not everything has to work, but if it is there I want it to do nothing at all or the right thing. How have you structured your code? Is
it commented and easy to understand? Everything checked into github and deployed to the server? Good commit messages?
21. PROJECT 3 GRADING (REVISED)
• All project 3 presentation are due on November 29th in class, late projects will not be accepted
• If you are horribly ill and nobody in your group can come in to present, the project itself is still due and the
presentation marks will be forfeit, or if absolutely necessary you can send me a demo video
• 15 points total (chatbot grades and database grades can be reversed if desired)
• 4 points presentation
• Is the demo good, is the website working, is the story about why it is interesting smooth
• 5 points database design and function (do things actually work)
• What is your table structure like? Talk about any problems you ran into. How was connecting it to the front end?
• 2 points chatbot implementation – is it effectively designed and well implemented?
• 4 points code quality and robustness
• Not everything has to work, but if it is there I want it to do nothing at all or the right thing. How have you structured your code? Is
it commented and easy to understand? Everything checked into github and deployed to the server? Good commit messages?
22. HOMEWORK 12 (DUE NOV 29ND BEFORE CLASS)
• Replicate the movies database into your cloudant instance on Bluemix (each group has to do this only
once.. Note the password issue I talked about in lecture)
• Run a simple query for movies that Matt Damon was in
• Write a query for movies that Robert De Niro was in between 1985 and 2001
• For each query screenshot the query and the results