1. Trang chủ
  2. » Luận Văn - Báo Cáo

Developing a virtual sales assistant using deep learning faculty of high quality training graduations thesis of the information technology

113 10 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Developing A Virtual Sales Assistant Using Deep Learning
Trường học Faculty of High Quality Training Graduations Thesis of the Information Technology
Thể loại thesis
Định dạng
Số trang 113
Dung lượng 3,56 MB

Cấu trúc

  • Chapter 1: INTRODUCTION (12)
    • 1.1. The reason for choosing the topic (12)
    • 1.2. Goals (12)
    • 1.3. Technologies (12)
  • Chapter 2: LITERATURE REVIEW (13)
    • 2.1. MERN stack (13)
    • 2.2. Deep Learning (15)
    • 2.3. Chatbot (15)
      • 2.3.1. Definition (16)
      • 2.3.2. Building a Chatbot (16)
      • 2.3.3. Advantages of Chatbot (16)
      • 2.3.4. Disadvantages of chatbot (16)
    • 2.4. Virtual assistant (17)
      • 2.4.1. Definition (17)
      • 2.4.2. The advantages of virtual assistants set up in chatbot (17)
    • 2.5. Text-To-Speech platforms (18)
      • 2.5.1. FPT API Text-To-Speech (18)
      • 2.5.2. ZALO API Text-To-Speech (18)
  • Chapter 3: THEORETICAL BASIS (19)
    • 3.1. Deep Learning (19)
      • 3.1.1. Python programming language (19)
      • 3.1.2. Tensorflow (19)
      • 3.1.3. Keras (22)
      • 3.1.4. Natural language processing and the NLTK library (22)
      • 3.1.5. Underthesea – A Vietnamese NLP Toolkit (25)
      • 3.1.6. FastAPI (26)
    • 3.2. Technologies for website building (28)
      • 3.2.1. React Library (28)
      • 3.2.2. MongoDB (28)
      • 3.2.3. Node js (28)
      • 3.2.4. Express framework (28)
      • 3.2.5. Socket.IO (29)
  • Chapter 4: SYSTEM DESIGN (30)
    • 4.1. System Architechture (30)
    • 4.2. System design (30)
      • 4.2.1. Database Design (30)
      • 4.2.2. Sequence Diagram (32)
      • 4.2.3. Use Case Diagram (37)
      • 4.2.4. Use Case Description (38)
      • 4.2.5. User Interface Design (65)
        • 4.2.5.1. Screens for unauthenticated users (65)
        • 4.2.5.2. Screens for customers (69)
        • 4.2.5.3. Screens for admins (71)
    • 4.3. Chatbot system (74)
      • 4.3.1. General system (74)
      • 4.3.2. Details of each part (76)
  • Chapter 5: SYSTEM IMPLEMENTATION (87)
    • 5.1. Software development environments (87)
    • 5.2. Source code management (87)
    • 5.3. Deployment environment (87)
      • 5.3.1. Deploying the website on Heroku (87)
      • 5.3.2. Deploying the Chatbot API on Google Cloud Platform (90)
    • 5.4. Built screens (100)
      • 5.4.1. Home Screen (100)
      • 5.4.2. Product Screen (101)
      • 5.4.3. Cart Screen (101)
      • 5.4.4. Place Order Screen (102)
      • 5.4.5. Welcome interface of Chatbot (102)
      • 5.4.6. Chatbot (103)
      • 5.4.7. List Question Screen (Admin) (103)
      • 5.4.8. Edit Question Screen (Admin) (104)
      • 5.4.9. List Dataset Screen (Admin) (104)
      • 5.4.10. Edit Dataset Screen (Admin) (105)
      • 5.4.11. Create New Dataset Screen (Admin) (105)
  • Chapter 6: CONCLUSION (106)
    • 6.1. Conclusion (106)
    • 6.2. Advantages (108)
    • 6.3. Disadvantages (109)
    • 6.4. Development directions (109)

Nội dung

INTRODUCTION

The reason for choosing the topic

The global spread of the COVID-19 pandemic has necessitated a shift towards online sales, limiting direct contact in the retail sector To enhance customer service in this new landscape, it is essential to improve online sales technology Leveraging advancements in 4.0 technology, an AI-powered Chatbot will facilitate direct communication with customers, simulating the in-store shopping experience Consequently, the implementation team has resolved to develop a Chatbot system integrated into e-commerce websites to better serve customers.

Goals

Create a virtual sales staff to advise products on a website selling clothes using deep learning:

• Find out the features and functions required for a virtual salesperson

• Learn and install a deep learning model for text processing and text-to-speech conversion: model, how it works, settings, training

• Learn and build basic Vietnamese communication dataset for website selling clothes

Build a website selling clothes with the functions of a sales website, integrating the communication interface between virtual sales staff and customers:

• Find out the features and install the required functions on a website Online selling

• Learn and install the appropriate technologies used to develop the website

• Learn and use appropriate frameworks and UIs for websites.

Technologies

Implementation using Reactjs, Nodejs, MongoDB, Express, Python, Tensorflow 2.5, NLTK, FastAPI

LITERATURE REVIEW

MERN stack

MERN stands for MongoDB, Express, React, Node, after the four key technologies that make up the stack

- Express(.js) - Node.js web framework

- React(.js) - a client-side JavaScript framework

- Node(.js) - the premier JavaScript web server

The MERN architecture allows us to easily construct a 3-tier architecture (frontend, backend, database) entirely using JavaScript and JSON

Figure 2.1 The MERN stack architecture

React.js is the leading framework in the MERN stack, designed for developing dynamic client-side applications using HTML This declarative JavaScript library enables developers to create intricate user interfaces through simple components, seamlessly connect them to backend data, and render them efficiently as HTML.

Express.js is a minimalist and unopinionated web framework designed for Node.js, providing a fast and efficient server-side solution It excels in URL routing, making it a powerful choice for developers looking to build robust applications within the Node.js environment.

(matching an incoming URL with a server function), and handling HTTP requests and responses

The MongoDB database tier allows JSON documents generated in your React.js front end to be transmitted to the Express.js server, where they are processed and stored in MongoDB for future access.

MERN is a comprehensive full-stack framework that adheres to the classic 3-tier architectural model, consisting of the front-end display tier powered by React.js, the application tier utilizing Express.js and Node.js, and the database tier based on MongoDB This stack is favored by modern web developers aiming for rapid development, especially those with prior experience in React.js.

Deep Learning

Deep learning is a subset of machine learning that utilizes multiple layers to progressively extract higher-level features from raw input data In image processing, for instance, the initial layers detect basic elements like edges, while the deeper layers recognize more complex concepts, including digits, letters, or faces.

Deep-learning architectures, including deep neural networks, graph neural networks, and convolutional neural networks, have made significant impacts across various fields such as computer vision, speech recognition, and natural language processing These advanced models have demonstrated performance levels that match or even exceed those of human experts in applications like machine translation, bioinformatics, drug design, medical image analysis, and material inspection, as well as in board game programs.

Chatbot

• Chatbot is a software application used to conduct an online chat conversation via text or text-to-speech, in lieu of providing direct contact with a live human agent

Chatbot systems are engineered to mimic human conversational behavior; however, they often need ongoing adjustments and evaluations Many chatbots currently in use still struggle to engage in meaningful dialogue and fail to meet the Turing test standards.

