A method for implementing a process-driven dialogue system and a dialogue robot based on a workflow engine
Through a process-driven method, combined with BPMN2.0 and Activiti workflow engine, the dialogue system is developed at low code, which solves the problem of high difficulty in developing traditional dialogue systems, and realizes fast and low-cost dialogue system construction, improving user experience.
Patent Information
- Application Number
- CN202211720967.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The existing dialogue system is difficult to develop, has high technical requirements, and has poor flexibility. It cannot respond quickly to scene changes, has low user experience fluency, and it is difficult for ordinary developers to quickly build a dialogue system.
Through a process-driven method, the dialogue flow chart is drawn using the BPMN2.0 specification, combined with the Activiti workflow engine and the Rasa open source framework, low-code development dialogue system is developed, reducing code writing, lowering development thresholds, and achieving rapid construction of dialogue systems.
It realizes a low-code development dialogue system, reduces development difficulty and cost, and ordinary users can also quickly build dialogue robots, improving development efficiency and user experience.
Smart Images

Figure CN116048610B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of dialogue robots, and particularly relates to a method for implementing a process-driven dialogue system and a dialogue robot based on a workflow engine. Background Art
[0002] Nowadays, humanity has entered the era of artificial intelligence, and many enterprises are developing their own customer service robots. This not only facilitates users to consult questions 24 hours a day but also reduces the cost of enterprises hiring customer service staff. However, the research and development of current dialogue systems is a very difficult task for most developers, with high requirements for technology and data. For example, the current traditional dialogue systems are mainly divided into three types: question-and-answer robots, task robots, and chatty robots.
[0003] When implementing the three types of dialogue systems, a large amount of code needs to be written. For example, when developing a traditional dialogue system, developers first write the corpus bit by bit into the natural language understanding file and also need to write relevant configuration files. In addition, developers sometimes need to write code related to intent recognition and also write code related to dialogue management (i.e., determining what actions need to be completed next). Moreover, the configuration of traditional dialogue systems has a high learning cost for users, high technical requirements, poor flexibility, and requires certain coding skills, and cannot quickly respond to the changing needs of scenarios. In addition, if developers do not conduct business analysis and draw the corresponding business process diagram in advance, there may be unclear design logic, resulting in the dialogue system not being able to well understand the user's intent and poor context semantic understanding ability in multi-turn conversations, leading to a low fluency of the user experience. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for implementing a process-driven dialogue system in view of the deficiencies of the prior art. The purpose of the present invention is achieved through the following technical solutions, including the following steps:
[0005] 1) First, conduct business analysis. Programmers analyze the dialogue scenarios according to the requirements, abstract the dialogue process, and then analyze the corresponding dialogue flowcharts according to the corresponding dialogue scenarios.
[0006] 2) Based on the dialogue process analyzed in step 1), prepare the corresponding dialogue corpus, intents, slot values, etc.
[0007] 3) Based on steps 1) and 2), use the BPMN2.0 specification to draw the dialogue flowchart, where BPMN (Business Process Modeling Notation, that is, business process modeling symbol) is a general and standard language for process modeling used to draw business process diagrams.
[0008] 4) The deployment of the conversation flow based on step 3) mainly consists of three parts: first, deploying the BPMN file of the conversation flow; second, writing the relevant corpus prepared by the user into the database; third, writing the corpus into the files related to natural language understanding to train the conversation system. Finally, the entire deployment process is completed. The deployment of the conversation flow is truly completed only when the three parts are finished, and the conversation robot is realized. The following details the steps related to the three parts.
[0009] 5) For the first part of the deployment in step 4), deploy the BPMN file in the conversation flow. Through the BPMN file of the conversation flow drawn in step 3), deploy the conversation flow diagram through the process engine.
[0010] 6) For the second part of the deployment in step 4), write the data such as the corpus, intent, and slots prepared by the user into the database table in step 2), and write each process node in the conversation flow diagram together with the corresponding conversation intent and corpus into the corresponding database table. The user can view the content such as the intent, corpus, and slot values corresponding to each process node according to the requirements.
[0011] 7) For the third part of the deployment in step 4), train the traditional conversation system. First, write a script to create the files corresponding to running the traditional conversation system, such as files related to natural language understanding, configuration, and domain. Then write the information such as the corpus, intent, and slots written into the database in step 6) into the natural language understanding file and configuration file of the traditional conversation system. Then perform model training. When the training is completed, the entire process deployment is successful.
[0012] 8) After the deployment in step 7) is completed, conduct a test experience through the front-end interface provided by the traditional conversation system for user experience. Then apply for release. The construction of the conversation system driven by the process is completed.
[0013] The present invention proposes a method for implementing a process-driven dialogue system, that is, it is prepared to utilize a fusion workflow engine and a traditional dialogue system to implement the configuration of the intentions and actions of the traditional dialogue system through workflow definition and process-driven methods. The specific steps are as follows. Before designing the process-driven dialogue system, first conduct a requirements analysis of the dialogue process, and then design the dialogue process for complex business logics. Designers can clearly understand the design ideas and frameworks to avoid errors. Then draw a dialogue flow chart, deploy the process through the process engine, and write the corresponding corpus, intentions, slots, etc. into the database and the natural language understanding file of the traditional dialogue system. Finally, train the model of the traditional dialogue system. Finally, a dialogue system can be implemented. Here, we do not need to write the natural language understanding file and the corresponding configuration file by ourselves. Users only need to draw the corresponding dialogue process and provide the corresponding corpus information to easily build a dialogue system, achieving low-code development, greatly reducing the development difficulty and lowering the development threshold. Developers can build a dialogue system efficiently and at low cost.
[0014] Furthermore, for the dialogue corpus, intentions, slot values, etc. prepared in steps 1) and 2), corresponding robot response speech corpora also need to be given. The database table is created using MySQL.
[0015] Furthermore, in step 3), BPMN is a business process modeling notation and a general standard language for process modeling, which can be used to draw business process diagrams to better enable people to understand business processes and their interrelationships. There are two versions of BPMN. The BPMN 1.0 specification was released by the standard organization BPMI in May 2004, and then the BPMN 2.0 standard was launched by the OMG organization in 2011. The BPMN 2.0 standard is what we use.
[0016] Furthermore, in step 4), the BPMN file is drawn by the actiBPM process designer, a plug-in installed in IDEA. actiBPM is a process definition tool.
[0017] Further, in step 4), the traditional dialogue system framework used is Rasa, which is an open-source machine learning framework for building dialogue robots (intelligent assistants). It enables developers to create industrial-grade dialogue robots using machine learning techniques. Rasa has two core components, Rasa NLU and Rasa Core. Rasa NLU is responsible for converting user input into intent and entity information, which is the process of natural language understanding. Rasa Core is mainly responsible for making decisions on the next action based on the current and historical dialogue records, which may be to reply to the user with a certain piece of information. The corpus we prepared is processed by Rasa NLU, and the dialogue robot we built is also trained using Rasa models.
[0018] Further, based on step 4), the Rasa training process includes Rasa NLU training and Rasa Core training. The Rasa training mainly has two parts: entity recognition and intent recognition. To complete these tasks, Rasa NLU usually needs to include various components to achieve, such as language model components, word segmentation components, feature extraction components, NER components, intent classification components, entity and intent joint extraction components, etc. Rasa Core training is responsible for the dialogue management part, that is, its main responsibility is to record the dialogue process and train to select the next action.
[0019] Further, based on step 5), the process engine uses the currently most widely used workflow engine, Activiti. Activiti is a workflow engine that can extract the complex business processes in the business system and define them using the specialized modeling language BPMN2.0. The business processes are executed according to the pre-defined processes, realizing that the processes of the system are managed by Activiti, reducing the workload of system upgrade and transformation due to process changes in the business system, thereby improving the robustness of the system and also reducing the system development and maintenance costs.
[0020] Further, based on step 5), the steps for using the Activiti workflow engine are as follows: deploying the workflow engine, process definition, process definition deployment, starting a process instance, users querying for pending tasks, handling tasks, and process end.
[0021] Further, based on step 5), the development environment requires JDK 1.8 or above, a database, Tomcat 8.5, IDEA, and a process definition tool, and Rasa, an open-source machine learning framework for building dialogue robots (intelligent assistants).
[0022] Further, based on step 8), Rasa X is a dialogue-driven tool. Rasa X can generate a website for test users. After the test users open it with a browser, they will get a simple chat interface for chatting with the robot.
[0023] The beneficial effects of the present invention are as follows:
[0024] A method for implementing a process-driven dialogue system according to the present invention can develop a dialogue system with low code through a process engine combined with a traditional dialogue system, that is, it is prepared to utilize a fusion workflow engine and a traditional dialogue system to implement the configuration of the intents and actions of the traditional dialogue system through workflow definition and process-driven methods. This greatly saves time costs, greatly reduces the development difficulty, lowers the development threshold, and developers can build a dialogue system efficiently and at low cost. And ordinary users can also quickly build a dialogue flow robot according to their own needs to achieve human-computer dialogue. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Flowchart of the method proposed by the present invention;
[0026] Figure 2 Database design tables for corpus, intents, slots, etc.;
[0027] Figure 3 Flowchart for querying weather;
[0028] Figure 4 Database tables related to the operation of Activiti;
[0029] Figure 5 Diagrams related to the operation of Rasa;
[0030] Figure 6 Diagrams related to config.yml;
[0031] Figure 7 User test diagram. DETAILED DESCRIPTION OF THE INVENTION
[0032] The method proposed by the present invention will be further described in detail below with reference to the accompanying drawings and specific examples.
[0033] A method for implementing a process-driven dialogue system according to the present invention can quickly build a dialogue flow robot through a process engine combined with a traditional dialogue system to achieve human-computer dialogue. As Figure 1 shown, it includes the following steps: A specific example is to construct a dialogue robot for querying weather:
[0034] Step 1: Business analysis. This dialogue business is a dialogue robot for querying weather. Sort out the flowchart corresponding to the dialogue logic design, and then analyze the corresponding dialogue flowchart according to the corresponding dialogue scenarios.
[0035] Step 2: Based on the conversation logic sorted out in Step 1, prepare corresponding corpus, intents, slot values, reply scripts, and other related content, and store them in a database table. The database table is as Figure 2 shown.
[0036] Step 3: Use the actiBPM process definition plugin to draw the corresponding weather query robot flowchart, that is, define the process, and save it in the formats of Weather.bpmn and Weather.png. The flowchart files are as Figure 3 shown.
[0037] Step 4: Deploy the conversation process engine. First, configure the Activiti 7.0 workflow environment on IDEA, download Activiti 7.0, and the download address is: http: / / activiti.org / download.html and configure the relevant Maven dependencies. Then install the relevant database. The databases supported by Activiti include h2, MySQL, oracle, etc. Here we use the MySQL database. The MySQL database is required for the operation of Activiti 7.0. By using 25 tables, the process definition node content is read into the data table for subsequent use. The tables responsible for running the Activiti workflow engine in MySQL are as Figure 4 shown.
[0038] In addition, other dependencies are also required to run the Activiti workflow engine, mainly including activiti-engine-7.0.0.beta1.jar, mybatis, alf4j, log4j, Spring, a third-party connection pool, and the mysql database driver jar package.
[0039] Step 5: After deploying Activiti, process definition deployment is required, that is, the Weather.bpmn and Weather.png files generated by the process modeling tool. Store the content uploaded by the user in the process definition in the database, and the user-defined content can be queried during the execution of Activiti.
[0040] Step 6: After the process definition is deployed, the execution of this process can be managed in the system through Activiti 7.0. Then, data such as the corpus, intents, and slots prepared by the user are written into the database table designed in Step 2. Additionally, a Businesskey is added to each process node in the dialogue flow chart corresponding to the relevant dialogue intent or corpus. Through this Businesskey association, the user can query the corpus information corresponding to the relevant node. For example, through the Businesskey, the user can obtain detailed information such as the corpus, slot values, and intents, as well as the node information of the corresponding dialogue flow chart. Businesskey: Business identifier (equivalent to the intent described previously). The business identifier originates from the business system, and storing the business identifier is used to associate and query data in the business system based on the business identifier.
[0041] Step 7: Rasa is an open-source machine learning framework used to build a dialogue robot (intelligent assistant). First, query the corpus, intents, slot values, etc. stored in the database through the Businesskey, and write a script to write the information such as the corpus, intents, and slot values in the database into the corresponding files of the Rasa deep learning framework, such as files like nlu.yml and domain.yml. After writing, perform Rasa NLU and Rasa Core training. Rasa NLU is responsible for semantic understanding training, and Rasa Core is responsible for dialogue management training. After the training is completed, the entire dialogue flow deployment work is finished. The relevant diagrams for Rasa operation and the default configuration file Config.yml are as Figure 5 and Figure 6 shown.
[0042] The Config.yml mainly contains three parts, namely language, pipeline, and Policy. Among them, language is responsible for the language, and here we set it to Chinese (written in the file as: language: zh). Of course, it can also be set to other languages. The pipeline is mainly responsible for the NLU part, and Policy is responsible for the dialogue management part. NLU mainly functions for intent recognition and entity extraction. Policy mainly defines the dialogue management strategy, that is, it defines the strategy for determining how to give an answer to the user. Here, we default to using a rule-based strategy.
[0043] Step 8: After the training is completed, the user can then conduct tests. Through Rasa X, developers can choose to generate a website URL for the test user. After the test user opens it with a browser, they will get a simple chat interface where they can talk to the robot. In addition, the user can also fill in the corpus and make annotations in the relevant interface of Rasa X, and can retrain on the page after annotation. The test interface is as Figure 7as shown
[0044] For those skilled in the art, the technical solutions described in the foregoing examples can be modified, or some of the technical features can be equivalently replaced. Any modifications, equivalent replacements, etc. made within the spirit and principle of the invention shall be included within the protection scope of the invention.
Claims
1. A method for implementing a process-driven dialogue system, characterized in that The following steps are involved: 1) First, conduct business analysis. Developers analyze the dialogue scenarios according to the requirements, abstract the corresponding dialogue processes, and then analyze the corresponding dialogue flow charts according to the corresponding dialogue scenarios; 2) Based on the dialogue flow chart analyzed in step 1), prepare the corresponding dialogue materials, intentions, and slot values; 3) Draw the dialogue process based on steps 1) and 2) using BPMN2.0 specification; 4) Based on step 3), the deployment dialogue process is divided into three parts: First, deploy the business process BPMN file of the dialog process; The second is to write the relevant corpus prepared by the user into the database; The third step is to write the user-prepared corpus into the corresponding natural language understanding related files and configuration files to train the dialogue system; Finally, complete the entire deployment dialogue process; 5) Based on the first part of the deployment in step 4), the BPMN file in the dialog process is deployed, and the dialog flow chart is deployed through the process engine through the BPMN file of the dialog process drawn in step 3); 6) Based on the second part of the deployment in step 4), the corpus, intent, and slot data prepared by the user are written into the database table in step 2), and each process node in the dialogue flow chart and the corresponding dialogue intent and corpus are written into the corresponding database table. The user can view the intent, corpus, and slot value content corresponding to each process node as required; 7) Based on the third part of the deployment in step 4), train the traditional dialogue system. First, write a script to create the file corresponding to running the traditional dialogue system. Then write the corpus, intent, and slot information written into the database in step 6) into the natural language understanding file and configuration file of the traditional dialogue system. Then perform model training. After the training is completed, the entire dialogue process is successfully deployed. 8) After the deployment in step 7) is completed, conduct a test experience, experience the user experience through the front-end interface of the traditional dialogue system, and then apply for release to complete the construction of the process-driven dialogue system.
2. The method for implementing a process-driven dialogue system according to claim 1, characterized in that, In step 1), business analysis is first performed. Developers analyze the dialogue scenarios according to the requirements, abstract the corresponding dialogue processes, and then analyze the corresponding dialogue flow charts according to the corresponding dialogue scenarios, including: (1) Business scenario analysis: analyzing the dialogue scenarios involved in the business scenario; (2) Analyze the business and define relevant conversation intentions based on the conversation scenario; (3) Organize the conversation logic and determine whether it is a task-oriented conversation or a chat-oriented conversation.
3. The method for implementing a process-driven dialogue system according to claim 1, wherein In step 7), the files corresponding to running the traditional dialogue system are natural language understanding, configuration, and domain files.
4. A dialogue robot based on a workflow engine, which deploys the method for implementing a process-driven dialogue system as described in any one of claims 1 to 3, characterized in that Deploy the dialog flow engine method, including: (1) Deploying the process engine consists of three steps: defining the process, inserting relevant corpus into the relevant files of the traditional dialogue system, and training the dialogue robot; (2) Use BPMN2.0 related specifications and use process definition tools to draw a dialogue flow chart; (3) Deploy the Activiti workflow engine, and then deploy the process definition, that is, deploy the dialogue flow chart; (4) The traditional dialogue system used is Rasa; (5) Write the prepared relevant corpus, intent, and slot values into the database and important files related to Rasa; Configure the configuration file Config.yml of the Rasa framework.
5. The workflow engine-based chatbot according to claim 4, wherein Train the dialogue flow robot, specifically including: (1) Use the open-source machine learning framework of Rasa for building dialogue robots to train Rasa NLU and Rasa Core, where Rasa NLU is responsible for natural language understanding training and Rasa Core is responsible for dialogue management training; (2) Use Rasa X. Rasa X is a dialogue-driven tool. Rasa X generates a website for test users to conduct relevant dialogue tests.
Citation Information
Patent Citations
Scene configuration-oriented human-computer interaction dialogue robot system
CN112487170A
Task type dialogue and model training method and device, equipment and storage medium
CN112507103A