MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING GRADUATION THESIS CREATE A CHATBOT SERVICE INSTRUCTOR: MSC. MAI ANH THO STUDENT: CAO DINH SY VY LE THIEN AN NGUYEN THANH THIEN SKL012467 Ho Chi Minh City, December, 2023 HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY OF INTERNATIONAL EDUCATION --------------- --------------- CAPSTONE PROJECT CREATE A CHATBOT SERVICE INSTRUCTOR: Msc Mai Anh Thơ STUDENT: Cao Dinh Sy Vy 19110143 Le Thien An 19110105 Nguyen Thanh Thien 19110150 ---Ho Chi Minh City, December 2023--- HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY OF INTERNATIONAL EDUCATION --------------- --------------- CAPSTONE PROJECT CREATE A CHATBOT SERVICE INSTRUCTOR: Msc Mai Anh Thơ STUDENT: Cao Dinh Sy Vy 19110143 Le Thien An 19110105 Nguyen Thanh Thien 19110150 ---Ho Chi Minh City, December 2023--- SOCIALIST REPUBLIC OF VIETNAM Independence - Freedom – Happiness ******* PROJECT’S OBJECTIVES Student’s names: 1. Cao Đinh Sỹ Vỹ Student ID: 19110143 2. Lê Thiện An Student ID: 19110105 3.
Nguyễn Thành Thiện Student ID: 19110150 Project’s name: CREATE A CHATBOT SERVICE Implementation content: Theory: • Spring Boot • ReactJS • Bootstrap • FlaskAPI • Redis Cached • Apache Kafka • OpenAI - ChatGPT Practice: • Create a Chatbot Service allow businesses to connect with customers in a personal way without the expense of human representatives - using Spring Boot, ReactJS, Bootstrap, FlashAPI, Redis Cached, Apache Kafka and Machine Learning with the main features: o Allow our customers to log in, create account, change password and edit information. o Allowing businesses to create scripts for implementation on their websites. o Allowing businesses to manage intents, patterns, and entities for use in their scripts. o When a business user deviates from the pre-set script, there will be a dedicated channel for the business to message and guide the user back to the correct script.
o Allowing the admin to manage our customers account information and communicate with users through Zalo and Google Meet. o We have a dataset marketplace called DataEverywhere to provide datasets for use in chatbots. o Our customers can also access DataEverywhere to purchase and utilize available datasets for their chatbots. Implementation time: 15 weeks (Starting from September 11st, 2023, to Decmber 25th, 2023) Student signature: …………………………………………………… Student signature: …………………………………………………… Student signature: …………………………………………………… HEAD OF INFORMATION Ho Chi Minh City, date….
year … TECHNOLOGY PROGRAM INSTRUCTOR (Sign and write full name) (Sign and write full name) SOCIALIST REPUBLIC OF VIETNAM Independence - Freedom – Happiness ******* ASSESSMENT FORM FOR INSTRUCTOR Student’s names: 1. Cao Đinh Sỹ Vỹ Student ID: 19110143 2. Lê Thiện An Student ID: 19110105 3. Nguyễn Thành Thiện Student ID: 19110150 Major: Information Technology Project’s name: CREATE A CHATBOT SERVICE Instructor’s full name: MSc.
Mai Anh Thơ COMMENTARY: 1. Project’s contents and workload: Theory:. Approving for dissertation defence or not?. Ho Chi Minh City, Dec - 2023 Instructor’s name (Signed with full name) SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness ******* ASSESSMENT FORM FOR REVIEWER Student’s names: 1.
Cao Đinh Sỹ Vỹ Student ID: 19110143 2. Lê Thiện An Student ID: 19110105 3. Nguyễn Thành Thiện Student ID: 19110150 Major: Information Technology Project’s name: CREATE A CHATBOT SERVICE Reviewer’s full name: PhD. Le Vinh Thinh COMMENTARY: 1.
Project’s contents and workload: Theory:. Approving for dissertation defence or not?. Ho Chi Minh City, Dec - 2023 Reviewer’s name (Signed with full name) ACKNOWLEDGEMENT Ms Mai Anh Tho, the instructor of the Capstone Project course. I wanted to express my sincere gratitude for your invaluable guidance and support throughout the process of completing my thesis.
Your expertise and encouragement have been instrumental in shaping my research and navigating the complexities of this academic journey. Your constructive feedback and thoughtful suggestions have not only enhanced the quality of my work but have also contributed significantly to my personal and academic growth. I am truly grateful for the time and effort you have dedicated to mentoring me. Your passion for the subject matter and commitment to fostering academic excellence have inspired me to strive for the highest standards.
Thank you once again for being an exceptional mentor. I am fortunate to have had the opportunity to work under your guidance. I look forward to applying the knowledge and skills I have gained under your mentorship in my future endeavors. Wishing you continued success and fulfillment in your academic pursuits.
Ho Chi Minh City, Dec - 2023 Cao Dinh Sỹ Vỹ Lê Thiện An Nguyễn Thành Thiện TABLE OF CONTENTS TABLE OF CONTENTS. INTRODUCTION TO THE TOPIC. REASON FOR CHOOSING TOPIC. URGENCY OF THE TOPIC:.
SYSTEM ARCHITECTURE OVERVIEW:. SockJS and StompJS. TRAIN AND PREDICTION EXPLANATION:. What is LLM?.
What is Vector Database?. What is Embeddding (for Vector Database)?. How are they applied to this project?. CURRENT STATUS SURVEY:.
Survey of customer needs. LIST OF SYSTEM FUNCTIONAL REQUIREMENTS:. Intent, Pattern, Script information management function. Create scenrio function:.
Functional requirement DataEverywhere. LIST OF NON-FUNCTIONAL REQUIREMENTS:. Requirement modeling for Chatbot. CRUD intent usecase:.
CRUD pattern usecase:. CRUD pattern usecase:. CRUD scenrio usecase:. Requirement modeling for DataEverywhere.
Overall usecase diagram:. Detail usecase diagram:. Sequence diagram for Chatbot. Login sequence diagram.
Sign up sequence diagram. Get profile sequence diagram. Add intent sequence diagram. Get intent sequence diagram.
Update intent sequence diagram. Delete intent sequence diagram. Add pattern for an intent sequence diagram. Add script sequence diagram.
Update script sequence diagram. Delete script sequence diagram. Sequence diagram for DataEverywhere. Login sequence diagram.
Sign up sequence diagram. Get profile sequence diagram. Update profile sequence diagram. Add dataset collection to cart sequence diagram.
Remove cart item from cart sequence diagram. Make payment sequence diagram. Class diagram for Chatbot. Class diagram for DataEverywhere.
DATABASE TABLE DESIGN FOR CHATBOT. Condition_mapping table. Entity_type table. Message_history table.
DATABASE TABLE DESIGN FOR DATAEVERYWHERE. Cart_item table. Dataset_collection table. Dataset_item table.
Payment_method table. Dataset_category table. IMPLEMENTATION AND TESTING. GUI CHATBOT SERVICE.
GUI chatbot service overall:. Log in screen:. Sign up screen:. Home page screen.
My profile screen. Script management screen chatbot. See Embedded Code of Script Modal. Edit script screen:.
Setting script information modal. Try script modal. Chat history modal screen. Login screen DataEverywhere.
Homepage screen DataEverywhere. Homepage screen DataEverywhere. Cart screen DataEverywhere. Homepage screen DataEverywhere.
RESULT AND OPTIMIZATION. Integration Testing Results. Security Testing Results. ACHIEVEMENTS AND MILESTONES:.
USER-CENTRIC APPROACH. SECURITY AND OPTIMIZATION. 105 4 List of figures: Figure 1: System architecture .19 Figure 2: Using useState hook.20 Figure 3: Using useEffect hook .21 Figure 4: Using useContext hook .21 Figure 5: Using useMemo and useCallback .21 Figure 6: Ant Design definition.22 Figure 7: Using modal of AntD .23 Figure 8: Using Button of AntD .23 Figure 9: Reactflow document .23 Figure 10: Using useEdges .24 Figure 11: Using useNodes .24 Figure 12: Spring boot definition .25 Figure 13: Redis cached .26 Figure 14: Apache Kafka .28 Figure 16: Amazon lex workspaces .36 Figure 18: Usecase overall ChatbotService.43 Figure 19: Login usecase ChatbotService .43 Figure 20: CRUD Intent usecase .44 Figure 21: Usecase CURD pattern .45 Figure 22: CRUD script usecase .46 Figure 23: CRUD scenrio usecase.47 Figure 24: Overall usecase DataEverywhere .48 Figure 25: Detail usecase diagram .49 Figure 26: Login sequence diagram .50 Figure 27: Sign up sequence diagram .51 Figure 28: Get profile sequence diagram .51 Figure 29: Add intent sequence diagram .52 5 Figure 30: Get intent sequence diagram .53 Figure 31: Update intent sequence diagram .54 Figure 32: Delete intent sequence diagram .55 Figure 33: Add pattern for an intent sequence diagram .56 Figure 34: Add script sequence diagram .57 Figure 35: Update script sequence diagram .58 Figure 36: Delete script sequence diagram .59 Figure 37: Login sequence diagram for DataEverywhere .60 Figure 38: Sign up sequence diagram DataEverywhere .61 Figure 39: Get profile sequence diagram DataEverywhere .62 Figure 40: Update profile sequence diagram DataEverywhere .63 Figure 41: Add dataset collection to cart sequence diagram .64 Figure 42: Remove cart item from cart sequence diagram .65 Figure 43: Make payment sequence diagram .66 Figure 44: Class diagram for Chatbot .67 Figure 45: Class diagram for DataEverywhere .67 Figure 46: Database design Chatbot .68 Figure 47: Database design DataEverywhere .69 Figure 48: Log in screen chatbot .80 Figure 49: Sign up screen chatbot .81 Figure 50: Home page screen chatbot .82 Figure 51: Dashboard screen chatbot .83 Figure 52: My profile screen chatbot .84 Figure 53: Script management screen chatbot .86 Figure 54: See embedded code of script modal chatbot.87 Figure 55: Edit script screen chatbot .88 Figure 56: Setting script infomation modal chatbot .89 Figure 57: Try script modal screen chatbot .91 Figure 58: Chat history modal screen.93 Figure 59: Login screen DataEverywhere .94 6 Figure 60: Home page screen DataEverywhere .95 Figure 61: Shop page screen DataEverywhere.96 Figure 62: Cart screen DataEverywhere .97 Figure 63: Profile screen DataEverywhere .98 7 List of tables Table 1: Advantages of Amazon Lex .34 Table 2: Disadvantages of Amazon Lex .35 Table 3: Advantages of DialogFlow .37 Table 4: Disadvantages of DialogFlow .38 Table 5: CRUD Intent, Pattern, Script function .38 Table 6: Trainning function .39 Table 7: Create scenrio function .39 Table 8: Login function .39 Table 9: Register function .40 Table 10: Business functional requirements .40 Table 11: System functional requirements .41 Table 12: List of non-functional requirements of the system Chatbot .41 Table 13: List of non-functional requirements of the system DataEverywhere 42 Table 14: Login usecase ChatbotService specifications .44 Table 15: Usecase CRUD intent specifications .45 Table 16: Usecase CURD pattern specifications .46 Table 17: Usecase CURD script specifications.47 Table 18: Usecase CURD scenrio specifications .48 Table 19: Usecase overall for DataEverywhere .49 Table 20: Detail usecase for DataEverywhere .50 Table 21: User table database for Chatbot .70 Table 22: Script table database for Chatbot .70 Table 23: Node table database for Chatbot .70 Table 24: Condition_mapping table database for Chatbot .71 Table 25: Intent table database for Chatbot.71 Table 26: Pattern table database for Chatbot .72 Table 27: Entity table database for Chatbot .72 Table 28: Entity_type table database for Chatbot .73 Table 29: message_history table database for Chatbot .73 8 Table 30: Table design for DataEverywhere .74 Table 31: Cart table for DataEverywhere.74 Table 32: cart_item table .75 Table 33: dataset_collection table .75 Table 34: dataset_item table .76 Table 35: Transaction table .76 Table 36: Payment_method table .76 Table 37: Dataset_category table .77 Table 38: GUI chatbot service overall .79 Table 39: Log in screen chatbot .80 Table 40: Sign up screen chatbot .82 Table 41: Home page screen chatbot .83 Table 42: Dashboard screen chatbot .84 Table 43: My profile screen chatbot.85 Table 44: Script management screen chatbot .87 Table 45: See embedded code of script modal chatbot .88 Table 46: Edit script screen chatbot .89 Table 47: Setting script infomation modal chatbot .90 Table 48: Try script modal screen chatbot .92 Table 49: Chat history modal .94 Table 50: Login screen DataEverywhere .95 Table 51: Homepage screen DataEverywhere .96 Table 52: Shop page screen DataEverywhere .96 Table 53: Cart screen DataEverywhere .97 Table 54: Profile screen DataEverywhere .98 9 CHAPTER 1: INTRODUTION CHAPTER 1. INTRODUCTION TO THE TOPIC 1.
Introduction In the ever-evolving landscape of conversational technology, the demand for sophisticated and user-friendly chatbot services is on the rise. Our project, "Chatbot Service," is a culmination of innovative design and practical utility aimed at providing a seamless conversational experience. Our chatbot platform is meticulously crafted to meet the diverse needs of businesses and users alike. The "Chatbot Service" not only strives for efficiency but also prioritizes adaptability.