• Translator: Translating the user's request, helping the computer understand the request it needs to perform → deciding whether the chatbot is smart or not

• Processor: Processing requests, this component helps the ability of the chatbot to be unlimited, whatever the computer can do, the chatbot can also do the same

• Respondent: Receives output and encapsulates it and sends it back to the message platform, returning the result to the user

• Always online 24/7 and quickly respond to all customer requests

• Handle many inbox customers at the same time without confusion

• Instruct customers to use the website to make purchases

• Stimulate buying behavior and increase sales efficiency

Reactive chatbots often struggle to comprehend queries that fall outside their training data, leading to potential misunderstandings This limitation can result in frustrated customers and a negative user experience.

Chatbots are valuable tools for enhancing customer availability and managing multiple inquiries simultaneously However, each chatbot requires unique programming tailored to individual business needs, which can lead to higher initial setup costs Additionally, the training process for a chatbot demands time and resources, so it's important to consider these factors when implementing this technology.

Managing expectations is crucial when using a chatbot, as it can lead to a negative experience if users are unaware of its limitations Clearly outlining what the chatbot can and cannot do is essential for effective interaction.

Virtual assistant

• An intelligent virtual assistant (IVA) or intelligent personal assistant (IPA) is a software agent that can perform tasks or services for an individual based on commands or questions

A "chatbot" often refers to virtual assistants accessed through online chat, which can serve both entertainment and practical purposes Many of these assistants are capable of interpreting human speech and responding with synthesized voices Users can interact with their virtual assistants to ask questions, control smart home devices, manage media playback, and handle essential tasks like emails, to-do lists, and calendars using voice commands.

2.4.2 The advantages of virtual assistants set up in chatbot

• Speech to text: STT is a technology that helps computers recognize the sound of human voices through microphne and create corresponding text strings

• STT technology used in the project from SpeechRecognition by Web Speech API javacript

• Text to Speech: TTS is a natural language and text understanding technology based on artificial intelligence to create complete synthetic sounds with appropriate rhythm and intonation

The Zalo Text-To-Speech (ZTTS) engine utilizes advanced TTS technology to convert Vietnamese text into high-quality audio rapidly Designed for real-time applications and high-volume traffic, ZTTS is ideal for news websites, voice streaming services, chatbots, and virtual assistants It currently offers four distinct Vietnamese voices, featuring two Northern and two Southern accents, ensuring versatility and a natural listening experience.

Text-To-Speech platforms

2.5.1 FPT API Text-To-Speech

FPT.AI Text to Speech is a leading speech synthesis solution developed by FPT Technology Innovation Department after nearly eight years of dedicated effort It is recognized as the top integrated system for Vietnamese language voice synthesis currently available in the market.

2.5.2 ZALO API Text-To-Speech

The Zalo Text-To-Speech (ZTTS) engine provides high-quality audio output from Vietnamese text, optimized for real-time and high-traffic applications like news websites, voice streaming services, chatbots, and virtual assistants It features four distinct Vietnamese voices, including two Northern and two Southern accents.

THEORETICAL BASIS

Deep Learning

Python is a high-level programming language for general-purpose programming Python was created by Guido van Rossum and first released in 1991 a Advantages

Python is renowned for its simplicity and readability, making it an ideal programming language for beginners Its clear structure and user-friendly design facilitate easy learning and retention Widely utilized in artificial intelligence (AI) development, Python enables users to write efficient code with minimal keystrokes.

• In July 2018, Van Rossum stepped down as leader in the Python language community after 30 years of work b Disadvantages

Python lacks traditional access modifiers like protected, private, and public, and does not utilize loops such as while or switch-case While Python's processing speed surpasses that of PHP, it does not match the performance levels of JAVA and C++.

• Since 1994, Python has had 3 versions: Python 1, Python 2, Python 3 [7]

TensorFlow is a powerful, free, and open-source software library designed for machine learning applications It excels in various tasks, particularly in the training and inference of deep neural networks.

• TensorFlow is a symbolic math library based on dataflow and differentiable programming It is used for both research and production at Google

• TensorFlow was developed by the Google Brain team for internal Google use It was released under the Apache License 2.0 in 2015 [8]

• Graphs: TensorFlow has better computational graph visualizations, which are inherent when compared to other libraries like Torch and Theano

• Library management: Google backs it And it has the advantages of seamless performance, quick updates, and frequent new releases with new features

• Debugging: It helps us execute subpart of a graph which gives it an upper hand as we can introduce and retrieve discrete data

• Scalability: The libraries are deployed on a hardware machine, which is a cellular device to the computer with a complex setup

• Pipelining: TensorFlow is designed to use various backend software (GPUs, ASIC), etc And also, highly parallel

• It has a unique approach that allows monitoring the training progress of our models and tracking several metrics

• TensorFlow has excellent community support

• Its performance is high and matches the best in the industry b Disadvantages

Variable-length sequences often require specific features, yet TensorFlow lacks this functionality However, finite folding serves as an effective solution to address this limitation.

TensorFlow lacks direct support for Windows, which can be a drawback for users who prefer a Windows environment over Linux However, Windows users can still install TensorFlow using package management tools like conda or the Python package library (pip).

• Benchmark tests: TensorFlow lacks in both speed and usage when it is compared to its competitors

• No GPU support for Nvidia and only language support: Currently, the single supported GPUs are NVIDIA and the only full language support

10 of Python, which makes it a drawback as there is a hike of other languages in deep learning as well as the Lau

• Computation Speed: This is a field where TF is delaying behind, but we focus on the production environment ratherish than the performance, it is still the right choice

• It requires fundamental knowledge of advanced calculus and linear algebra along with a good understanding of machine learning also

• TensorFlow has a unique structure, so it's hard to find an error and difficult to debug

• There is no need for any super low-level matter

• It is a very low level with a steep learning curve [9] c Version

• Tensorflow is now upgraded to version 2.x:

• Usability-related modifications: simpler to use APIs, up-to-date documentation and many pre-built data sources for learning and research TensorFlow

• Performance-related modifications: Based on training and inference results on CPU and GPU processors, on average, TensorFlow 2.0 has 2x better performance than TensorFlow 1.x

• Deployment-related modifications: Allows developers to quickly and efficiently build and deploy ML applications [10]

Keras is an open-source software library that offers a Python interface for building artificial neural networks, serving as an interface for the TensorFlow library Developed and maintained by François Chollet, a Google engineer, Keras simplifies the process of creating deep learning models Chollet is also known for creating the XCeption deep neural network model.

• Up until version 2.3, Keras supported multiple backends, including TensorFlow, Microsoft Cognitive Toolkit, Theano, and PlaidML

• As of version 2.4, only TensorFlow is supported Designed to enable fast experimentation with deep neural networks, it focuses on being user- friendly, modular, and extensible [11] a Advantages

Keras offers a user-friendly API that simplifies the creation of neural network models, making it an ideal choice for implementing deep learning algorithms and natural language processing Its fast deployment capabilities enhance the overall efficiency of developing sophisticated AI applications.

We can build a neural network model in just a few lines of code

• Quality Documentation and Large Community Support

• Pretrained models: Keras provides some deep learning models with their pre-trained weights We can use these models directly for making predictions or feature extraction

• Problems in low-level API

• Need improvement in some features

3.1.4 Natural language processing and the NLTK library a Definition

Natural Language Processing (NLP) is a crucial subfield that merges linguistics, computer science, and artificial intelligence, focusing on the interaction between computers and human language It involves programming computers to effectively process and analyze vast amounts of natural language data.

