MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION GRADUATION THESIS AUTOMATION AND CONTROL ENGINEERING TECHNOLOGY DESIGN CHAT-BOT FOR PLANNING TASK BY DIALOGFLOW AND GOOGLE CALENDAR SUPERVISOR:TRẦN NGUYEN MANH HUNG STUDENT : TRAN MINH DUC STUDENT ID: 14151028 STUDENT : HANH QUANG HIEP STUDENT ID: 14151034 S K L0 0 6 5 7 7 HO CHI MINH CITY, 18 JULY 2018 do an THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness ----***---- Ho Chi Minh City, 18 July 2018 TASK OF THE THESIS Full name of student 1: Tran Minh Duc Student ID: 14151028 Full name of student 2: Thanh Quang Hiep Student ID: 14151034 Major: Automation and Control Engineering Technology Class: 14151CLC Full name of supervisor: Nguyen Manh Hung, Ph. Name of the thesis: Design chat-bot for planning task by Dialogflow and Google Calendar 2. Initial figures and documents: 3. The content of the thesis: - Choosing the approach to extract information from text requests.
(NLTK, Stanford Core NLP, and Dialogflow) - Manually collect data for training task. - Designing the intent system for planning task in Dialogflow. - Choosing the training methods for the agent. - Using Google Calendar APIs to do tasks in Google Calendar.
- Building a back-end system to process the data from Dialogflow and Google Calendar API. - Evaluating the effectiveness NLU model and comparing agent with Google Assistant. Product: - Dialogflow Agent - Planning Assistant program Dean of Faculty Supervisor Faculty of High Quality - HCMUTE do an THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness ******* SUPERVISOR’S COMMENT SHEET Full name of student 1: Tran Minh Duc Student ID: 14151028 Full name of student 2: Thanh Quang Hiep Student ID: 14151034 Major: Automation and Control Engineering Technology Class: 14151CLC Full name of supervisor: Nguyen Manh Hung, Ph.D Name of the thesis: Design chat-bot for planning task by Dialogflow and Google Calendar COMMENT 1. About thesis’s contents:.
Propose defending thesis?. Ho Chi Minh City, July 2018 Supervisor Faculty of High Quality - HCMUTE do an THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness ******* REVIEWER’S COMMENT SHEET Full name of student 1: Tran Minh Duc Student ID: 14151028 Full name of student 2: Thanh Quang Hiep Student ID: 14151034 Major: Automation and Control Engineering Technology Class: 14151CLC Full name of supervisor: Nguyen Manh Hung, Ph.D Name of the thesis: Design chat-bot for planning task by Dialogflow and Google Calendar COMMENT 1. About thesis’s contents:. Propose defending thesis?.
Ho Chi Minh City, July 2018 Reviewer iii do an ABSTRACT Virtual assistants (or chatbot) are very popular nowadays. The technology behind these is Natural Language Processing (NLP), which is a specialized area of Artificial Intelligence (AI). For example, some of the most famous assistants are Siri of Apple, Google Assistant of Google and Alexa of Amazon. People use digital assistants to do daily tasks like setting alarm, making a call or searching some information.
In this project, we create an assistant for scheduling plans that can do more tasks that Google Assistant does. Specifically, Plan Assistant can get requests from users to set up, delete or change a plan on Google Calendar. It also has a system that recommends a suitable schedule to users so users can finish their tasks smoothly. This chat-bot breaks a limitation of Google Assistant that it can set a plan for a wider range of time comparing with just only 1 day when set by Google Assistant.
In addition, this app is very suitable for managers because they can set multi tasks which are very reasonable and keep track of their plan everywhere with Google Calendar. To build this application, we use Dialogflow, a toolkit of Google for building chat-bots, and Google Calendar API, a toolkit of Google for process calendars in Google Calendar, then combine them with our back-end system. Overall, processing tasks on Google Calendar work really well with the help of Google API. In contrast, due to lack of data, Plan Assistant still have many limitations when it can just answer some simple requests and can get errors with small changes in sentence structure.
In the future, the understanding of chat-bots will be improved very much due to Deep Learning with its Recurrent Neural Networks (RNN) and at that time, we can have some chat-bots that talk like humans. iv do an ACKNOWLEDGMENT We are deeply thankful to Dr. Nguyen Manh Hung for his support and consultation in giving us ideas, solutions, and knowledge to run our project. With his help, we have a good general comprehension of AI and NLP to pursue our future career goal.
Finally, thank you all of my friends who are our motivation for our study during this time. v do an TABLE OF CONTENTS TASK OF THE THESIS. i SUPERVISOR’S COMMENT SHEET. ii REVIEWER’S COMMENT SHEET .v TABLE OF CONTENTS.
vi LIST OF FIGURES. ix LIST OF TABLES. xi LIST OF ABBREVIATIONS. xii Section 1: INTRODUCTION .2 History of chat-bots .4 Chat-bot technology: .2 History of Machine Learning:.3 Advantage of Machine Learning: .4 Type of Machine Learning tasks: .5 Application of Machine Learning:.3 NATURAL LANGUAGE PROCESSING .2 Extracting information from text: .17 vi do an 1.5 APPLICATION PROGAMMING INTERFACE (API) .19 Section 2: MATERIALS AND METHODS .2 Advantage of Dialogflow: .3 Case study: Domino’s pizza.4 How Dialogflow chat-bot works? .3 Google Calendar API .3 Methods for event in Google Calendar .4 BACK-END SYSTEM .1 NLU SYSTEM’S TRAINING LIMITATION .65 vii do an Section 6: REFERENCES .66 viii do an LIST OF FIGURES Figure 1.
Early Chat-bot components.a Generative model architecture Figure 1.b Retrieval-based models architecture Figure 1. The traditional approach Figure 1. The ML-based approach Figure 1. Regression example Figure 1.
Classification example: Spam mail filter Figure 1. Clustering example Figure 1. The simple pipeline of information extraction Figure 1. Google Calendar UI Figure 1.
API definition Figure 2. System structure Figure 2. Domino’s pizza, a big brand in the pizza business Figure 2. Domino’s chat-bot example.
Dialogflow chat-bot model architecture Figure 2. Handling of a user request. An agent encompasses the Dialogflow components. Dialogflow’s first agent UI.
The setting screen for an agent Figure 2. Training phrases section Figure 2. Editing entities Figure 2. Response section in Intent Figure 2.
Contexts section Figure 2.a Contexts in intent Set alarm Figure 2.b Contexts in intent Set alarm-cancel ix do an Figure 2. Training tool’s overview table Figure 2. A conversation training list Figure 2. Small Talks Tool Figure 2.
A piece of the list of recommended tasks in Prebuilt Agents. Working graph of Dialogflow’s SDKs.0 protocol for authentication and authorization Figure 2. Function get_datetimeset() flowchart Figure 2. Function get_datetimeremove() flowchart Figure 3.
Demo’s flowchart simplified Figure 3. Information from agent Figure 3. Chatbot interaction Figure 3. Information extracted for example 1 Figure 3.
Information extracted for example 2 Figure 3. Interaction for duplicated event Figure 3. Google Calendar before and after removing Figure 3. Comparing chatbot and Google calendar Figure 4.1 Wrong recognition with phrases without “at” x do an LIST OF TABLES Table 2.1 List of back-end built-in functions in the library.1 Test results (Hybrid training) Table 3.2 Test result (ML only) Table 3.3 Comparing to google assistant xi do an LIST OF ABBREVIATIONS AI: Artificial Intelligence ML: Machine Learning NE: Named entity NLP: Natural Language Processing NLU: Natural Language Understanding RNN: Recurrent Neural Network UI: User Interface xii do an Section 1: INTRODUCTION 1.1 Definition According to the Oxford dictionary [1], a chat-bot is a computer program designed to simulate conversations with human users, especially over the Internet.
To put it in a simple way, it is a bot that is able to automatically understand and reply to users’ queries.2 History of chat-bots Eliza, the first conversational bot, was invented in the USA by Joseph Weizenbaum, a computer scientist at the Massachusetts Institute of Technology (MIT). The chat-bot misled people, so authentic the communication it was. In the early 90’s, to evaluate chat-bots, the Turing Test [2] was developed. It consists of the following.
A person talks to both the person and the computer which are hidden. The task is to find out which one is the real human or the computer. This technique has been still carried out in our days and many conversational bots passed the test successfully. In fact, there have been some cases that users thought chat-bots were real people and fell in love with them until they figured out they are just programs.
Until now, chat-bot technology has experienced 3 generations [3]: 1st Generation: The developer will set the rule of speech, if users say this, the chat- bot will reply with relevant answers. 1 do an 2nd Generation: Based on supervised learning in Machine Learning, we can train a model with labeled data so it can understand how to talk in a speech. 3rd Generation: Based on supervised and unsupervised learning, the model can handle more complex sentence.3 Applications: Thanks to the fast evolution of AI, nowadays, a chat-bot can imitate human conversation for solving various tasks. For example, messaging apps like WhatsApp, Slack, Skype and their analogs are experiencing tremendous growth in a number of users.
Specifically, Facebook messenger alone has more than 1.2 billion monthly users. [4] Another application of chat-bots is customer service assistant on websites. When users need to contact with companies, they can chat with a chat-bots on companies’ websites instead. A chat-bot can automatically reply simple messages and if messages are complex, chat-bot can divide messages into categories so real human assistants can reply user easier.
The most common application of chat-bots is personal assistants in smartphones. They can solve various tasks following inquiries of users. Like Google Assistant, now it can even control smart house tasks and chit chat with users very friendly. A study presented at the 4th International Conference on Internet Science in November 2017 [5] investigated what benefits users get when they use chat-bots.
According to this research, the main factors that motivate people to use chat-bots are: Productivity: Chat-bots provide the assistance or access to information quickly and efficiently. Entertainment: Chat-bots amuse people by giving them funny tips, they also help killing time when users have nothing to do. 2 do an Social and relational factors: Chat-bots bring more social experiences. Chatting with bots also helps to avoid loneliness, gives a chance to talk without being judged and improves conversational skills.
Curiosity: The novelty of chat-bots sparks curiosity. People want to explore their abilities and to try something new.4 Chat-bot technology: There are three components in a chat-bot system: Responder, Classifier and Graph-master (as shown in figure 1. Regarding to the Responder, it is the interface between users and chat-bot main routine so the input and output are controlled in this part. Moreover, Responder transfer data from users to the Classifier.
About the Classifier, it stands between the Responder and the Graph-master and take responsibility for processing data from both neighboring blocks and then deliver the processed data to them. Another task of the Classifier is substituting and splitting the user input into logical components. Finally, the last part is Graph-master which can be considered as chat-bot’s brain which contains all the pattern matching algorithms. About pattern matching, it is the technique for generating appropriate responses from chat-bot.
Early Chat-bot components. [6] 3 do an Nowadays, thanks to the rapid progress of technology, especially in AI, the architecture of chat-bot have been improved and transformed into a variety of models which have much better performances and are sophisticated. Basically, there are two kinds of model: Generative models and Retrieval-based models (as shown in figure 1.a Generative model architecture [7] Figure 1.b Retrieval-based models architecture [7] 4 do an The Generative model is based on Deep Learning (a subfield of Machine Learning) which allows chat-bot to be smarter after being trained with an increasing number of examples.