A method for constructing, executing and using a voice assistant
By configuring the platform and model training, the problem of high development threshold in the vertical field is solved, and a voice assistant that is quickly generated and customized is realized, reducing the difficulty and workload of development.
Patent Information
- Application Number
- CN202210877320.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-07-25
AI Technical Summary
In different vertical fields, the threshold for developing voice assistants is high, time-consuming and labor-intensive, and it is difficult to develop voice assistants that meet specific needs in a short time.
By configuring the platform and corpus information library, using the training of intent recognition models and factor entity extraction models, building voice assistants will be built, reducing development workload, providing configurable voice assistant generation methods, and supporting componentized and API call interfaces to achieve customized development.
It realizes rapid generation of voice assistants in different vertical fields, without additional development, reduces development difficulty and workload, and supports flexible configuration and customization requirements.
Smart Images

Figure CN115294969B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and more particularly to a method for constructing, executing, and implementing a voice assistant. Background Art
[0002] In recent years, more and more applications and services have begun to integrate voice assistants to help users conveniently obtain the information they need or complete specific tasks through voice interaction.
[0003] However, in different vertical fields, it is often necessary to develop voice assistants from scratch. The development threshold is high, time-consuming and labor-intensive, and it is difficult to develop a voice assistant that meets specific needs in a short period of time. Summary of the Invention
[0004] The embodiments of the present application provide a method for constructing, a method for executing, and a device for a voice assistant, which can generate corresponding voice assistants for different vertical fields through configuration, thereby reducing the difficulty of developing voice assistants.
[0005] In a first aspect, an embodiment of the present application provides a method for constructing a voice assistant, the method comprising:
[0006] Based on user configuration, obtain the business scenarios of the voice assistant to be built and the intent corresponding to each business scenario;
[0007] The intent recognition model and the feature entity extraction model are trained using the corpus corresponding to the voice assistant in the corpus information database;
[0008] For each intent, a task corresponding to the intent is obtained based on the user configuration. The task is used to trigger execution and obtain a response configuration corresponding to the voice conversation after the element entity obtained through the voice conversation meets the element entity configuration information of the task;
[0009] The intention recognition model, the element entity extraction model and the dialogue strategy model corresponding to each task are constructed into the voice assistant.
[0010] The embodiments of this application make the construction process of the voice assistant configurable. By configuring business scenarios and the intents corresponding to each business scenario, it conforms to the vertical field in which the voice assistant is used; through automated training, the intent recognition model and the feature entity extraction model are completed; by setting tasks for each intent, the response configuration of the voice assistant to the voice dialogue when in use is realized, thus completing the construction of a voice assistant. Originally, software development based on business was required in different vertical fields. Through the embodiments of this application, most of them have been made configurable. Generally, to connect to a business, only simple configuration and training on the configuration platform is required to obtain a voice assistant without additional development.
[0011] Optionally, the intent recognition model and the feature entity extraction model are stored in the voice assistant as components. By abstracting the customized development functions and providing standard component development models and API call interfaces, customized development can be quickly implemented without modifying the core code, greatly reducing the software development workload and even achieving zero development workload. Optionally, the task corresponding to the intent is obtained based on the user configuration, including:
[0012] Obtaining a user-configured task activation phase; the task activation phase is used to initiate a task based on the intent of the voice conversation;
[0013] Obtaining a user-configured element entity request phase; the element entity request phase is used to trigger obtaining element entities from a voice conversation;
[0014] Obtaining a user-configured element entity verification phase; the element entity verification phase is used to determine whether the element entity satisfies the entity element configuration information;
[0015] Obtain a task execution phase configured by the user; the task execution phase is used to execute the task indicated by the voice dialogue and obtain a corresponding response configuration.
[0016] By breaking down the conversation process into the task activation phase, the feature entity request phase, the feature entity verification phase, and the task execution phase, each phase has relatively fixed and independent process control. During the conversation, the various conversation phases can be switched based on the status of historical conversations and the current conversation. The execution logic and intervention content of each phase, as well as the switching logic between the various phases, are solidified in the code. In the process of building a voice assistant, the conversation strategy model can be intervened based on the configuration without modifying the code.
[0017] Optionally, obtain the user-configured feature entity validation phase, including:
[0018] Obtain at least one of the following configuration information of the user for the feature entity: optional and required item configuration, query statement configuration, single value and multi-value configuration, entity type configuration and verification configuration;
[0019] Get the user-configured task execution phase, including:
[0020] Obtain at least one of the following task execution configuration information of the user for the task: execution mode configuration, execution confirmation configuration, and associated task configuration.
[0021] By configuring the feature entity, users can set different information options according to different business scenarios, such as required or optional, single choice or multiple choice. When the feature entity entered by the user is unclear or the feature entity with the corresponding intention is not entered, the voice assistant can also ask the user to complete the information through follow-up sentences. When the sentence entered by the user is vague, the sentence or word can be automatically corrected through verification.
[0022] By configuring the task execution method, the voice assistant can return a sentence when executing a task, or call the corresponding business backend APP to complete the task and return the result to the client. You can also decide whether to ask the user for confirmation before executing a task, and whether to recommend related tasks after execution.
[0023] In a second aspect, an embodiment of the present application provides a method for executing a voice assistant, wherein the voice assistant has set business scenarios and the intent corresponding to each business scenario; the method includes:
[0024] Acquiring the user's voice conversation through the voice assistant;
[0025] Determining the intent of the voice conversation using an intent recognition model corresponding to the voice assistant;
[0026] Acquire the feature entities required for the task corresponding to the intent through the feature entity extraction model corresponding to the voice assistant;
[0027] Through the dialogue strategy model corresponding to the voice assistant, after the element entities required for the task meet the element entity configuration information of the task, the task is executed and the response configuration obtained by the execution is fed back.
[0028] Optionally, after the element entities required for the task satisfy the element entity configuration information of the task, the task is executed and a response configuration obtained by the execution is fed back through the dialogue strategy model corresponding to the voice assistant, including:
[0029] If, during the task activation phase of the task configured in the voice assistant, it is determined that there is no task corresponding to the historical conversation or that the task corresponding to the historical conversation is irrelevant to the intention, the task corresponding to the intention is started;
[0030] Obtaining the element entities required for the task from the interactive voice dialogue through the element entity request phase of the task configured in the voice assistant;
[0031] Determining, through the element entity verification phase of the task configured in the voice assistant, whether the element entity required for the acquired task satisfies the element entity configuration information of the task;
[0032] After the element entity configuration information of the task is met, the task is executed through the task execution phase of the task configured in the voice assistant, and the response configuration obtained by the execution is fed back.
[0033] Optionally, determining whether the acquired element entity required for the task satisfies the element entity configuration information of the task through the element entity verification phase of the task configured in the voice assistant includes:
[0034] For any acquired element entity, determining whether the element entity satisfies the element entity configuration information in the element entity verification phase; the element entity configuration information includes at least one of the following: optional and mandatory item configuration, query statement configuration, single-value and multi-value configuration, entity type configuration, and verification configuration;
[0035] Executing the task and feeding back a response configuration obtained by executing the task in the task execution phase configured in the voice assistant includes:
[0036] According to the task execution configuration information in the task execution phase, the task is executed and a response configuration obtained by the execution is fed back; the task execution configuration information includes at least one of the following: execution mode configuration, execution confirmation configuration and associated task configuration.
[0037] In a third aspect, an embodiment of the present application provides a device for constructing a voice assistant, including:
[0038] The configuration module is used to obtain the business scenarios of the voice assistant to be built and the intent corresponding to each business scenario based on the user configuration;
[0039] A training unit, configured to train an intent recognition model and an element entity extraction model using the corpus corresponding to the voice assistant in the corpus information database;
[0040] A task generation unit is used to obtain a task corresponding to each intent based on user configuration. The task is used to trigger execution and obtain a response configuration corresponding to the voice conversation after the element entity obtained through the voice conversation meets the element entity configuration information of the task.
[0041] A construction unit is used to construct the intention recognition model, the element entity extraction model and the dialogue strategy model corresponding to each task into the voice assistant.
[0042] In a fourth aspect, an embodiment of the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, the above-mentioned first aspect or any possible method of the first aspect is implemented, or when the processor executes the program, the above-mentioned second aspect or any possible method of the second aspect is implemented.
[0043] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the above-mentioned first aspect or any possible method of the first aspect, or the computer device executes the above-mentioned second aspect or any possible method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. Obviously, the following drawings are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0045] Figure 1 A schematic diagram of a system architecture for building a voice assistant is provided for an embodiment of the present application;
[0046] Figure 2 A human-computer interaction interface provided in an embodiment of the present application;
[0047] Figure 3 A flowchart for constructing a voice assistant provided in an embodiment of the present application;
[0048] Figure 4 A process for configuring tasks corresponding to intents provided in an embodiment of the present application;
[0049] Figure 5 A flow chart of voice assistant configuration provided in an embodiment of the present application;
[0050] Figure 6 A system architecture diagram for executing a voice assistant provided in an embodiment of the present application;
[0051] Figure 7 A method for executing a voice assistant provided in an embodiment of the present application;
[0052] Figure 8 A specific execution process of a voice assistant provided in an embodiment of the present application;
[0053] Figure 9 The specific process of the voice assistant element entity verification phase and task execution phase provided in an embodiment of the present application;
[0054] Figure 10 A voice assistant device provided in an embodiment of the present application;
[0055] Figure 11 A computer device is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In the existing technology, each vertical field needs to develop its own voice assistant, such as the smart home appliance field, the travel field, the catering field, etc. Each field has its own voice interaction method, and therefore requires different corpus in each field to generate the voice assistant. The generation of each voice assistant requires targeted development by R&D personnel. Based on this situation, this application provides a user-configured method to obtain the corresponding voice assistant without additional development, greatly reducing the software development workload, and even achieving zero development.
[0057] The following is an introduction to the generation process of the voice assistant. Figure 1 As shown, this is a schematic diagram of a system architecture for building a voice assistant applicable to an embodiment of the present application. The system architecture applicable to the embodiment of the present application includes a configuration platform, a corpus information library, a trainer, and a model management platform.
[0058] The configuration platform can prompt users to configure various configuration information for the voice assistant by providing a human-computer interaction interface. The implementation method can be: after entering the voice assistant construction interface, prompt the user to set up the voice assistant, such as Figure 2 As shown in the figure, the settings for business scenarios, the corresponding intent settings under the business scenarios, the selection of training corpus, and the settings of tasks corresponding to the intents can be performed on the corresponding page, or all settings can be completed on the same page.
[0059] The corpus information database stores corpora from various vertical fields. Each corpus generally includes the corresponding speech text of the voice conversation and labels for the objects identified in the text. The corpus information database can store existing, known corpora or inject corpora into the corpus information database through the configuration platform. During the voice assistant construction process, corpora can be selected through the configuration platform and then fed into the trainer for training.
[0060] The trainer is used to train the pre-set model according to the control of the configuration platform. Voice assistants typically process user input in two stages: natural language understanding and dialogue management. The natural language understanding process is typically implemented using a trained model. Because deep learning models are generally universal across different vertical fields, the initial pre-set model can be a deep learning model.
[0061] The model management platform manages trained models and supports multiple versions of entity models within the same voice assistant. It also supports operations such as dynamic loading, unloading, and deletion of entity models, as well as querying model status. Furthermore, multi-version control facilitates AB testing and version rollbacks during development and application.
[0062] based on Figure 1 The system architecture diagram shown in the figure, the embodiment of the present application provides a process for building a voice assistant, such as Figure 3 Shown include:
[0063] S301. Obtain each business scenario of the voice assistant to be constructed and the intent corresponding to each business scenario based on the user configuration;
[0064] Voice assistants in different fields have different business scenarios. Business scenarios can be understood as the usage environment of voice conversations. For example, a voice assistant for office applications can be configured with business scenarios such as attendance, address book, email, document processing, and to-do tasks. Each business scenario can be associated with multiple intents, which can be understood as the purpose of the voice conversation. For example, in the address book business scenario, intents such as address book query, phone call, and text message can be configured.
[0065] S302: Training an intent recognition model and an element entity extraction model using the corpus corresponding to the voice assistant in the corpus information database;
[0066] The natural language understanding process generally includes intent recognition and entity extraction. Both processes can be completed by deep learning models, while also allowing for auxiliary judgment using rule-based models. Rule-based models are used to assist in judgment when the deep learning model fails to recognize intent or extract entity elements.
[0067] The intent recognition model is used to identify intent from voice conversations, while the feature entity extraction model is used to extract feature entities (i.e., objects associated with intent) from voice conversations. For example, in a phone call scenario, if the voice conversation begins with "Call XXX," the intent recognition model can identify the intent as "Call XXX," and the feature entity extraction model can identify the feature entity of the voice conversation as "XXX."
[0068] To train the intent recognition model and feature entity extraction model, we need to use various data from the corpus information database related to the business scenario. Each data item is configured with the corresponding intent and feature entity location. For example, in the business scenario of making a phone call, a data item is labeled "Call XXX immediately." In this data item, "Call XXX" is marked as the intent and "XXX" is marked as the feature entity.
[0069] S303. For each intent, a task corresponding to the intent is obtained based on the user configuration. The task is used to trigger execution and obtain a response configuration corresponding to the voice conversation after the element entity obtained through the voice conversation meets the element entity configuration information of the task.
[0070] After identifying an intent, you need to respond to the voice conversation. Therefore, you need to set a task for each intent. For example, the task corresponding to the intent of making a call is to make a call, and the task corresponding to the intent of sending a text message is to send a text message.
[0071] To execute tasks, you need to configure the associated element entities for each task. When all associated element entities are satisfied, the task is considered executable. For example, in a phone call scenario, if the voice conversation is "Call now," the corresponding phone call task is initiated after the "call" intent is recognized. During the phone call task execution process, the associated element entity—the call object—must be identified. However, if this entity is not found in the voice conversation "Call now," the phone call task has not yet met its executable conditions.
[0072] A response configuration is a response to a voice conversation, and can also be considered the execution result of the intent corresponding to the voice conversation. The execution result can be a voice message, user interface content, or the task execution status, such as the connection response of a phone call.
[0073] S304: Construct the intention recognition model, the element entity extraction model, and the dialogue strategy model corresponding to each task into the voice assistant.
[0074] In this implementation, the trained intent recognition model and entity extraction model complete the natural speech understanding process. The obtained key information, including the intent and entity elements of the user's input sentence, is then used by the dialogue policy model. Based on the intent and entity elements of the user's input sentence, combined with historical input sentences, the dialogue policy model responds to the task corresponding to the intent.
[0075] Through this approach, the structure of the deep learning models for intent recognition and entity extraction is solidified, while the training corpus is made configurable. This allows for customized natural language understanding modules in different verticals by configuring both training data and rule models, eliminating the need for secondary code development. Furthermore, during the voice assistant construction process, configuration is leveraged to influence the dialogue strategy model, enabling dialogue management without code modifications.
[0076] The embodiment of the present application further provides a process for configuring tasks corresponding to intents, such as Figure 4 Shown, including:
[0077] S3031. Obtaining a task activation phase configured by the user; the task activation phase is used to initiate a task based on the intent of the voice conversation;
[0078] Each task configured for an intent involves a task activation phase, which determines when to activate the corresponding task based on the intent of the voice conversation. For example, if historical conversation tracking indicates that the user is not currently engaged in a task, or if the user is engaged in a task but does not perform the expected action, the task's conversation is forcibly interrupted and the corresponding task is activated based on the new intent.
[0079] S3032, obtaining a user-configured element entity request phase; the element entity request phase is used to trigger obtaining element entities from the voice conversation;
[0080] The configured feature entity request phase will intervene in the feature entities associated with the task. When a certain associated required feature entity is not obtained from the user's input statement and context, the corresponding feature entity will be questioned. The questioned statement can be intervened through configuration.
[0081] S3033, obtaining the user-configured element entity verification phase; the element entity verification phase is used to determine whether the element entity satisfies the entity element configuration information;
[0082] During the configured feature entity verification phase, after obtaining the associated feature entities, verification interventions will be performed on the feature entities, such as single value confirmation and multiple selection. When all the associated feature entities of a task are met, the task meets the execution conditions.
[0083] S3034. Obtain the task execution phase configured by the user; the task execution phase is used to execute the task indicated by the voice dialogue and obtain the corresponding response configuration.
[0084] During the task execution phase, once the task meets the execution conditions, the task indicated by the voice conversation is executed and the corresponding response configuration is obtained. For example, for a phone call task, the call is dialed; for an email task, the email is sent. The response configuration can be a voice prompt, such as "calling" or a user interface prompt, such as "email sent successfully."
[0085] The above implementation abstracts the conversation process into the task activation phase, the feature entity request phase, the feature entity verification phase, and the task execution phase. This adapts to most conversation scenarios and processes, eliminating the need to develop separate conversation strategies for different business tasks. Each phase can be flexibly intervened through configuration. The execution logic and intervention content of each phase, as well as the transition logic between phases, are solidified in the code. During the voice assistant construction process, the conversation strategy model can be intervened based on the configuration without modifying the code.
[0086] This embodiment of the present application further details the configuration of the element entity verification phase and the task execution phase, specifically including:
[0087] Obtain at least one of the following configuration information of the user for the feature entity: optional and required item configuration, query statement configuration, single value and multi-value configuration, entity type configuration and verification configuration;
[0088] Obtain at least one of the following task execution configuration information of the user for the task: execution mode configuration, execution confirmation configuration, and associated task configuration.
[0089] The following describes each of the configuration information mentioned above in detail.
[0090] 1. Optional and Required Configuration: Under the Optional and Required configuration, you can choose which element entities are optional and which are required based on the specific circumstances of the task. For example, when a user uses the Contacts voice assistant and the task is to make a phone call, the element entity for making a phone call is required. For example, in the "Call Zhang San" action, the element entity "Zhang San" is required.
[0091] 2. Follow-up query configuration: For missing feature entities, the configuration platform can also configure follow-up query statements in advance. When using the voice assistant, if the required feature entity is not recognized, the voice assistant will initiate a follow-up query. For example, when the user says "I want to make a call" in the call intent, the follow-up query will be "Who do you want to call?"
[0092] 3. Single-value or multi-value configuration: In different tasks, feature entities can be single or multiple, and this can be configured through the configuration platform. For example, in a phone call task, the feature entity (i.e., the object) to be called can only be a single person, and the feature entity name can only be configured as a single value. However, in an email task, the email can be sent to multiple people at the same time, so the feature entity name can be configured as multiple values.
[0093] 4. Entity Type Configuration: Each feature entity has a corresponding entity type. Each entity type can be configured with a unified validation method for all entities of that type. Entity types are also very helpful in entity inheritance. For example, in an email sending scenario, when a voice assistant asks a user about the recipient of an email, and the user responds with a name, the feature entity extraction model will recognize the name as the feature entity, not the recipient. However, by configuring the email recipient and the name to be the same entity type, the voice assistant will automatically integrate the extracted name information into the recipient information.
[0094] 5. Verification configuration: After the configuration is completed, some feature entities may need to have their values verified. In the configuration platform, you can set a dictionary for feature entities so that feature entities can only be selected from this dictionary. For example, in a leave task, the associated feature entities include annual leave, personal leave, marriage leave, sick leave, etc. When the extracted feature entity is "Four Leaves", the voice assistant can automatically correct it to "Personal Leave" based on the dictionary. In addition to using the dictionary to verify feature entities, it is also allowed to verify feature entities by configuring a third-party verification interface or a customized verification method developed by customization.
[0095] 6. Execution confirmation configuration: During the task execution phase, the user will be asked to confirm the execution based on the configuration. If this configuration is made, a confirmation statement will be generated to ask the user whether to execute the task. The user can cancel the current task at this stage.
[0096] 7. Execution method configuration: The configuration determines whether to generate a text conversation or call the business backend and transmit the business backend processing results to the user. If the configuration is to generate a text, the configured conversation generation template is exported, and a text statement is generated based on all the relevant element entities currently obtained and returned to the user. If the configuration is to call the business backend, the execution is performed through the business backend.
[0097] 8. Related Task Configuration: After a task is completed, if there are related tasks configured for it, the user will be recommended tasks that they may want to perform next. After receiving this recommendation, the user can confirm or select (a confirmation prompt is displayed if only one related task is configured, and a selection prompt is displayed if multiple related tasks are configured). If the user confirms a related task, it will be directly activated, and the value of the related element entity of the previously completed task will be directly used by the related task.
[0098] For example, after a user performs the address book query task "Find Zhang San's contact information," the configuration shows that the address book query task has an associated task of making a phone call. After completing the address book query task, a task recommendation phrase "You may also want to make a phone call" is generated. The user responds to confirm the intent and activates the phone call task. The user then directly calls "Zhang San" using the name "Zhang San" obtained from the address book query task. If the user does not want to perform the associated task, they can simply respond to deny the intent to cancel the associated task.
[0099] Figure 5 A voice assistant configuration flow chart provided in an embodiment of the present application is as follows: Figure 5 As shown in the figure, for any voice assistant that needs to be configured and generated (i.e., voice assistant entity 1 and voice assistant entity 2 in the figure), the business scenarios associated with the voice assistant need to be set, such as business scenarios 1, 2, 3, and 4 associated with voice assistant entity 1, and business scenarios 4 and 5 associated with voice assistant entity 2. It can be seen that business scenario 4 is shared, which means that the corpus about business scenario 4 in the corpus information library will be applied to different voice assistants. The corresponding intent needs to be configured for each business scenario, such as the intent associated with business scenario 3 is intent 4. Figure 1 ,meaning Figure 2 Harmony Figure 3 ; Each intention has its own corresponding task, Figure 1 The corresponding configurations are task 1, intention Figure 2 The corresponding configurations are Task 2 and Figure 3 The corresponding configuration is Task 3. Specific to each task, the configuration of the task involves the configuration of the feature entity (that is, feature entity configuration can be performed for each feature entity associated with the task) and the configuration of the task execution (that is, the configuration related to the task execution method).
[0100] In order to meet the customization requirements, the embodiment of the present application is expanded in the form of componentization or providing a standard API calling interface. Each customized development does not require modification of the core code to ensure stability. Functions that often need to be customized are generally inserted in the natural language understanding module. The embodiment of the present application componentizes the natural language understanding module. The above-mentioned intention recognition module and feature entity extraction model are two components in the natural language understanding module. Other deep learning model components can be replaced as needed to realize the intent recognition function and feature entity extraction, and new components can also be developed to process user input sentences. The verification logic of the feature entity in the dialogue strategy management model can also be customized according to the standard development interface or connected through the standard API interface (for example, a standard API interface for verifying the ID number is developed, and the system will automatically transmit the feature entity identified as the ID number to this interface for verification and authentication, and make a corresponding response to the user based on the return result).
[0101] By abstracting some functions that often need to be customized according to business needs and providing standard component development models and API call interfaces, customized development can be quickly implemented without modifying the core code, greatly reducing the software development workload and even achieving zero development workload.
[0102] The above method makes the voice assistant configurable. While meeting the configurability requirements, it also allows developers to customize it with a small amount of code development, which can basically meet the needs of quickly generating voice assistants in various vertical fields.
[0103] The following describes the use and execution process of the voice assistant constructed above. Figure 6 As shown, a system architecture diagram for executing a voice assistant is provided, including: a voice assistant client, a voice assistant backend and a business backend.
[0104] Specifically, a voice assistant client can be understood as an installed application, which can be a pre-installed client, a web application, or a mini-program embedded in other applications. A voice assistant client can be installed on any device capable of performing the function, such as, but not limited to, smartphones, tablets, laptops, and desktop computers. The voice assistant client is primarily used for voice interaction with the user.
[0105] The voice assistant backend is actually the real executor of voice interaction. It loads the required voice assistant through the model management platform. Specifically, it loads the intent recognition model, feature entity extraction model, and dialogue strategy model in the voice assistant.
[0106] The business backend is used to assist in completing voice interaction under the control of the voice assistant backend, that is, it is mainly used to complete the execution of tasks.
[0107] Figure 7 A method for executing a voice assistant provided in an embodiment of the present application includes:
[0108] S701, obtaining a user's voice conversation through the voice assistant;
[0109] This step can be implemented through the above-mentioned voice assistant client. Taking the travel assistant as an example, the user can have a voice conversation through the travel assistant client loaded on the terminal.
[0110] S702: Determine the intention of the voice conversation using an intention recognition model corresponding to the voice assistant;
[0111] This step can be implemented using the aforementioned voice assistant backend. For example, the intent recognition model loaded into the travel assistant can be used to identify the intent of the voice conversation captured by the travel assistant client. For example, if the user says "Book me a flight for next Monday," the intent is recognized as "book a flight."
[0112] S703: Acquire the element entities required for the task corresponding to the intent through the element entity extraction model corresponding to the voice assistant;
[0113] This step can be implemented through the voice assistant backend mentioned above, such as through the element entity extraction model in the loaded travel assistant. For example, when the user says "Book me a flight for next Monday", the entity element in this voice dialogue can be extracted as "next Monday".
[0114] S704. Through the dialogue strategy model corresponding to the voice assistant, after the element entities required for the task meet the element entity configuration information of the task, execute the task and feedback the response configuration obtained by the execution.
[0115] This step can be implemented through the above-mentioned voice assistant background, such as through the dialogue strategy in the loaded travel assistant. After the dialogue strategy model determines to start the task corresponding to the "book a flight" intention, it will process the element entities of the obtained voice dialogue. For example, the required element entities involved in the "book a flight" task include departure time, departure place, and destination. For the missing element entities, additional questions will be asked, such as "Please tell me the departure place and destination". After the element entity meets the element entity configuration information of the task, the task is executed and the response configuration obtained by the execution is fed back.
[0116] The specific execution process of step 704 will be described in detail below. Figure 8 Shown, including:
[0117] S801. Through the task activation phase of the task configured in the voice assistant, it is determined that there is no task corresponding to the historical conversation or the task corresponding to the historical conversation is irrelevant to the intention, and then the task corresponding to the intention is started.
[0118] This step is the starting point of a conversation flow. Each intent configured on the configuration platform corresponds to a task. If historical conversations indicate that the user is not currently in the conversation flow for any of the tasks identified in the intent, or if the user is in a conversation flow but does not perform the expected action, the conversation for that task will be interrupted and a new task will be activated based on the new intent. For example, in a travel assistant, if a user says "Book me a flight," the voice assistant will continue to ask for information such as the time, departure, and destination. However, if the user then says "Book me a hotel," the voice assistant will recognize the "Book a hotel" intent and activate a new task.
[0119] S802: Obtain the element entities required for the task from the interactive voice dialogue through the element entity request phase of the task configured in the voice assistant.
[0120] After the task is activated, the voice assistant will obtain the element entities corresponding to the required intent based on the user's historical conversations and current conversation information. For example, in the travel assistant, when the intent is recognized as "book a flight", the voice assistant will obtain the entity elements necessary for this task based on "book a flight", such as departure place, destination, time, etc.
[0121] S803. Determine, through the element entity verification phase of the task configured in the voice assistant, whether the element entity required for the acquired task satisfies the element entity configuration information of the task.
[0122] This step is the entity element verification phase. The voice assistant will determine whether the necessary entity elements have been obtained. If not, it will initiate a query. For example, if the intent "book a flight" is recognized, it will determine whether all necessary entity elements have been obtained based on the required entity elements corresponding to the "book a flight" task. Furthermore, each entity element obtained will be further verified.
[0123] S804: After the element entity configuration information of the task is satisfied, the task is executed through the task execution phase of the task configured in the voice assistant, and a response configuration obtained by the execution is fed back.
[0124] This step is the voice assistant execution stage. During a task conversation, when the information of all required element entities has been collected, the task execution stage will begin.
[0125] The following is a detailed description of the voice assistant's element entity verification phase and task execution phase. Figure 9 As shown:
[0126] S901 determines whether the acquired element entity required for the task satisfies the element entity configuration information of the task through the element entity verification phase configured in the voice assistant, including:
[0127] Take any element entity and determine whether the element entity meets the element entity configuration information in the element entity verification stage; the element entity configuration information includes at least one of the following: optional and mandatory option configuration, question statement configuration, single value and multi-value configuration, entity type configuration and verification configuration.
[0128] This step specifically verifies the element information. After recognizing the conversational intent, the voice assistant retrieves the necessary entity elements based on the task corresponding to that intent, and verifies whether the entity elements are single-valued or multi-valued, as well as the entity element type. If the necessary entity elements are not retrieved, or if the single-value, multi-value, or entity type is incorrect, the voice assistant will continue to query the user until all options meet the task requirements and the task is executed.
[0129] For example, in the travel assistant, when only the "book a flight" task is obtained, the voice assistant will continue to ask required information such as "where is the destination" and "where is the departure point". When the destinations for "book a flight" are obtained to be two different places, the voice assistant will ask the user to confirm the "destination" and inform the user that there can only be one destination. When the voice assistant asks the user to enter the "passenger", the user only needs to say a name. "Passenger" and the name are configured as one entity type.
[0130] S902: In the task execution phase of the task configured in the voice assistant, the task is executed and a response configuration obtained by the execution is fed back, including:
[0131] According to the task execution configuration information in the task execution phase, the task is executed and a response configuration obtained by the execution is fed back; the task execution configuration information includes at least one of the following: execution mode configuration, execution confirmation configuration and associated task configuration.
[0132] This step is the final stage of execution. After all required entity information is collected, the task enters the execution phase. During the task execution phase, the user is prompted for confirmation based on the configuration. The user can also cancel the current task at this stage. After the user completes a task, the voice assistant will recommend related tasks.
[0133] For example, in the "Travel Assistant", after the voice assistant obtains all the necessary element entities, it will send a statement to the user to confirm the execution. After completing the "book a flight" task, the voice assistant will also recommend related tasks, such as "book a hotel" and "pick up the plane". Users can activate the corresponding tasks as needed, or cancel them directly.
[0134] The present invention makes the process of building a voice assistant configurable. When connecting to a business, a voice assistant can be obtained by simply performing configuration and training on the configuration and management platform without the need for additional development.
[0135] It abstracts areas that often require customized development based on business needs, provides standard component development models and API calling interfaces, and enables rapid customized development without modifying the core code, greatly reducing the software development workload and even achieving zero development effort.
[0136] Based on the same technical concept, the embodiment of the present application provides a voice assistant device, such as Figure 10 As shown, the voice assistant device 1000 includes: a configuration module 1001, which is used to obtain the various business scenarios of the voice assistant to be constructed and the intent corresponding to each business scenario based on the user configuration. A training unit 1002, which is used to train the intent recognition model and the feature entity extraction model through the corpus corresponding to the voice assistant in the corpus information library. A task generation unit 1003, which is used to obtain the task corresponding to each intent based on the user configuration, and the task is used to trigger execution and obtain the response configuration corresponding to the voice dialogue after the feature entity obtained through the voice dialogue meets the feature entity configuration information of the task. A construction unit 1004, which is used to construct the intent recognition model, the feature entity extraction model and the dialogue strategy model corresponding to each task into the voice assistant.
[0137] Based on the same technical concept, the embodiment of the present application provides a computer device, which can be a terminal or a server, such as Figure 11 As shown, it includes at least one processor 1101 and a memory 1102 connected to the at least one processor. The specific connection medium between the processor 1101 and the memory 1102 is not limited in the embodiment of the present application. Figure 11 For example, the processor 1101 and the memory 1102 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, and the like.
[0138] In an embodiment of the present application, the memory 1102 stores instructions that can be executed by at least one processor 1101. By executing the instructions stored in the memory 1102, the at least one processor 1101 can execute the steps included in the above-mentioned voice assistant construction method and execution method.
[0139] Among them, the processor 1101 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and perform traffic flow tracing by running or executing instructions stored in the memory 1102 and calling data stored in the memory 1102. Optionally, the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0140] The processor 1101 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0141] Memory 1102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. Memory 1102 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. Memory 1102 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1102 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0142] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a computer device. When the program runs on the computer device, the computer device executes the steps of the above-mentioned voice assistant construction method and execution method.
[0143] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0144] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0145] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0147] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for constructing a voice assistant, characterized in that: The method comprises: Based on user configuration, obtain the business scenarios of the voice assistant to be built and the intent corresponding to each business scenario; The intent recognition model and the feature entity extraction model are trained using the corpus corresponding to the voice assistant in the corpus information database; For each intent, a task corresponding to the intent is obtained based on the user configuration. The task is used to trigger execution and obtain a response configuration corresponding to the voice conversation after the element entity obtained through the voice conversation meets the element entity configuration information of the task; The intention recognition model, the element entity extraction model and the dialogue strategy model corresponding to each task are constructed into the voice assistant.
2. The method according to claim 1, characterized in that The intent recognition model and the feature entity extraction model are stored in the voice assistant as components.
3. The method according to claim 1, characterized in that Obtaining tasks corresponding to the intent based on user configuration includes: Obtaining a user-configured task activation phase; the task activation phase is used to initiate a task based on the intent of the voice conversation; Obtaining a user-configured element entity request phase; the element entity request phase is used to trigger obtaining element entities from a voice conversation; Obtaining a user-configured element entity verification phase; the element entity verification phase is used to determine whether the element entity satisfies the entity element configuration information; Obtain a task execution phase configured by the user; the task execution phase is used to execute the task indicated by the voice dialogue and obtain a corresponding response configuration.
4. The method according to claim 3, characterized in that Gets the user-configured feature entity validation phase, including: Obtain at least one of the following configuration information of the user for the feature entity: optional and required item configuration, query statement configuration, single value and multi-value configuration, entity type configuration and verification configuration; Get the user-configured task execution phase, including: Obtain at least one of the following task execution configuration information of the user for the task: execution mode configuration, execution confirmation configuration, and associated task configuration.
5. A method for executing a voice assistant, characterized in that: The voice assistant is constructed by the method of claim 1, wherein the voice assistant has set business scenarios and the intent corresponding to each business scenario, and the method includes: Acquiring the user's voice conversation through the voice assistant; Determining the intent of the voice conversation using an intent recognition model corresponding to the voice assistant; Acquire the feature entities required for the task corresponding to the intent through the feature entity extraction model corresponding to the voice assistant; Through the dialogue strategy model corresponding to the voice assistant, after the element entities required for the task meet the element entity configuration information of the task, the task is executed and the response configuration obtained by the execution is fed back.
6. The method according to claim 5, characterized in that Through the dialogue strategy model corresponding to the voice assistant, after the element entities required for the task meet the element entity configuration information of the task, the task is executed and the response configuration obtained from the execution is fed back, including: If, during the task activation phase of the task configured in the voice assistant, it is determined that there is no task corresponding to the historical conversation or that the task corresponding to the historical conversation is irrelevant to the intention, the task corresponding to the intention is started; Obtaining the element entities required for the task from the interactive voice dialogue through the element entity request phase of the task configured in the voice assistant; Determining, through the element entity verification phase of the task configured in the voice assistant, whether the element entity required for the acquired task satisfies the element entity configuration information of the task; After the element entity configuration information of the task is met, the task is executed through the task execution phase of the task configured in the voice assistant, and the response configuration obtained by the execution is fed back.
7. The method according to claim 6, characterized in that Determining whether the acquired element entity required for the task satisfies the element entity configuration information of the task through the element entity verification phase of the task configured in the voice assistant includes: For any acquired element entity, determining whether the element entity satisfies the element entity configuration information in the element entity verification phase; the element entity configuration information includes at least the following: optional and mandatory item configuration, query statement configuration, single-value and multi-value configuration, entity type configuration, and verification configuration; Executing the task and feeding back a response configuration obtained by executing the task in the task execution phase configured in the voice assistant includes: According to the task execution configuration information in the task execution phase, the task is executed and a response configuration obtained by the execution is fed back; the task execution configuration information includes at least one of the following: execution mode configuration, execution confirmation configuration and associated task configuration.
8. A device for constructing a voice assistant, characterized in that: include: The configuration module is used to obtain the business scenarios of the voice assistant to be built and the intent corresponding to each business scenario based on the user configuration; A training unit, configured to train an intent recognition model and an element entity extraction model using the corpus corresponding to the voice assistant in the corpus information database; A task generation unit is configured to obtain, for each intent, a task corresponding to the intent based on a user configuration, wherein the task is triggered to execute and obtain a response configuration corresponding to the voice conversation after an element entity obtained through the voice conversation satisfies the element entity configuration information of the task; A construction unit is used to construct the intention recognition model, the element entity extraction model and the dialogue strategy model corresponding to each task into the voice assistant.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that It stores a computer program that can be executed by a computer device. When the program is run on the computer device, the computer device executes the steps of any one of the methods according to claims 1 to 7.
Citation Information
Patent Citations
Method for constructing voice assistant
CN109948151A
Training and sharing method of voice assistant
CN110310630A