Natural Language Processing (NLP) aims to enable computers to comprehend the content of documents, grasping the contextual nuances of language This technology facilitates the accurate extraction of information and insights from texts while also categorizing and organizing the documents effectively.

The Natural Language Toolkit (NLTK) is a comprehensive suite of libraries and tools designed for symbolic and statistical natural language processing (NLP) in English, developed using the Python programming language.

• It was developed by Steven Bird and Edward Loper in the Department of Computer and Information Science at the University of Pennsylvania

Tokenization is the method of breaking down extensive text into smaller units known as tokens, which are essential for identifying patterns This process serves as a foundational step for techniques like stemming and lemmatization Additionally, tokenization facilitates the replacement of sensitive data elements with non-sensitive counterparts.

• Summary, method word_tokenize() to split a sentence into words c Bag-of-words

The bag-of-words model serves as a simplified representation in natural language processing and information retrieval For instance, when analyzing the text "Xin chào quí khách," the output of tokenization using NLTK is ['Xin', 'chào', 'quí', 'khách'] This approach breaks down text into individual words, facilitating easier analysis and retrieval.

The bag-of-words model represents text, like sentences or documents, as a collection of words, ignoring grammar and word order while preserving the frequency of each word This approach has also found applications in computer vision Additionally, stemming is a key technique related to this model.

Stemming is a method that transforms a word into its base or root form by eliminating certain characters from the end of the word, effectively addressing its variations.

Stemming processors, known as Stemmers, simplify words by removing suffixes such as -ed, -ing, or -s, allowing us to identify their root form For instance, the words walked, walking, and walks all derive from the original word walk.

➢ Because the working principle of the stemmer is so simple, its processing speed is very fast, and the stem result is sometimes not what we want

Technologies for website building

React, or React.js, is a popular open-source JavaScript library designed for building user interfaces and UI components, maintained by Facebook alongside a community of developers and companies It serves as a foundation for developing single-page and mobile applications, focusing primarily on state management and rendering that state to the DOM To create comprehensive React applications, developers often integrate additional libraries for routing and other client-side functionalities.

MongoDB is a cross-platform, document-oriented database program that is classified as a NoSQL database It utilizes JSON-like documents with optional schemas and is developed by MongoDB Inc., operating under the Server-Side Public License (SSPL).

Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to execute JavaScript code outside of a web browser It enables the creation of command line tools and server-side scripting, facilitating the generation of dynamic web page content before it reaches the user's browser This approach embodies the "JavaScript everywhere" paradigm, streamlining web application development by using a single programming language for both server-side and client-side scripting.

Express.js is a free and open-source back-end web application framework for Node.js, licensed under the MIT License It is specifically designed for creating web applications and APIs, and has become the de facto standard server framework for Node.js development.

Socket.IO is a library that enables real-time, bidirectional and event-based communication between the browser and the server It consists of:

- A Javascript client library for the browser (which can be also run from Node.js)

Here are the features provided by Socket.IO over plain WebSockets:

- Reliability (fallback to HTTP long-polling in case the WebSocket connection cannot be established)

- Broadcasting to all clients or to a subset of clients (what we call “Room”)

- Multiplexing (what we call “Namespace”) [24]

SYSTEM DESIGN

System Architechture

System design

The project includes three tables: Order, User, Product Database is designed on MongoDB, so there is not connection between the tables

Figure 4.2 Tables in the database

4.2.2.1 Add product to cart

Figure 4.4 Sequence diagram for placing orderFigure 4.3 Sequence diagram for adding product to cart

Figure 4.5 Sequence diagram for making payment

4.2.2.4 Chat with Virtual bot

Figure 4.6 Sequence diagram for chatting with virtual bot

Figure 4.7 Sequence diagram for chatting with admin

Figure 4.8 Sequence diagram for updating question

Figure 4.9 Usecase diagram for system Table 4.1 Actors in usecase diagram

Unauthenticated user Who does not login to the system

Customer Who logged in into the system using a customer account

Admin Who logged in into the system using an admin account

Figure 4.10 Usecase diagram for searching product Table 4.2 Usecase description for searching product

Use Case No CHOPPER_UC_01 Use Case Version 1.0

Use Case Name Search product

- Allow to user search product

- User can search products in web

- User inputs a text to the search input field

- User clicks “Search” icon or press “Enter”

- Success: The system will navigate to Search Result Screen and return products which match the text in the search input field

- Fail: System shows error messages

Step Actor Action System Response

1 User inputs a text to the search input field

2 User clicks “Search” icon or press

The system will navigate to Search Result Screen and return products which match the text in the search input field

No Actor Action System Response

Figure 4.11 Usecase diagram for sorting product

Table 4.3 Usecase description for sorting product

Use Case No CHOPPER_UC_02 Use Case Version 1.0

Use Case Name Sort product

- Allow to user sort products

- Users can sort products after searching

- The user clicks sort dropdown

- The user selects an option in sort dropdown

- Success: The system will sort products base on customer’s choice

- Fail: System shows error messages

Step Actor Action System Response

1 The user clicks sort dropdown The sort of dropdown will display options

2 The user selects an option in sort dropdown

The system will sort products base on user’s choice

No Actor Action System Response

4.2.4.3 Chat with bot

Figure 4.12 Usecase diagram for chatting with bot Table 4.4 Usecase description for chatting with BOT

Use Case No CHOPPER_UC_03 Use Case Version 1.0

Use Case Name Chat with BOT

- Allow to user chat with a virtual bot

- Users can chat with a virtual bot

- The user clicks on the “Message” icon

- The user writes text in the input or clicks “Micro” icon and says something

- The user clicks “Send” icon or presses “Enter”

- Success: The system responses a message based on the input of the customer and reads the content of the response

- Fail: System shows error messages

Step Actor Action System Response

1 The user clicks on the “Message” icon

The system will display options in dropdown box

2 The user writes text in the input or clicks “Micro” icon and says something

3 The user clicks “Send” icon or presses “Enter”

The system responses a message based on the input of the customer and reads the content of the response

No Actor Action System Response

4 The user clicks “Send” icon or presses

4.2.4.4 Add product to cart

Figure 4.13 Usecase diagram for adding product to cart Table 4.5 Usecase description for adding product to cart

Use Case No CHOPPER_UC_04 Use Case Version 1.0

Use Case Name Add product to cart

- Allow to customer add products to cart

- Customers can add products to cart

- The customer clicks “Add to cart” button

- Success: The system will add this product into cart and navigate to Cart Screen

- Fail: System shows error messages

Step Actor Action System Response

1 The customer selects a product The system will navigate to Product

2 The customer clicks “Add to cart” button

The system will add this product into cart and navigate to Cart Screen

No Actor Action System Response

1 Customer selects a product System shows error messages

Figure 4.14 Usecase diagram for adding shipping address

Table 4.6 Usecase description for adding shipping address

Use Case No CHOPPER_UC_05 Use Case Version 1.0

Use Case Name Add shipping address

- Allow to customer add shipping address

- Customers can add shiping address for payment

- The customer inputs the shipping address information

- The customer clicks “Continue” button

- The customer must complete the “Add to cart” action

- All field input must not be empty

- Success: The system will save the shipping address and navigate to Payment Method Screen

- Fail: System shows error messages

Step Actor Action System Response

1 The customer inputs the shipping address information

2 The customer clicks “Continue” button

The system will save the shipping address and navigate to Payment Method Screen

No Actor Action System Response

2 The customer clicks “Continue” button

- The customer must complete the “Add to cart” action

- All field input must not be empty

Figure 4.15 Usecase diagram for choosing a payment method Table 4.7 Usecase description for choosing a payment method

Use Case No CHOPPER_UC_06 Use Case Version 1.0

Use Case Name Choose a payment method

- Allow to customer choose a payment method

- Customers can choose payment method for payment

- The customer chooses a payment method

- The customer clicks “Continue” button

- The customer must complete the “Add shipping address” action

- Success: The system will save the payment medthod and navigate to Place Order

- Fail: System shows error messages

Step Actor Action System Response

1 The customer inputs the shipping address information

2 The customer clicks “Continue” button

The system will save the shipping address and navigate to Place Order Screen

No Actor Action System Response

2 The customer clicks “Continue” button

- The customer must complete the “Add shipping address” action

Figure 4.16 Usecase diagram for placing order Table 4.8 Usecase description for placing order

Use Case No CHOPPER_UC_07 Use Case Version 1.0

Use Case Name Place order

- Allow to customer place order

- The customer clicks “Place Order” button

- The customer must complete the “Choose payment method” action

- Success: The system will create a new order and navigate to Order Screen

- Fail: System shows error messages

Step Actor Action System Response

1 The customer clicks “Place Order” button

The system will create a new order and navigate to Order Screen

No Actor Action System Response

1 The customer clicks “Place Order” button

- The customer must complete the “Choose payment method” action

Figure 4.17 Usecase diagram for paying order Table 4.9 Usecase description for paying order

Use Case No CHOPPER_UC_08 Use Case Version 1.0

Use Case Name Pay order

- Allow to customer pay order

- Customers can pay their orders

- The customer clicks “Paypal” button

- The customer inputs card info and clicks “Pay now”

- The customer must have their orders

- Success: The system will pay this order and update this status order

- Fail: System shows error messages

Step Actor Action System Response

1 The customer clicks “Paypal” button

The system will navigate to Paypal service

2 The customer inputs card info and clicks “Pay now”

The system will get the result from Paypal service and alert to customer, update Order Screen

No Actor Action System Response

1 The customer inputs card info and clicks “Pay now”

- The customer must have their orders

4.2.4.9 Rate and Review product

Figure 4.18 Usecase diagram for rating and reviewing product Table 4.10 Usecase description for rating and reviewing product

Use Case No CHOPPER_UC_09 Use Case Version 1.0

Use Case Name Rate and Review product

- Allow to customer rate and review product

- Customers can rate and review products

- The customer clicks on the rating dropdown box

- The customer selects an option in dropdown

- The customer writes a comment into the comment text area

- The customer clicks “Submit” button

- Success: The system will save the rating and review of this customer and display them in the bottom of list reviews

- Fail: System shows error messages

Step Actor Action System Response

1 The customer clicks on the rating dropdown box

The system will display options in dropdown box

2 The customer selects an option in dropdown

3 The customer writes a comment into the comment text area

4 The customer clicks “Submit” button

The system will save the rating and review of this customer and display them in the bottom of list reviews

No Actor Action System Response

4 The customer clicks “Submit” button System shows error messages

Figure 4.19 Usecase diagram for chatting with admin Table 4.11 Usecase description for chatting with admin

Use Case No CHOPPER_UC_10 Use Case Version 1.0

Use Case Name Chat with Admin

- Allow to customer chat with admin

- Customers can chat with a admin

- The customer clicks on the “Message” icon

- The customer writes text in the input or clicks “Micro” icon and says something

- The customer clicks “Send” icon or presses “Enter”

- Success: The system responses a message of the admin

- Fail: System shows error messages

Step Actor Action System Response

1 The customer clicks on the

The system will display options in dropdown box

2 The customer writes text in the input or clicks “Micro” icon and says something

3 The customer clicks “Send” icon or presses “Enter”

The system responses a message of the admin

No Actor Action System Response

4 The customer clicks “Send” icon or presses “Enter”

Figure 4.20 Usecase diagram for chatting with user Table 4.12 Usecase description for chatting with user

Use Case No CHOPPER_UC_11 Use Case Version 1.0

Use Case Name Chat with user

- Allow admin to chat with customers

- Admin can chat with customers

- The admin selects an online user in Support Screen

- The admin writes text in the text input

- The admin clicks “Send” button or presses “Enter”

- Success: The system sends this message to the selected customer

- Fail: System shows error messages

Step Actor Action System Response

1 The admin selects an online user in

The system will display a box for admin to chat with the selected user

2 The admin writes text in the text input

3 The admin clicks “Send” button or presses “Enter”

The system sends this message to the selected customer

No Actor Action System Response

3 The admin clicks “Send” button or presses “Enter”

Figure 4.21 Usecase for training dataset Table 4.13 Usecase description for training dataset

Use Case No CHOPPER_UC_12 Use Case Version 1.0

Use Case Name Train dataset

- Allow admin to train dataset

- The admin clicks “Train” button in Q&A Screen

- Success: The system executes training dataset and alerts the result

- Fail: System shows error messages

Step Actor Action System Response

1 The admin clicks “Train” button in

The system executes training dataset

No Actor Action System Response

1 The admin clicks “Train” button in

Figure 4.22 Usecase diagram for managin question

Figure 4.23 Usecase Diagram for editing question Table 4.14 Usecase description for editing question

Use Case No CHOPPER_UC_13 Use Case Version 1.0

Use Case Name Edit question

- Allow admin to edit question

- Admin can add the answer for the question

- The admin clicks “Edit” button in Q&A Screen

- The admin updates the text in question field, answer field and tag field in Q&A Edit Screen

- The admin clicks “Update” button

- Success: The system updates and deletes this question

- Fail: System shows error messages

Step Actor Action System Response

1 The admin clicks “Edit” button in

The system will navigate to Q&A Edit Screen

2 The admin updates question field, answer field and tag field in Q&A

3 The admin clicks “Update” button The system will update and delete this question

No Actor Action System Response

3 The admin clicks “Update” button System shows error messages

Business Rules: b Delete question

Figure 4.24 Usecase diagram for deleting question

Table 4.15 Usecase description for deleting question

Use Case No CHOPPER_UC_14 Use Case Version 1.0

Use Case Name Delete question

- Allow admin to delete question

- Admin can delete the question that is not useful

- The admin clicks “Delete” button in Q&A Screen

- The admin clicks “OK” button in the dialog box

- Success: The system deletes this question

- Fail: System shows error messages

Step Actor Action System Response

1 The admin clicks “Delete” button in

The system will display a dialog box for admin to confirm the delete action

2 The admin clicks “OK” button in the dialog box

The system will delete this question and updates list question

No Actor Action System Response

2 The admin clicks “Cancel” button in the dialog box

This system cancels the delete action

Figure 4.25 Usecase diagram for managing dataset a Add dataset

Figure 4.26 Usecase diagram for adding dataset Table 4.16 Usecase description for adding dataset

Use Case No CHOPPER_UC_15 Use Case Version 1.0

Use Case Name Add dataset

- Allow admin to add datasets

- Admin can add datasets into the system

- The admin clicks “Add” button in Q&A Dataset Screen

- The admin inputs the text in pattern field or response field

- The admin clicks “Update” button

- Success: The system updates the datasets

- Fail: System shows error messages

Step Actor Action System Response

1 The admin clicks “Add” button in

The system will navigate to Q&A Dataset Edit Screen

2 The admin inputs the text in pattern field or response field

3 The admin clicks “Update” button The system updates the datasets

No Actor Action System Response

3 The admin clicks “Update” button System shows error messages

Business Rules: b Delete dataset

Figure 4.27 Usecase diagram for deleting dataset Table 4.17 Usecase description for deleting dataset

Use Case No CHOPPER_UC_16 Use Case Version 1.0

Use Case Name Delete dataset

- Allow admin to delete datasets

- Admin can delete datasets by tag

- The admin clicks “Delete” button in Q&A Dataset Screen

- The admin clicks “OK” button in the dialog box

- Success: The system deletes this dataset

- Fail: System shows error messages

Step Actor Action System Response

1 The admin clicks “Delete” button in

The system will display a dialog box for admin to confirm the delete action

2 The admin clicks “OK” button in the dialog box

The system will delete this dataset and updates list dataset

No Actor Action System Response

2 The admin clicks “Cancel” button This system cancels the delete action

4.2.5.1 Screens for unauthenticated users a Home Screen

Figure 4.28 UI design for Home Screen

Upon visiting the website, users are greeted by the Home Screen featuring a carousel at the top that showcases images of the three highest-rated products based on customer reviews Below the carousel, a comprehensive list of products is available for users to explore, allowing them to click on any item for detailed information Additionally, users can engage with a virtual chatbot by clicking the message icon for assistance.

Figure 4.29 UI design for Product Screen

Upon selecting a product from the Home Screen, users are directed to the Product Screen, which showcases comprehensive details such as the product image, description, price, availability status, and quantity in stock Additionally, customer reviews are displayed below to provide further insights.

Figure 4.30 UI design for Cart Screen

Upon clicking the "Add to Cart" button on the Product Screen, users are directed to the Cart Screen, where they can view the products they have added This screen allows users to modify the quantity of items or remove products from their cart as needed.

Figure 4.31 UI design for Search Result Screen

On the Search Result Screen, users can easily find products by entering text in the search bar and clicking the "search" icon, which displays matching products below Additionally, users have the option to sort or filter the product list to efficiently locate their desired items.

Figure 4.32 UI design for chatting with virtual bot

When users click the message icon, the chatbox interface appears, allowing them to interact with the virtual chatbot by typing messages and clicking the "Send" icon to receive audio responses Alternatively, users can utilize the mic icon to voice their messages instead of typing Additionally, the volume icon enables users to easily turn the sound on or off.

4.2.5.2 Screens for customers a Chat with virtual bot and admin

Figure 4.33 UI design for chatting with virtual bot and admin

Upon successful login to the website, customers can engage in chat with both the admin and a virtual bot If the admin is unavailable, the virtual bot will respond to customer inquiries, ensuring continuous support When the admin is online, they will directly interact with customers for a more personalized experience.

Figure 4.34 UI design for Place Order Screen

Once the product is added to the cart and the customer enters their shipping address and selects a payment method, they will be directed to the Place Order Screen This screen provides essential details such as the shipping address, customer name, payment method, product information, and the total order cost.

Figure 4.35 UI design for Order History Screen

This screen displays the customer's order history, featuring essential details like order date, total amount, payment status, and delivery status For orders that have been paid or shipped, the corresponding dates will be indicated Customers can access specific order information by clicking the "Details" button.

4.2.5.3 Screens for admins a Chat with user

Figure 4.36 UI design for chatting with user

Upon accessing the Support Screen, the admin engages in real-time chat with customers through a designated dialog box The interface features a left section displaying a list of online customers, while the right section showcases the ongoing chat messages, facilitating seamless communication.

Figure 4.37 UI design for Q&A Screen

This screen displays a list of customer questions that the virtual has not yet learned Admins can click the “Delete” button to delete the question or click the

“Edit” button to reply to that question Admin can click the “Train” button to let the virtual bot learn the sets of questions and answers c Dataset Screen

Figure 4.38 UI design for Dataset Screen

This screen displays a list of data sets that the vitual bot has learned Each row of the table includes:

- Type: categorize questions and answers

- Question: contains questions or phrases that need to be answered, can contain multiple questions

- Answer: contains answers to questions, can contain multiple answers

Admin can click the "Create" button to add new sets of questions and answers

Chatbot system

➢ Results for the Chatbot system model:

- Number 1: Customers can talk through a receiver that transmits sound as input to the system In addition, customers can also text, not necessarily using voice

- Number 2: The output of Speech-to-Text is text

- Number 3: API Input and Output Processing Center

- Number 5: system deep learning use fully connected neural network

- Number 7: Message returned from predicting results in a deep learning model

- Number 8: API Zalo Text-to-Speech

- Number 9: URL sound This is output by API Zalo Text-to-Speech

- Number 10: Show Message by Bot

- Number 12: Play URL sound in website

➢ New re-trainning function for admin:

Figure 4.40 Re-trainning function for admin

- Number 3: File Json save new questions

- Number 4: Function Delete question by Admin in file Json New Question

- Number 6: Categories tag, patterns – Questions from customers, responses - Question from the salesperson

- Number 7: Function Create and Delete Tag by Admin in file json dataset

4.3.2 Details of each part a Speech to text

Figure 4.41 Speech to text model

• How do you get the voice of a client in the system?

• How to quickly detect words through voice?

• Initially used python's recognition but had a big problem that it was not possible for the client to stream audio directly from the website interface to the backend for processing

• So decided to convert the audio to text from the frontend and then pass the text through the API down to the backend for processing

• Using recognition by javascript b API Input and Output Processing Center

• How do you get a protocol between interface-to-face with the system?

Python offers numerous libraries for API development, with Flask being the most widely used However, since early 2021, FastAPI has gained popularity among programmers due to its simplicity and ease of use.

• Therefore, the FastAPI library is chosen to build the API for the system

• Note that the library is only available for python version 3.x

• Using FastAPI library of the python to build API c Natural language processing

Figure 4.43 Natural Language processing model

• How can the machine understand the exact meaning of the customer's questions?

• Filter the keywords in the question and learn special phrases?

During the data collection process, it was found that inconsistent capitalization of words could negatively impact the deep learning model's performance To address this issue, the current solution involves standardizing the text by converting all words to a uniform case.

In python, using this syntax “.lower()” is quite simple but solved the above problem

In both Vietnamese and English, certain words such as "Nha," "nhé," "ạ," "thì," and "là" are frequently repeated, which can hinder the accuracy of training processes and lead to confusion in customer inquiries Eliminating these stopwords can effectively address this issue.

To effectively process sentences in Vietnamese, it is essential to separate each word accurately Two key libraries were utilized during this research: the NLTK package, which is widely used in natural language processing (NLP) but offers limited support for Vietnamese, and the Underthesea toolkit, specifically designed for Vietnamese NLP While NLTK's "nltk.word_tokenize" function primarily separates words based on spaces, it does not perform well for Vietnamese text In contrast, Underthesea provides comprehensive support for word segmentation in the Vietnamese language.

• Convert sentense to vector (bag-of-words Model): We can not work with text directly when using machine learning algorithms Instead, we need to convert the text to numbers

• Using word-token by Underthesea d Dataset

➢ Question: How can the dataset learn and be able to classify questions and answers correctly?

The dataset, derived from English datasets available online, requires three essential keywords: Tags, Patterns, and Responses Tags serve as labels for the data, categorizing the question types Patterns represent the training samples used for learning, while Responses consist of sample messages that provide relevant answers.

• Using Json file save dataset e System deep learning and message predicting results

"patterns": ["Xin chào", "Tôi cần giúp đỡ"],

"Xin chào quý khách Hãy hỏi, , để biết thêm thông tin về tôi nhé",

"Xin chào Mình có thể hỗ trợ gì cho bạn không? Bạn có thể hỏi ."],

• At first, the model used was from the tflearn package:

The model features an input layer that matches the length of the training data, two fully connected hidden layers designed for eight output dimensions, and an output layer corresponding to the length of the training labels, utilizing a "softmax" activation function.

The current model, built with TFLearn, has limitations in performance despite its perfect system functionality To enhance the model's capabilities, we are transitioning from TFLearn to TensorFlow Keras, which is a more modern framework The new TensorFlow Keras model utilizes a sequential architecture with an input layer, two hidden layers of 128 and 64 neurons respectively, both employing ReLU activation and dropout for regularization, followed by an output layer that matches the length of the training labels with a softmax activation function The model is compiled using the Adam optimizer and categorical crossentropy as the loss function, and it is trained on the dataset for a specified number of epochs with a batch size of 5 Additionally, the previous TFLearn model structure is noted, which included multiple fully connected layers and an output layer with softmax activation, highlighting the shift to a more efficient and robust solution.

#output layer net = tflearn.regression(net) model = tflearn.DNN(net) model.fit(, , n_epoch00, batch_size=8, show_metric True)

• The first is to initialize the Sequential model for the problem

• Input is a one-dimensional array of the same size as the training data length

• Dense is a way to declare a neural network layer in Keras, with output_dim being the output dimension of that layer, and activation is the activation function of the layer

• Dropout layer used as regularization for layers with limited overfitting

• The output of the problem will use the activation function to calculate the probability (activation ="softmax")

• The compile function is the function needed to identify the optimizers during training

• Loss= “categorical crossentropy”: use in multiclass classification

• Using Model in Tensorflow Keras f Text to speech

• How can chatbots communicate by voice like virtual assistants?

• How can you transmit sound through api?

Chatbots enhance user experience by providing instant responses, creating a sense of immediacy in communication To better meet customer needs, businesses should transition from standard messaging to live chat, allowing customers to engage with consultants as if they were in a physical store Integrating text-to-speech technology can further enrich this interaction, making conversations more dynamic and accessible.

Google's Text-to-Speech (gTTS) is a Python library and command-line interface tool that allows users to access the text-to-speech API of Google Translate It enables the generation of spoken "mp3" audio files, which can be saved for audio manipulation or output directly to the standard output One of the key advantages of gTTS is its support for a wide variety of languages, making it a popular choice among users due to its free availability and the credibility of being developed by Google.

72 o Disadvantages: Voice reading for Vietnamese is not good, can't change reading speed

FPT Technology Innovation Department has dedicated nearly 8 years to developing FPT Speech Synthesis, recognized as the leading integrated Vietnamese voice system available today **Key Features** - **Advantages**: Offers high-quality Vietnamese voices with adjustable reading speeds and options for male or female voices - **Limitations**: Free usage is capped at 100,000 words per month, with additional usage requiring a purchase **API Usage** To utilize the API, users must create an account on the FPT.AI Console The API operates via HTTP POST requests at the endpoint: `https://api.fpt.ai/hmi/tts/v5` **Request Parameters** - **api_key**: Required to authenticate requests - **voice**: Optional; specifies the desired voice type - **speed**: Optional; adjusts the voice speed - **format**: Optional; defines the output audio format (mp3 or wav) - **callback_url**: Optional; provides a URL for notifications when audio content is ready **Example Request** ```shell curl -X POST \ -H "api_key: xxxxxxxxxxxxx" \ -H "voice: banmai" \ -H "callback_url: your_callback_url" \ -H "Cache-Control: no-cache" \ -d 'Bạn thấy dịch vụ TTS của FPT có tốt không?' \ "https://api.fpt.ai/hmi/tts/v5" ``` **Response Details** The response is a JSON object containing a link to the synthesized audio file, with an error code indicating success or failure Users can expect a processing time of 5 seconds to 2 minutes, depending on text length.

Figure 4.44 The price of Text to speech FPT.ai

• API Text to speech vbee.vn: Similar to FPT.ai API, but the system is specialized for online consulting calls Free version does not use API o Price list:

Figure 4.45 The price of Text to speech vbee.vn

The Zalo Text-To-Speech (ZTTS) engine provides fast, high-quality audio from Vietnamese text, making it ideal for applications like news websites, voice streaming services, chatbots, and virtual assistants It supports four Vietnamese voices, including two Northern and two Southern accents, and offers features such as adjustable reading speed and gender selection However, users can access the service for free up to 1,000,000 words per month, with additional usage requiring a purchase For more information, refer to the user manual at https://zalo.ai/docs/api/text-to-audio-converter.

We utilize the Zalo.ai Text-to-Speech API to generate sound links, which are then played using JavaScript Additionally, we are enhancing the chatbot by developing new data addition functionalities.

• The system has been completed, but the data needs to be updated to be good for many purposes, what to do?

Figure 4.46 The first research process model

The system employs machine learning to categorize customer inquiries, allowing administrators to provide answers This enables the addition of more customer questions when the machine is not actively learning However, a significant drawback of this system is its complexity; automatic text classification may lead to errors, resulting in inaccurate predictions by the chatbot system.

• The second research direction: (The system is displayed above)

➢ Solutions: Using the second presented system h Deploy server

Heroku is a versatile cloud platform that simplifies the process of building, deploying, managing, and scaling applications, allowing developers to concentrate on product development without the hassle of server management While it offers numerous services for free, users are limited to 550 hours of usage per month; upgrading to 1,000 hours requires a payment method Nevertheless, this limitation is sufficient for testing ideas or small websites, especially considering the total source code size is capped at 500 MB.

Deploying a server on Google Cloud Platform (GCP) offers a robust cloud computing solution for individuals and businesses to develop and manage applications using Google's advanced software infrastructure One of the key advantages of GCP is the initial credit of $100 provided upon account signup, which can be utilized over the first three months However, it's important to note that after this trial period, continued usage requires a paid subscription.

➢ Solutions: Deploy server to google cloud Platform

SYSTEM IMPLEMENTATION

Software development environments

- Frontend: o Develop in Visual Code IDE o Run with Node server background

- Backend: o Develop in Visual Code IDE o Run with Node server background o Using postman to check APIs

- Deep Learning Service: o Develop in Visual Code IDE o Run FastAPI with Python web server Uvicorn o Using postman to check APIs

Source code management

- Source code in Backend and Frontend are managed by Github

- Github management tool is sourcetree and github desktop

- Link source code Website: https://github.com/zZChopperZz/DOANTOTNGHIEP

- Link source code Backend Chatbot: https://github.com/AlvinDMartin/backend-website-chatbot

Deployment environment

5.3.1 Deploying the website on Heroku

Backend and frontend are deployed to Heroku so the website can be accessed at any time

- Create git repository: open the terminal, in the root folder of project, run the command “git init”

- Create Heroku account in https://dashboard.heroku.com/apps

- Install Heroku CLI in https://devcenter.heroku.com/articles/heroku-cli

- Login to Heroku: in the terminal, run command “heroku login” to login to heroku

- Create heroku app: in the terminal, run command “heroku apps:create

- Edit package.json for build script: o Create a new command in the “scripts” section: “build”: “cd frontend && npm install && npm run build”

Figure 5.3 Create build script in package.json o Set node and npm version on the Heroku sever

Figure 5.4 Set node and npm version on the Heroku server

- Create Procfile: the command in Procfile will run after installing all packages and it will launch the website for us

- Set database connection in Heroku env variables, set

“SKIP_PREFLIGHT_CHECK=true” to skip preflight check

Figure 5.6 Set database connection in Heroku env variables

Figure 5.7 Set env variable to skip preflight check

Figure 5.8 Commit and push to Heroku

Figure 5.9 Deploy changes to Heroku

5.3.2 Deploying the Chatbot API on Google Cloud Platform

- Create VM instances from Google Cloud Platform:

• Login Google Cloud Platform by account google

• Connect Server Ubuntu generated from VM by SSH:

Figure 5.12 Connect Server Ubuntu generated from VM by SSH

• Clone source code by Git:

Figure 5.13 Clone source code by Git

• Install all support libraries for the system

• Install PM2 (process manager for applications) and running python Uvicorn by PM2

Figure 5.14 Install PM2 and running python Uvicorn by PM2

To ensure the frontend website deployed on Heroku operates securely, it's essential to convert the API from HTTP to HTTPS This process involves installing Nginx and utilizing Cloudflare to map the IP address to the domain Additionally, you can create a free domain for 12 months through Freenom.com.

Figure 5.15 Create domain by Freenom.com o Setting from IP Server to domain by Cloudflare.com

Figure 5.16 Setting from IP Server to domain by Cloudflare.com

82 o Setting configure Nginx on Ubuntu 18.04

• All processing APIs: o Execute API return message “Xin chào…” by Bot at the current time POST: https://quocdatit.tk/chatbot/chat-hello

To configure the server for the domain quocdatit.tk, listen on port 80 and set the appropriate headers for proxying requests The configuration includes setting the X-Forwarded-For and Host headers, and directing traffic to the internal address http://10.128.0.2:4200 Additionally, for OPTIONS requests, it is essential to allow cross-origin resource sharing (CORS) by adding headers for Access-Control-Allow-Origin, Access-Control-Allow-Credentials, and Access-Control-Allow-Methods, which include GET and POST.

OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-

CustomHeader,Keep-Alive,User-Agent,X-Requested- With,If-Modified-Sin$ add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204;

} if ($request_method = 'POST') { add_header Access-Control-Allow-Origin *; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods'

'GET, POST, OPTIONS, HEAD'; add_header 'Access-Control-Allow-Headers' 'DNT,X-

CustomHeader,Keep-Alive,User-Agent,X-Requested- With,If-Modified-Sin$

} if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods'

'GET, POST, OPTIONS HEAD'; add_header 'Access-Control-Allow-Headers' 'DNT,X-

CustomHeader,Keep-Alive,User-Agent,X-Requested- With,If-Modified-Sin$

Figure 5.17 API return welcom message

Return message and URL mp3 sound o Execute API return message by Bot:

POST: https://quocdatit.tk/chatbot/chat-run Body/raw/json:

{ "user": "your_user_here", "name": "your_name", "request_question": "your_message"

Figure 5.18 API return greet message o Execute API training model:

GET: https://quocdatit.tk/chatbot/chat-training

Figure 5.19 API training model o Execute API get list new questions

GET: https://quocdatit.tk/update/chat-getlistquestions/

Or GET: https://quocdatit.tk/update/chat-getlistquestions/ “item_id”

Figure 5.20 API get list new questions o Execute API update dataset

POST: https://quocdatit.tk/update/chat-newquestions/ “id_question” Body/raw/json:

Figure 5.21 API update dataset o Execute API delete the saved question

GET: https://quocdatit.tk/update/chat-delete-newquestions/ “id”

{ "tag": "xin chào", "responses": "cảm ơn bạn đã đến với cửa hàng Hãy để tôi giúp bạn nhé"

Figure 5.22 API delete the saved question o Execute API get list dataset

GET: https://quocdatit.tk/dataset/get-all-dataset/

Figure 5.23 API get list dataset o Execute API get list “Tag” in dataset

GET: https://quocdatit.tk/dataset/get-tag-dataset/

Or GET: https://quocdatit.tk/dataset/get-tag-dataset/ “id_tag”

Figure 5.24 API get list “Tag” in dataset o Execute API add new “Tag”, “patterns” and “responses” to dataset POST: https://quocdatit.tk/dataset/create-dataset/

Figure 5.25 API add new dataset (tag, pattern, response) o Execute API add new “patterns” and “responses” for “Tag” in dataset POST: https://quocdatit.tk/dataset/edit-dataset/

{ "tag": "new_tag", "patterns":"new_patterns", "responses":"new_responses"

Figure 5.26 API add new dataset (pattern, response) o Execute API delete “Tag”in list dataset

POST: https://quocdatit.tk/dataset/delete-dataset/

Figure 5.27 API delete Tag in list dataset o Execute API Test-to-Speech of Zalo.ai

POST: https://quocdatit.tk/texttospeech/soundAPI/

{ "tag":"current_tag", "patterns":"new_patterns", "responses":"new_responses"

Figure 5.28 API Test-to-Speech of Zalo.ai

Return url mp3 sound: https://chunk.lab.zalo.ai/705d27a244f0adaef4e1/705d27a244f0adaef4e1

Built screens

{ "text": "xin chào, mình là nhân viên bán hàng ảo"

Figure 5.33 Welcom interface of Chatbot

Figure 5.34 Main interface of Chatbot

Figure 5.35 List Question Screen (Admin)

Figure 5.36 Edit Question Screen (Admin)

Figure 5.37 List Dataset Screen (Admin)

Figure 5.38 Edit Dataset Screen (Admin)

5.4.11 Create New Dataset Screen (Admin)

Figure 5.39 Create New Dataset Screen (Admin)

CONCLUSION

Conclusion

The implementation team has completed 90% of the work according to the initial target

The e-commerce website features three key user roles: Unauthenticated users can browse products, view details, add items to their cart, search for products, and interact with a chatbot Customers have the ability to place orders, make payments, rate and review products, update personal information, and chat online with both the chatbot and admin Meanwhile, the Admin role encompasses comprehensive management capabilities, including creating, editing, and deleting products; managing users and orders; handling questions and datasets; training datasets; and engaging in customer chat support.

Our deep learning service offers a comprehensive system equipped with advanced processing capabilities, including an automatic message reply function With a training data accuracy exceeding 95%, we achieve impressive results by training for 500 epochs, resulting in a significantly reduced loss rate of less than 0.1%.

Figure 6.1 The loss rate after training

96 o Predict the answer well: when the probability reaches more than 60% will return the prediction result, otherwise send the message "not learned"

Red point: location tag highest (more than 60%)

Blue point: location of other points

Result messages predict: “Xin chào Mình có thể hỗ trợ gì cho bạn không?

Bạn có thể hỏi .”

Message customer: “có bán giày không”

Red point: location tag highest (less than 60%)

Blue point: location of other points

Result messages predict: “Có lẽ tôi chưa được học, bạn đợi Admin để được giải đáp nhé.”

Gaining experience in deep learning, particularly in chatbot development, has enabled me to design an efficient data update system for chatbots I have successfully implemented API design and deployed systems on Ubuntu servers within the Google Cloud Platform Additionally, I have explored the integration of Speech-to-Text and Text-to-Speech technologies, enhancing user interaction My understanding of how deep learning integrates into web applications further solidifies my expertise in this rapidly evolving field.

Advantages

- Frontend and backend are both uploaded to Heroku, this keeps the website ready, anyone can access the website at any time

- MERN stack is a modern technology, it helps to build an organized, easy-to-

98 manage, extensible and upgradeable source code structure, in addition, it also helps to process requests quickly, improve website performance

The chatbot system leverages deep learning techniques to achieve optimal performance Its capacity to update training data facilitates convenient learning enhancements, making it applicable across various industries.

- From the Speech-to-Text, Text-to-Speech technology of virtual assistants, we can apply that to chatbots to improve the ability to communicate online with customers more closely.

Disadvantages

- The interface is not really eye-catching, some of the layouts are not properly arranged

- The source code still has many places that are not well optimized, leading to reduced performance

- Although Speech-to-Text has been applied, it has not yet brought the closest approach to users

- Processing speed has not been improved well.

Development directions

- Using system Sentiment Analysis customer

- Optimize code for improved performance and easy extensibility

- Redesign the interface and add advanced functions to make it easier to reach users

[1] MongoDB Inc, MERN Stack [online] Available at: https://www.mongodb.com/mern-stack [Accessed July 05, 2021]

[2] Mau Ha Quang, Nhung gi can biet ve Chatbot [online] Available at: https://viblo.asia/p/tat-ca-nhung-gi-ban-can-biet-ve-chatbot-Az45bnNg5xY

[3] Wikipedia, Chatbot [online] Available at: https://en.wikipedia.org/wiki/Chatbot#Customer_Service [Accessed July 05, 2021]

[4] Wikipedia, Virtual assistant [online] Available at: https://en.wikipedia.org/wiki/Virtual_assistant [Accessed July 05, 2021]

[5] Zalo, Text to Speech [online] Available at: https://zalo.ai/docs/api/text-to-audio-converter [Accessed July 05, 2021]

[6] FPT Corporation, Text to Speech [online] Available at: https://docs.fpt.ai/docs/en/speech/documentation/text-to-speech

[7] Wikipedia, Python [online] Available at: https://en.wikipedia.org/wiki/Python_(programming_language)

[8] Wikipedia, TensorFlow [online] Available at: https://en.wikipedia.org/wiki/TensorFlow [Accessed July 08, 2021]

[9] JavaTpoint, Advantage and disadvantage of TensorFlow [online] Available at: https://www.javatpoint.com/advantage-and-disadvantage-of-tensorflow

[10] Trần Ngọc Minh, Cập nhật nhanh TensorFlow 2.0 [online] Available at: https://ngocminhtran.com/2020/03/22/cap-nhat-nhanh-tensorflow-2-0/

[11] Wikipedia, Keras [online] Available at: https://en.wikipedia.org/wiki/Keras [Accessed July 08, 2021]

[12] DataFlair, Keras Advantages and Limitations [online] Avaiable at: https://data-flair.training/blogs/python-keras-advantages-and-limitations/

[13] Wikipedia, Natural Language Toolkit [online] Available at: https://vi.wikipedia.org/wiki/Natural_Language_Toolkit [Accessed July 12, 2021]

[14] Guru99, NLTK Tokenize words sentences [online] Available at: https://www.guru99.com/tokenize-words-sentences-nltk.html

[15] Wikipedia, Bag-of-words [online] Available at: https://en.wikipedia.org/wiki/Bag-of-words_model [Accessed July 12, 2021]

[16] Tran Xuan Chien, NLP Stemming and Lemmatazation [online] Available at: https://chienuit.wordpress.com/2016/05/03/nlp-stemming-va-lemmatization/

[17] Vu Anh, Readme underthesea [online] Available at: https://underthesea.readthedocs.io/en/latest/readme.html [Accessed July 14, 2021]

[18] FastAPI, FastAPI [online] Available at: https://fastapi.tiangolo.com/ [Accessed July 14, 2021]

[19] Đào Hải Long, Vì sao chọn FastAPI [online] Available at: https://viblo.asia/p/vi-sao-chon-fastapi-gGJ59M6D5X2 [Accessed July 14, 2021]

[20] Wikipedia, ReactJS [online] Available at: https://en.wikipedia.org/wiki/React_(JavaScript_library) [Accessed July 06, 2021]

[21] Wikipedia, MongoDB [online] Available at: https://en.wikipedia.org/wiki/MongoDB [Accessed July 06, 2021]

[22] Wikipedia, NodeJS [online] Available at: https://en.wikipedia.org/wiki/Node.js [Accessed July 06, 2021]

[23] Wikipedia, Express Framework [online] Available at: https://en.wikipedia.org/wiki/Express.js [Accessed July 06, 2021]

[24] Socket.IO, Introduction [online] Available at: https://socket.io/docs/v4/ [Accessed July 08, 2021]

Ngày đăng: 05/06/2022, 17:41

Nguồn tham khảo

Tài liệu tham khảo Loại Chi tiết
[1] MongoDB Inc, MERN Stack. [online] Available at: https://www.mongodb.com/mern-stack [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: MERN Stack
[2] Mau Ha Quang, Nhung gi can biet ve Chatbot. [online] Available at: https://viblo.asia/p/tat-ca-nhung-gi-ban-can-biet-ve-chatbot-Az45bnNg5xY [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: Nhung gi can biet ve Chatbot
[3] Wikipedia, Chatbot. [online] Available at: https://en.wikipedia.org/wiki/Chatbot#Customer_Service [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: Chatbot
[4] Wikipedia, Virtual assistant. [online] Available at: https://en.wikipedia.org/wiki/Virtual_assistant [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: Virtual assistant
[5] Zalo, Text to Speech. [online] Available at: https://zalo.ai/docs/api/text-to-audio-converter [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: Text to Speech
[6] FPT Corporation, Text to Speech. [online] Available at: https://docs.fpt.ai/docs/en/speech/documentation/text-to-speech [Accessed July 05, 2021] Sách, tạp chí
Tiêu đề: Text to Speech
[7] Wikipedia, Python. [online] Available at: https://en.wikipedia.org/wiki/Python_(programming_language) [Accessed July 06, 2021] Sách, tạp chí
Tiêu đề: Python
[8] Wikipedia, TensorFlow. [online] Available at: https://en.wikipedia.org/wiki/TensorFlow [Accessed July 08, 2021] Sách, tạp chí
Tiêu đề: TensorFlow
[9] JavaTpoint, Advantage and disadvantage of TensorFlow. [online] Available at: https://www.javatpoint.com/advantage-and-disadvantage-of-tensorflow [Accessed July 08, 2021] Sách, tạp chí
Tiêu đề: Advantage and disadvantage of TensorFlow
[10] Trần Ngọc Minh, Cập nhật nhanh TensorFlow 2.0. [online] Available at: https://ngocminhtran.com/2020/03/22/cap-nhat-nhanh-tensorflow-2-0/ Sách, tạp chí
Tiêu đề: Cập nhật nhanh TensorFlow 2.0

TRÍCH ĐOẠN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w