A dynamic multi-intent semantic understanding method, device, computer equipment and readable storage medium
By employing a dynamic multi-intent semantic understanding method, combined with dialogue history and pre-configured intent slots, user queries are rewritten and identified, thus solving the problem of insufficient understanding in complex queries by intelligent dialogue systems and achieving more efficient and accurate user intent recognition and response.
Patent Information
- Application Number
- CN202410874911.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-02
AI Technical Summary
Existing intelligent dialogue systems struggle to accurately understand users' true intentions when faced with complex or ambiguous user queries, leading to inefficient responses and misunderstandings of user needs, especially in scenarios such as emergency response and customer service.
A dynamic multi-intent semantic understanding method is adopted. By receiving the user's original query and rewriting it into multiple query lists in combination with the dialogue history, the method uses the pre-set dynamic intent slot configuration to perform intent recognition and slot extraction, and constructs a target response list. It includes a receiving module, a rewriting module, an intent module, a slot module, and an output module, which are used to process user queries, rewrite, intent recognition, and slot extraction, respectively, and finally generate accurate responses.
It improves the response efficiency and accuracy of the dialogue system, making it particularly suitable for emergency response scenarios that require rapid and accurate responses. It can accurately understand the user's multiple intentions and extract key information.
Smart Images

Figure CN118467680B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a dynamic multi-intent semantic understanding method, device, computer equipment and readable storage medium. Background Art
[0002] In existing intelligent dialogue systems, it is often difficult for the system to accurately understand the user's true intention for complex or ambiguous original queries input by the user. Especially in scenarios that require fast and accurate responses, such as emergency response and customer service, this lack of understanding may lead to inefficient responses or even misunderstanding of user needs. At present, although there are some intent recognition and slot filling technologies, they are often based on static rules or models, lack dynamism and flexibility, and are difficult to adapt to changing user queries and dialogue scenarios. Summary of the invention
[0003] The object of the present invention is to provide a dynamic multi-intent semantic understanding method, device, computer equipment and readable storage medium.
[0004] In a first aspect, an embodiment of the present invention provides a dynamic multi-intent semantic understanding method, including:
[0005] Receive the user's original query;
[0006] According to the conversation history and the original query, a plurality of query lists for the original query are obtained by rewriting;
[0007] Based on the preset dynamic intent slot configuration, perform intent recognition on each of the query lists, obtain pending intent recognition results and pending slot recognition results corresponding to each of the query lists, and extract target intent recognition results and preliminary slot recognition results therefrom;
[0008] Based on the dynamic intention slot configuration, performing slot extraction on the preliminary slot recognition result to obtain a target slot recognition result;
[0009] A target answer list for the original query is constructed based on the target intent recognition result and the target slot recognition result, and the target answer list is output for display.
[0010] In a second aspect, an embodiment of the present invention provides a dynamic multi-intent semantic understanding device, including:
[0011] A receiving module, used for receiving the original query of the user;
[0012] A rewriting module, configured to obtain a plurality of query lists for the original query by rewriting according to the conversation history and the original query;
[0013] An intent module, for performing intent recognition on each of the query lists based on a preset dynamic intent slot configuration, obtaining pending intent recognition results and pending slot recognition results corresponding to each of the query lists, and extracting a target intent recognition result and a preliminary slot recognition result therefrom;
[0014] A slot module, used for performing slot extraction on the preliminary slot recognition result based on the dynamic intended slot configuration, to obtain a target slot recognition result;
[0015] An output module is used to construct a target answer list for the original query based on the target intent recognition result and the target slot recognition result, and output the target answer list for display.
[0016] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the method described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method described in the first aspect.
[0018] Compared with the prior art, the beneficial effects provided by the present invention include: adopting a dynamic multi-intent semantic understanding method, device, computer equipment and readable storage medium disclosed in the present invention, receiving the original query of the user, rewriting it into multiple query lists in combination with the dialogue history, using the pre-set dynamic intent slot configuration to perform intent recognition and slot extraction, and finally constructing and outputting the target reply list. This method can accurately understand the user's multiple intentions, extract key information, and significantly improve the response efficiency and accuracy of the dialogue system, and is particularly suitable for scenarios that require fast and accurate responses, such as emergency response. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.
[0020] Figure 1 A schematic diagram of the steps of the dynamic multi-intent semantic understanding method provided by an embodiment of the present invention;
[0021] Figure 2 A schematic block diagram of the structure of a dynamic multi-intent semantic understanding device provided by an embodiment of the present invention;
[0022] Figure 3 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0024] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0025] In order to solve the technical problems in the aforementioned background technology, Figure 1 A flow chart of a dynamic multi-intent semantic understanding method provided in an embodiment of the present disclosure is provided below, and the dynamic multi-intent semantic understanding method is introduced in detail.
[0026] Step S201, receiving the original query of the user;
[0027] Step S202, obtaining multiple query lists for the original query by rewriting according to the conversation history and the original query;
[0028] Step S203, based on the preset dynamic intent slot configuration, perform intent recognition on each of the query lists, obtain pending intent recognition results and pending slot recognition results corresponding to each of the query lists, and extract target intent recognition results and preliminary slot recognition results therefrom;
[0029] Step S204, based on the dynamic intended slot configuration, performing slot extraction on the preliminary slot recognition result to obtain a target slot recognition result;
[0030] Step S205, constructing a target answer list for the original query based on the target intent recognition result and the target slot recognition result, and outputting the target answer list for display.
[0031] In an embodiment of the present invention, exemplarily, on a server of an emergency response center, a user enters an original query through the front-end interface: "Check the earthquake situation in X city in the past week and start the earthquake early warning system." The server receives this query and takes it as the object of processing. The server checks the previous conversation history and finds that the user has previously queried the earthquake record of X city and requested help in starting the early warning system. Therefore, the server rewrites the original query into two independent queries based on the historical conversation and the current query: "Check the earthquake situation in X city in the past week" and "Start the earthquake early warning system." The server uses natural language processing technology, combined with the conversation history, to split the original query into two independent queries to form a query list. The server performs intent recognition on each query according to the pre-set dynamic intent slot configuration. For "Check the earthquake situation in X city in the past week", the server recognizes the intent as "event retrieval", and the slot includes "time range" (nearly one week) and "administrative area" (X city). For "Start the earthquake early warning system", the server recognizes the intent as "system operation" and there is no specific slot information. The server uses the intent recognition model, combined with the dynamic intent slot configuration, to identify the intent and slot information of each query, and extracts the target intent recognition result and the preliminary slot recognition result. The server further refines the preliminary slot identification results. For example, for the time range "recent week", the server may convert it into a specific date range, such as "XX / XX / XXXX to XX / XX / XXXX". The server uses slot extraction technology to standardize and refine the preliminary slot identification results to obtain the target slot identification results. The server constructs a target reply list based on the identified intent and slot information. For "view the earthquake situation in X city in the past week", the server retrieves the earthquake database and generates a reply containing earthquake information. For "start the earthquake early warning system", the server sends a command to the early warning system and generates a reply confirming the start. These two replies constitute the target reply list and are displayed to the user through the front-end interface. The server performs corresponding operations (such as data retrieval or system operation) based on the target intent and slot information, generates reply content, and organizes the reply content into a target reply list, which is displayed to the user through the front-end interface.
[0032] In the embodiment of the present invention, the aforementioned step S202 may be implemented through the following example execution.
[0033] Rewriting the conversation history and the original query input in a large language model trained with preset prompt words to obtain multiple pending query lists for the original query;
[0034] Each of the pending query lists is converted into the query list in a preset data format.
[0035] In an embodiment of the present invention, exemplarily, in an intelligent emergency response system, a user sends an original query to a server through a client: "View the recent flood warnings in X City and activate the corresponding emergency plan." At the same time, the server has the user's previous conversation history, which includes the user's previous multiple queries on the flood situation in X City and the understanding of the emergency plan activation process. The server passes the conversation history and the original query as input to a large language model (such as GPT-3) that has been pre-trained with specific prompt words. The large language model understands the user's context and intention based on the conversation history and rewrites the original query into multiple more specific and independent queries. For example, the rewritten query may include: "Retrieve the flood warning information of X City in the past 7 days" and "Activate the flood emergency plan for X City". The large language model outputs multiple rewritten queries, and the server organizes these queries into a pending query list. In this example, the pending query list contains two queries. The server then converts each query in the pending query list into a preset data format. This is usually to ensure that subsequent processing modules (such as intent recognition modules) can correctly parse and process these queries. The preset data format may be a structured data object containing fields such as query text and query type. For example, each query might be converted to a JSON object containing "queryText" (query text) and "queryType" (query type) fields.
[0036] Exemplary,original query: Check recent flood warnings in City X and initiate corresponding emergency plans.
[0037] Rewritten query list (pending query list):
[0038] Retrieve the flood warning information of City X in the past 7 days;
[0039] Activate the flood emergency plan for City X;
[0040] A query list converted to a preset data format:
[0041] Query 1: {"queryText":"Search for flood warning information in X city in the past 7 days","queryType":"Information retrieval"}
[0042] Query 2: {"queryText":"Launch X City Flood Emergency Plan","queryType":"System Operation"}
[0043] In the embodiment of the present invention, the aforementioned step S203 can be implemented through the following example execution.
[0044] Based on the preset dynamic intent slot configuration, determine the corresponding candidate intent template and candidate slot template;
[0045] Calling the intent regular expression configured in the preset intent rule engine, performing intent recognition on each of the query lists, and obtaining the first pending intent recognition result and the first pending slot recognition result corresponding to each of the query lists from the candidate intent template and the candidate slot template;
[0046] Calling the intent recognition model constructed based on the pre-trained model, performing intent recognition on each of the query lists, and obtaining a second pending intent recognition result and a second pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates;
[0047] Calling an intent native large language model configured with preset function calling rules, performing intent recognition on each of the query lists, and obtaining a third pending intent recognition result and a third pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates;
[0048] According to the priorities of the intent rule engine, the intent recognition model and the intent native large language model, the target intent recognition result and the preliminary slot recognition result are determined from the first pending intent recognition result, the first pending slot recognition result, the second pending intent recognition result, the second pending slot recognition result, the third pending intent recognition result and the third pending slot recognition result corresponding to each of the query lists, wherein the priorities of the intent rule engine, the intent recognition model and the intent native large language model decrease in sequence.
[0049] In an embodiment of the present invention, exemplarily, in the server of the emergency response system, the query list rewritten after the above steps is ready, and the server will then perform intent recognition based on the pre-set dynamic intent slot configuration. In this example, the query list contains two queries: "retrieve the flood warning information of X city in the past 7 days" and "start the flood emergency plan of X city". The server first loads the pre-set dynamic intent slot configuration, which contains multiple candidate intent templates (such as "information retrieval", "system operation", etc.) and corresponding candidate slot templates (such as "administrative area", "time range", etc.). The server determines the candidate intent templates and candidate slot templates that may be applicable based on the content and context of the current query list. The server calls the pre-set intent rule engine, which is configured with regular expressions for specific intents. For the query "retrieve the flood warning information of X city in the past 7 days", the intent rule engine identifies the intent as "information retrieval" by matching the regular expression, and extracts the value of the slot "administrative area" as "X city" and the value of "time range" as "nearly 7 days". This is the first pending intent recognition result and the first pending slot recognition result. Next, the server calls the intent recognition model built based on the pre-trained model. This model has been trained with a large amount of data and can more accurately recognize intent and extract slots. For the same query, the intent recognition model also recognizes the intent as "information retrieval" and extracts the same slot information. This is the second pending intent recognition result and the second pending slot recognition result. Finally, the server calls the intent native large language model configured with preset function call rules. This model has stronger context understanding and generalization capabilities. For the query "Launch the X City Flood Emergency Plan", since this is a more complex system operation instruction, the intent rule engine and the intent recognition model may not be able to accurately recognize it. However, the intent native large language model can recognize the intent as "system operation" by analyzing the context and semantics, and extract relevant slot information (although this query may not directly involve slot filling). This is the third pending intent recognition result and the third pending slot recognition result. The server evaluates and selects multiple pending intent recognition results and slot recognition results corresponding to each query list according to the pre-set priority (intent rule engine > intent recognition model > intent native large language model). In this example, since the intent rule engine and intent recognition model provide consistent and accurate recognition results for the first query, the server selects their results as the target intent recognition result and the preliminary slot recognition result. For the second query, since the intent native large language model provides a unique and reasonable recognition result, the server selects its result as the target intent recognition result (although there is no explicit slot information).
[0050] For example, query 1: "Search for flood warning information for city X in the past 7 days"
[0051] First / second pending intent recognition results: information retrieval;
[0052] The first / second pending slot identification result: administrative area = X city, time range = the past 7 days;
[0053] Target intent recognition results: information retrieval;
[0054] Preliminary slot identification results: administrative region = City X, time range = recent 7 days;
[0055] Query 2: "Activate the flood emergency plan for City X";
[0056] The third pending intention recognition result: system operation;
[0057] The third pending slot identification result: None;
[0058] Target intention recognition results: system operation;
[0059] Preliminary slot identification results: None (because this query does not directly involve slot filling).
[0060] In the embodiment of the present invention, the aforementioned step S204 may be implemented through the following example execution.
[0061] Determining a slot configuration corresponding to the target intent recognition result according to the intent label corresponding to the target intent recognition result;
[0062] Constructing a slot candidate list according to the slot configuration, wherein the slot configuration includes a slot regular expression field;
[0063] Calling a slot regular expression configured in a preset slot rule engine, performing slot extraction on the preliminary slot identification result according to the slot regular expression field, and obtaining a first slot identification result from the candidate slot template;
[0064] Calling a pre-trained slot recognition model to perform slot extraction on the preliminary slot recognition result, and obtaining a second slot recognition result from the candidate slot template;
[0065] Calling the intent native large language model, performing slot extraction on the preliminary slot recognition result, and obtaining a third slot recognition result from the candidate slot template;
[0066] According to the priorities of the slot rule engine, the slot recognition model, and the intent native large language model, the first slot recognition result, the second slot recognition result, and the third slot recognition result are merged to obtain a merged slot recognition result, wherein the priorities of the slot rule engine, the slot recognition model, and the intent native large language model are successively decreased;
[0067] The merged slot identification result is standardized to obtain the target slot identification result.
[0068] In an embodiment of the present invention, illustratively, in the server of the emergency response system, after the above steps, the target intent recognition result and the preliminary slot recognition result of each query have been determined. Next, the server will perform slot extraction on the preliminary slot recognition result based on the dynamic intent slot configuration to obtain a more accurate target slot recognition result. According to the intent label (such as "information retrieval") corresponding to the target intent recognition result, the server determines the slot configuration corresponding to the intent from the dynamic intent slot configuration. These slot configurations contain slots related to the intent and their regular expression fields. The server builds a slot candidate list according to the regular expression field in the slot configuration. For example, for the slot "administrative area", the server may extract all possible administrative area names from the query text as part of the candidate list according to the regular expression. The server calls a pre-set slot rule engine, which is configured with a regular expression for a specific slot. The slot rule engine matches and extracts the preliminary slot recognition result according to the regular expression field in the slot configuration. For example, for the query "retrieve flood warning information for the past 7 days in X City", the slot rule engine can accurately extract the value of "administrative area" as "X City". This is the first slot recognition result. Next, the server calls the pre-trained slot recognition model. This model is trained based on a large amount of annotated data and can more accurately recognize and extract slot information. For the same query, the slot recognition model can also extract the value of "administrative region" as "X City" and may also extract other relevant slot information (if any). This is the second slot recognition result. The server also calls the intent-native large language model for slot extraction. Although the large language model performs well in intent recognition, it may not be as accurate as a dedicated slot recognition model in slot extraction. However, it can still provide useful slot information, especially when dealing with complex or ambiguous queries. In this example, the large language model may also extract the value of "administrative region" as "X City" and may also provide some additional contextual information. This is the third slot recognition result. The server merges the slot recognition results from the three sources according to the priority of the slot rule engine, slot recognition model, and intent-native large language model (slot rule engine > slot recognition model > intent-native large language model). In this example, since the three models all extract the same slot information, the server will directly select this information as the merged slot identification result. Finally, the server standardizes the merged slot identification result. This includes verifying whether the format and range of the slot value meet the predefined standards (such as verifying whether the administrative region name exists in the predefined administrative region list), and formatting the slot values such as time and date (such as converting "the past 7 days" to a specific date range). After standardization, the server obtains the final target slot identification result.
[0069] Exemplary,target intent identification results: “information retrieval”;
[0070] Preliminary slot identification results: "Administrative region" may include "City X";
[0071] Slot configuration: Include regular expression field for "Administrative Region";
[0072] First slot identification result (slot rule engine): "Administrative region" = "X city";
[0073] Second slot identification result (slot identification model): "Administrative region" = "X city";
[0074] The recognition result of the third slot (intent native large language model): "Administrative region" = "X city";
[0075] Merge slot recognition results: "Administrative region" = "X city";
[0076] Target slot identification result (after standardization): "Administrative region" = "City X".
[0077] In the embodiment of the present invention, the standardization process is performed on the merged slot identification result to obtain the target slot identification result, which can be implemented through the following example.
[0078] The merged slot recognition result is sequentially subjected to time standardization, sequence number standardization, and entity linking processing to obtain the target slot recognition result.
[0079] In an embodiment of the present invention, illustratively, in the server of the emergency response system, the merged slot identification results after the above steps are ready. Since the merged slot identification results may contain multiple types of slot values (such as time, serial number, entity name, etc.), the server needs to standardize these slot values to ensure the accuracy and consistency of subsequent operations. Time standardization: The server first standardizes the time slot value in the merged slot identification result. For example, if the merged slot identification result contains the time description "nearly one week", the server will use a time standardization tool or algorithm to convert "nearly one week" into a specific date range, such as "2023-09-01 to 2023-09-07". In this way, subsequent system operations or data retrieval can be based on this specific date range. Serial number standardization: If the merged slot identification result contains serial number slot values (such as "the first", "the first three", etc.), the server will perform serial number standardization. The server will parse these serial number descriptions and convert them into a serial number list or index that the system can understand. For example, "the first" may be converted to the index value [0] or [1] (depending on the system's index start value), while "the first three" may be converted to the index range [0, 1, 2] or [1, 2, 3]. Entity linking processing: For entity name slot values (such as administrative regions, places, event types, etc.) in the merged slot recognition results, the server will perform entity linking processing. The purpose of entity linking is to link the slot value to a predefined entity library or standard entity in the knowledge graph. For example, if the slot value contains "X City", the server will check whether the value matches an entity in the predefined administrative region entity library. If the match is successful, the server will replace the original slot value with the standard ID or name of the entity. This helps ensure the consistency and accuracy of subsequent operations.
[0080] For example, it is assumed that the merged slot identification result includes the following slot values:
[0081] Time: "nearly one week";
[0082] Sequence number: "first three";
[0083] Entity name: "X City";
[0084] The result after the server performs normalization processing may be as follows:
[0085] Time normalization result: "2023-09-01 to 2023-09-07";
[0086] Ordinal normalization result: [0, 1, 2] (assuming the index starts from 0);
[0087] Entity linking result: Link "X City" to the standard entity in the predefined administrative region entity library, and replace the original value with the standard ID or name of the entity (such as "Standard ID_X City").
[0088] After the above-mentioned standardization processing, the target slot identification results obtained by the server will be more accurate and consistent, providing a solid foundation for subsequent system operations or data retrieval.
[0089] In an embodiment of the present invention, the step of executing the dynamic intent slot configuration may be implemented through the following example.
[0090] Constructing an intent pool and a slot pool, wherein the intent pool includes a plurality of basic intent templates, and the slot pool includes a plurality of basic slot templates;
[0091] In response to the user configuration interaction operation, the dynamic intent slot configuration is performed in combination with the relationship between the local intent and the global intent and the relationship between the built-in intent and the custom intent.
[0092] In an embodiment of the present invention, exemplarily, in the server of the emergency response system, the administrator needs to configure the system to adapt to different emergency response scenarios and user needs. The administrator configures the intent and slot through the user interface, and the server performs dynamic intent slot configuration according to the administrator's operation. The server first builds an intent pool and a slot pool. The intent pool contains multiple basic intent templates, which define various intents that may appear in the system, such as "information retrieval", "system operation", etc. The slot pool contains multiple basic slot templates, which define various slots related to intent, such as "administrative area", "time range", etc. These basic templates provide a basic framework for subsequent dynamic configuration. The administrator selects or defines new intents and slots through the user interface. For example, the administrator may want the system to recognize a new intent "resource scheduling" and related slots such as "resource type", "scheduled quantity", etc. The administrator fills in the relevant information on the interface and submits the configuration request. After receiving the configuration request from the administrator, the server analyzes the relationship between the new intent and the existing intent. Some intents may only be used in specific pages or functions (local intents), while some intents are system-level general functions (global intents). The server correctly categorizes new intents as local or global intents based on the administrator's configuration, and adjusts the configuration in the intent pool accordingly. In addition to administrator-defined intents, the system may also contain some predefined built-in intents. These built-in intents are usually versatile and stable and do not need to be modified frequently. During the configuration process, the server distinguishes between built-in intents and customized intents to ensure that the stability of built-in intents is not affected, while allowing administrators to flexibly configure customized intents as needed. After analyzing the user configuration request and the relationship between intents and slots, the server begins to perform dynamic intent slot configuration. It adds new intent templates to the intent pool or adds new slot configurations to existing intent templates based on the administrator's definition. Similarly, it also adds new slot templates or configuration information related to existing slot templates to the slot pool. This configuration information will be saved in the system's configuration file for use in subsequent system operation and intent recognition processes.
[0093] For example, suppose the administrator wants the system to support a new emergency response scenario - "medical supplies dispatch". In this scenario, the system needs to be able to identify the user's dispatch request and extract relevant dispatch information.
[0094] Build an intent pool: The server already contains basic intent templates such as "information retrieval" and "system operation". The administrator adds a new intent template "medical supplies dispatch" on the interface and defines its related description and purpose.
[0095] Build a slot pool: The slot pool in the server already contains basic slot templates such as "administrative area" and "time range". The administrator adds new slot templates for the "medical material dispatch" intent, such as "material type" (such as masks, disinfectants, etc.), "dispatch quantity", etc.
[0096] User configuration interaction: The administrator fills in the relevant information and slot configuration of the "Medical Supplies Scheduling" intention on the interface and submits the configuration request.
[0097] Dynamic configuration execution: After receiving the configuration request, the server analyzes the relationship between the intent and the slot, and adds the corresponding configuration information to the intent pool and the slot pool. After the configuration is completed, the system can recognize the user's "medical supplies dispatch" request and extract the relevant dispatch information.
[0098] In the embodiment of the present invention, the aforementioned step S205 can be implemented through the following example execution.
[0099] Obtain a reply list module, wherein the reply list module includes a first column content, a second column content, and a third column content;
[0100] The original query, the target intent recognition result and the target slot recognition result are sequentially configured into the first column content, the second column content and the third column content to construct the target answer list, and the target answer list is output and displayed.
[0101] In an embodiment of the present invention, exemplarily, in an emergency response system, the server has completed the intent recognition and slot extraction of the user's original query, and then needs to build a target reply list based on these results and display it to the user through the front-end interface. The server first obtains a pre-designed reply list module. This module is a structured display framework, which usually includes multiple columns of content to clearly display the original query, intent recognition results, and slot recognition results. In this example, the reply list module contains three columns of content: the first column is used to display the original query, the second column is used to display the target intent recognition results, and the third column is used to display the target slot recognition results. The server configures the processed data in the corresponding columns in sequence according to the structure of the reply list module. Specifically:
[0102] Content of the first column (original query): The server fills the original query text entered by the user into the first column. For example, the original query text is "check the earthquake situation in X city in the past week and activate the earthquake early warning system".
[0103] The second column (target intent recognition result): The server fills the target intent recognition result output by the intent recognition module into the second column. In this example, the target intent recognition result includes two intents: "information retrieval" and "system operation".
[0104] Contents of the third column (target slot identification results): The server fills the target slot identification results output by the slot extraction module into the third column. For each intent, the slots and their values associated with it are listed. For example, for the "information retrieval" intent, the slots include "administrative region" (value is "X city") and "time range" (value is "nearly one week"); for the "system operation" intent, there may be no direct slot value, but the relevant operation description or system response can be listed. The server combines the configured data into a complete target reply list. This list clearly shows the original query, the identified intent, and the extracted slot information, making it easy for users to quickly understand and confirm the system's processing results. Finally, the server displays the constructed target reply list to the user through the front-end interface. Users can see their original query, the intent identified by the system, and the extracted key information on the interface, so as to understand the system's processing results and the next operation suggestions.
[0105] For example, assuming that the original query input by the user is "check the earthquake situation in X city in the past week and activate the earthquake early warning system", after processing, the target response list constructed by the server can be shown in Table 1.
[0106] Table 1
[0107] Original query Intent recognition results Slot identification results Check the earthquake situation in City X in the past week and activate the earthquake early warning system Information retrieval, system operation Administrative region: City X, Time range: Nearly one week (System operations have no direct slot value)
[0108] Users can see this list on the front-end interface, so they can clearly understand the system's processing results for the original query.
[0109] In order to more clearly describe the solution provided by the embodiment of the present application, a more detailed description is given below.
[0110] Given an emergency system, its functions are as follows:
[0111] Turn on monitoring: The system understands user instructions, such as "turn on monitoring", and quickly activates the monitoring system to provide real-time images
[0112] Monitoring description: The system provides a detailed description of the monitoring screen to help users analyze the on-site situation.
[0113] Video conferencing: When an emergency meeting is needed, the system can quickly start a video conference and connect relevant personnel for real-time communication.
[0114] System scheduling: The system completes the scheduling of multiple systems according to user instructions.
[0115] Event retrieval: The system can retrieve historical event data to provide reference for current emergency response.
[0116] Page component scheduling: The system can accurately locate and activate corresponding components on the page, such as the "Today's Report" column, based on user instructions, such as "View today's report", so that users can immediately obtain the required information.
[0117] 1. Dynamic intent slot configuration
[0118] This module is designed to enable the emergency response system to dynamically adjust and configure intent and slot information according to different operation scenarios and user needs to achieve more accurate semantic understanding and user command execution.
[0119] 1.1 Intent Pool and Slot Pool
[0120] The system has a number of predefined intents and slots built in, which are stored in the intent pool and slot pool. These built-in intents and slots can be selected, customized and expanded according to different application scenarios. In this embodiment, the predefined intents and slots are as follows:
[0121] 1) Intent pool: stores a series of predefined intent templates. built_in_task_id indicates the unique ID of the intent in the built-in model; task_name indicates the name of the intent; task_description indicates the description of the intent; task_instance indicates the instance of the intent, please refer to Table 2;
[0122] Table 2
[0123] built_in_task_id task_name task_description task_instance 0 Open monitoring Open a certain location monitoring Open the surveillance camera at X City Railway Station 1 Event retrieval Retrieve an event Check out the fire accidents in City X in the past six months 2 Video Description Describe this video Summarize the video situation of the first camera
[0124] 2) Slot pool: contains predefined slot templates. field_name indicates the name of the slot; field_description indicates the description of the slot; field_instance indicates the instance of the slot; field_normal indicates the standard value of the slot; and filed_type indicates the data type of the slot. Please refer to Table 3 for details.
[0125] Table 3
[0126] field_name field_description field_instance field_normal filed_type Example Administrative area Administrative area string X Province Y City place A place string TRAIN STATION Location Location string South Gate Type of accident Types of accidents string Fire accidents Accident severity Adverbs of Degree [Minor, General, Major, Serious, Particularly Serious] string serious time time list[str] Serial number Serial number list[int]
[0127] 1.2 Dynamic configuration process:
[0128] 1) Selection and customization of intents and slots: The system selects and customizes applicable intents and slots from the intent pool and slot pool based on the context of the current page and user interaction.
[0129] 2) Combining local and global intents: The system distinguishes between local intents (operations for a specific page) and global intents (system-wide functions) and combines them to form a complete set of intents for the current scenario.
[0130] 3) Built-in intents vs. custom intents: The system distinguishes between built-in intents (such as “turn on monitoring”) and intents that require custom configuration (such as “video conference”) for quick invocation or further customization.
[0131] 1.3 Configuration Example
[0132] Taking a certain page as an example, configure the task_list of the intent. Each task contains the following information: intent ID (task_id), intent name (task_name), intent description (task_description), intent regular expression (task_instance), and required slot information (request_fields), such as slot name (filed_name), slot description (filed_description), slot type (field_type), slot regular expression (field_instance), slot standard value (field_norm), etc.
[0133] Assuming that the current page involves monitoring tasks, the system will dynamically configure task_lists containing intents such as "Open monitoring", "Receive reports today", and "Video conference". The task_list containing some intents is shown in the following json format:
[0134] {"task_list": [ { "task_name":"Open monitoring","task_description":"Open monitoring", "task_instance":[], "task_id": 6, "built_in_task_id": 0, "request_fields":[ { "field_instance": [],"field_description":"Administrative area", "field_name":"Administrative area","field_normal": [], "field_type":"string"}, { "field_instance": [],"field_description":"Place", "field_name":"Place","field_normal": [], "field_type":"string"}, { "field_instance": [],"field_description":"Place point", "field_name":"Place point","field_normal": [], "field_type":"string"}]}, { "task_name":"Report received today", "task_description":"", "task_instance":[".*Report received today"], "task_id": 7, "built_in_task_id": null, "request_fields":[]}, { "task_name":"Video conference", "task_description":"Initiate a video conference", "task_instance":[], "task_id": 8, "built_in_task_id": null, "request_fields": [ { "field_instance": [],"field_description":"Theme of the meeting", "field_name":"Theme of the meeting","field_normal": [], "field_type":"string"} ]}]}
[0135] Through this dynamic configuration method, the system can flexibly adapt to changing emergency response needs, provide personalized services, and reduce the complexity and cost of customized development.
[0136] 2. Query rewriting
[0137] The purpose of this step is to combine the original query (Query) input with the conversation history (History) and perform necessary transformations on the original query to solve the problems of reference resolution and information completion, thus laying a solid foundation for subsequent multi-intent recognition. This process includes the following sub-steps:
[0138] 2.1 Prompt words
[0139] In this step, the candidate intent template designs a series of refined prompt words, aiming to guide the large language model to more accurately process the user's original query and conversation history. These prompt words not only help the model to resolve references, but also facilitate information completion, ensuring that the rewritten query can accurately reflect the user's intent. Example prompt words are as follows:
[0140] Please rewrite the user's question according to the conversation history, and solve the problems of reference resolution and message completion. I will use it for multi-intent recognition later. Please output the rewritten multiple questions in the form of a list.
[0141] History information:
[0142] user: Open the X city coal mine monitoring
[0143] Assistant: X City Coal Mine Monitoring has been opened for you
[0144] User: Check the surveillance cameras of the city's parks and see if there have been any fires in the past two years.
[0145] Assistant:
[0146] 2.2 Large Model
[0147] In order to achieve efficient semantic understanding and rewriting, the candidate intent template uses advanced large language models, such as chatglm3 and qianwen1.5. These models are optimized with a large amount of training data and complex algorithms, and can effectively handle complex natural language processing tasks. In this step, the large language model will be used to understand the user's query and history and generate a rewritten query list.
[0148] In this step, chatglm3-6b will be selected as the base model, and the above prompt words will be input into the model to obtain the result of the query rewriting by the model.
[0149] Output: ["Check the surveillance of X City Park", has there been any fire in X City Park in the past two years]
[0150] 2.3 Results Analysis
[0151] After generating the rewritten query list, the system will parse the results to ensure that each rewritten query can be parsed into JSON format. If an error is found during the parsing process or it cannot be parsed into JSON format, the system will fall back to using the original query. This mechanism ensures the stability and reliability of the output and ensures that subsequent steps can proceed smoothly.
[0152] Through this optimized query rewriting module, the system can more accurately capture and understand user needs and provide more precise input for the emergency response system, thereby improving the overall response quality and efficiency.
[0153] 3. Intent Recognition
[0154] This module is designed to accurately identify the user's intention expressed through natural language and match it with the tasks defined in the system so that the corresponding actions can be performed. The intention recognition module of this patent achieves efficient and accurate understanding of user queries by combining the rule engine, built-in model and large language model.
[0155] 3.1 Rules Engine
[0156] The rule engine submodule traverses each item in task_list and filters out those intents that define regular expressions (i.e., the task_instance field is not empty). For each user query, the rule engine will perform the following steps:
[0157] 1) Pattern matching: Match the user query against the regular expression of each intent to identify the tasks that best match the user intent.
[0158] 2) Result output: If the query successfully matches the regular expression of a certain intent, the rule engine will return the task_id corresponding to the intent as the recognition result; if there is no match, the result is None.
[0159] Example: Assuming the user enters "Open today's report", the rule engine will search for an intent with the regular expression ".*Today's report" in task_list. If a matching intent is found, for example, task_instance is [".*Today's report"], the rule engine determines that the user's intent is "Today's report" and returns the corresponding task_id. Conversely, if no match is found, the rule engine will not return any results.
[0160] Through this structured rule matching method, the rule engine submodule can efficiently identify the user's intention and provide accurate guidance for subsequent slot filling and task execution. This process not only improves the accuracy of intention recognition, but also enhances the system's responsiveness to user instructions.
[0161] 3.2 Built-in Models
[0162] The patented emergency response system has built-in a series of intent recognition models tailored for specific scenarios.
[0163] Training on task-specific datasets ensures high-precision intent recognition in a variety of scenarios.
[0164] 1) Training process:
[0165] 1. Infrastructure: Use pre-trained models such as BERT as the basis and take advantage of their powerful text understanding capabilities.
[0166] 2. Data processing: The input text is converted into high-dimensional word embedding vectors to capture the deep semantics of the text.
[0167] 3. Training objective: Through the fully connected layer and softmax function, the model learns to predict the probability of each label and uses the cross entropy loss as the optimization objective.
[0168] 4. Iterative optimization: After multiple rounds of epoch training and performance tuning on the validation set, the model has achieved the ability to stably identify user intent in a dynamic environment.
[0169] 2) Reasoning Application:
[0170] 1. Label constraint: During the model inference phase, the system aggregates the built_in_task_id in the task_list into special_labels as the label range for model recognition.
[0171] 2. Confidence calculation: The model scores the input query and only calculates the softmax within special_labels to improve the accuracy and confidence of the prediction.
[0172] 3. Result output: The label with the highest softmax score is selected as the model's prediction result, representing the most likely intent of the user's query.
[0173] 4. Based on the label built_id_task_id obtained by the model, infer the task_id of the intent configuration label in the intent list task_list.
[0174] 3) Optimized calculation formula
[0175] The system uses the following optimized softmax calculation formula to focus on the labels in special_labels, thereby improving the model
[0176] The recognition efficiency and accuracy of the model on specific tasks:
[0177] ;
[0178] in, is a given input Time Tags The conditional probability of is the model pair label The logits score.
[0179] Through this refined built-in model design and application, the patented system can be used in emergency response scenarios.
[0180] Accurately identify user intentions and respond quickly.
[0181] 3.3 Large Language Model
[0182] The emergency response system of this patent utilizes a large language model to process intentions with detailed descriptions, and by converting these intentions into a set of tools, the model is able to select the most appropriate operation based on the user's instructions.
[0183] tools is a list. Each element in the list represents an intent dictionary. The dictionary contains name, description, and parameters elements. Name represents the name of the intent, description represents the description of the intent, and parameters represents the slots required by the intent.
[0184] parameters is a parameter dictionary, where properties is a slot dictionary, key is the slot name, and value is a dictionary containing type and description elements. Type indicates the field type of the slot (such as int, string, etc.), and description indicates the description of the slot.
[0185] 1) Intent information conversion:
[0186] The system traverses task_list and for each intent with a non-empty task_description, converts its information into tools format. The task_name is converted to the name parameter, and the task_description is converted to the description parameter.
[0187] 2) Slot information mapping:
[0188] For each slot in request_fields, use its field_name as the key of properties.
[0189] And use field_type and field_description as type and description in value respectively.
[0190] 3) Large language model call:
[0191] The system constructs prompt words to guide the large language model to select and execute the corresponding tool from the tools according to user instructions.
[0192] For example, a user instruction “Immediately initiate a meeting about the forest fire in City X” will trigger the model to find and execute a tool called “Video Conference”.
[0193] Construct system prompt words and send instructions to the large language model to call the tools in tools, such as:
[0194] Please strictly follow the user's instructions, select an available tool from the tools and return it to the user.
[0195] tools:[{ "name":"Video Conference", "description":"Start a video conference","parameters": { "type":"object", "properties": { "Conference Topic": { "type":"string", "description":"Conference Topic"}}, "required": []}]}]
[0196] User: Immediately initiate a meeting on the forest fire in City X
[0197] Assistant:
[0198] The output of the model is a structured object containing the name of the intent and the required slot parameters. For example, for the above user command, the output will be: {"name":"Video conference","arguments": {"Conference topic":"Forest fire in X city"}}.
[0199] Through the application of this structured large language model, the system of this patent can respond to users' complex instructions more flexibly and accurately, and provide personalized emergency response services.
[0200] 3.4 Sorting Module
[0201] The sorting module is the core decision-making component in this patented emergency response system. It is responsible for integrating the output of the rule engine, built-in model, and large language model to determine the user's final intention. Its decision logic is as follows:
[0202] 1) Priority setting: This module processes inputs in a preset priority order, where the rule engine has the highest priority, followed by the built-in model, and finally the large language model.
[0203] 2) Intent selection: The module compares intent recognition results from different sources and selects the intent that best matches the user input.
[0204] 3) Confidence threshold: If the confidence of the built-in model is lower than the set threshold (e.g. 0.85), the module will rely on the results of the large language model.
[0205] 4) Default processing: When all other modules fail to provide valid recognition results, the system classifies the user's input as "other" intent.
[0206] Suppose the user inputs "I want to see the latest fire report", the sorting module will first check whether there is a matching rule in the rule engine. If not, it will turn to the recognition result of the built-in model. If the confidence of the built-in model is lower than 0.85, the large language model will be activated to provide the final intent recognition. If all attempts fail, the user's input will be classified as "other" intent.
[0207] Through this optimized sorting module, the system of this patent can process user input more accurately and efficiently, ensuring stable and reliable intent recognition services in various situations.
[0208] 4. Slot extraction
[0209] After completing the intent recognition phase and successfully determining the user's intent, the system will enter the next critical step - slot extraction. This step is crucial because it involves accurately extracting all the key information required to perform the task from the user input. To achieve this goal, the system has designed a comprehensive slot extraction module that is able to process and integrate data from different sources to ensure that each slot is accurately identified and filled. This process also involves the use of rule engines, built-in slot extraction models, and large models.
[0210] 4.1 Get the slot list
[0211] According to the intent recognition result of the previous step, the system first retrieves the corresponding task_id from task_list, and then obtains the request_fields list of slots to be recognized associated with it.
[0212] 4.2 Rules Engine
[0213] The rule engine submodule performs pattern matching on each slot in request_fields. It uses the field_instance field of each slot as a matching pattern and compares it with the user query query to identify and extract the slot value. If there is no match, the system marks the slot value as blank.
[0214] 4.3 Built-in Models
[0215] The built-in model submodule uses models specially trained for slot recognition tasks, such as the UIE model, to accurately recognize specific slots. By using the constructed slot recognition training dataset, the model can recognize the slot value, the slot position in the text, and the confidence of the recognition.
[0216] 4.4 Large Language Model
[0217] The large language model that has been deployed in the intent recognition stage is now used for slot recognition tasks. Since the model has understood the user's intent and preliminary slot information, it can be directly used to further analyze the context and semantic relationships, identify more complex and obscure slot information, and thus improve the depth and breadth of slot recognition.
[0218] Through this optimized slot extraction process, the system can accurately extract key slot information from user queries, ensuring the accuracy and efficiency of subsequent task execution, while also enhancing the user experience of the entire emergency response system.
[0219] 4.5 Merge Modules
[0220] The merging module is responsible for integrating the slot information provided by the rule engine, built-in model, and large language model, and prioritizing them to ensure accurate extraction of key slots in various dialogue scenarios.
[0221] 1) Prioritization:
[0222] Rule engine priority: The rule engine provides direct slot matching and is the preferred information source.
[0223] Built-in model supplement: When the rule engine cannot identify, the built-in model provides deep slot identification.
[0224] Large language model as a backup: When other methods fail, the large language model is used as a last resort to handle complex and obscure slot information.
[0225] 2) Merge logic:
[0226] Conflict resolution: For slot value conflicts from multiple sources, priority is given to the rule engine, then the built-in model, and finally the large language model.
[0227] Consistency check: Ensures that the data type and format of the slot value are consistent and relevant to the context.
[0228] 3) Result output:
[0229] The merge module outputs a final slot list for subsequent modules to perform tasks.
[0230] Through this streamlined merging module, the system can efficiently process and ensure the accuracy of slot information, improving user experience.
[0231] 4.6 Results Standardization
[0232] In order to ensure the consistency and compatibility of slot information, the extracted slot information needs to go through a series of standardization processes. This includes:
[0233] 1) Time standardization
[0234] The time standardization process in the present invention is implemented by calling the time_sparse tool in the jionlp library. The tool can parse the time expression in natural language and convert it into a structured time range. For example, when processing the time text 'these two years', the time_sparse tool first identifies the relative nature of the time expression, and then calculates the corresponding start time '2022-3-20 13:22:22' according to the current time '2024-3-20 13:22:22', and together with the current time, it constitutes a time range [start time, end time], i.e. [2022-3-20 13:22:22, 2024-3-2013:22:22]. The use of the time_sparse tool improves the accuracy and efficiency of time parsing.
[0235] Serial number standardization
[0236] 1. Sequence number text parsing: Enter the sequence number text (for example, "first", "first 5", "last two"); parse the sequence number text to determine the sequence number type (for example, "first" represents a single sequence number, "first 5" and "last two" represent sequence number ranges).
[0237] 2. Generate a list of sequence numbers: Generate a list of sequence numbers according to the sequence number type and the current context. For a single sequence number (such as "the first one"), generate a list [1]; for the first N sequence numbers (such as "the first 5"), generate a list of sequence numbers from 1 to N [1,2, ..., N]; for the last N sequence numbers (such as "the last two"), generate a list of sequence numbers from -N to -1 [-N, ..., -1].
[0238] 3. Output: Output the generated serial number list
[0239] 3) Entity Linking
[0240] Entity linking aims to map slot values to predefined slot standard values.
[0241] Traverse the slots to be identified. If the slot standard value list is not empty, entity linking is required for the identified slot values.
[0242] 1. Slot value standardization: Input the extracted slot value (for example, "Extremely Serious") and a predefined slot standard value list (for example, ["Minor", "General", "Major", "Major", "Extremely Serious"]); match the extracted slot value with the items in the predefined standard value list.
[0243] 2. Calculate similarity: Use two methods to calculate the similarity between the extracted value and each candidate in the standard value list. Edit distance similarity: Calculate the edit distance (Levenshtein distance) between the extracted value and each candidate standard value to evaluate the character difference between them. Semantic similarity: Use a BERT-like model to convert the extracted value and each candidate standard value into word embedding vectors, and then calculate the cosine similarity between these vectors to evaluate the semantic similarity between them.
[0244] 3. Score calculation: Calculate the comprehensive score of each candidate standard value using the following formula: Final score = 0.9 × semantic similarity + 0.1 × edit distance similarity Final score = 0.9 × semantic similarity + 0.1 × edit distance similarity.
[0245] 4. Threshold determination: Set a threshold (for example, 0.91); if the comprehensive score of any candidate standard value is higher than the threshold, the candidate value is selected as the standardized slot value; if the scores of all candidate values are lower than the threshold, it is considered that there is no matching standard value and the slot is left empty.
[0246] ⑤Output: Output the normalized slot value or mark it as unmatched (if the scores of all candidate values are below the threshold).
[0247] Through these optimizations, the slot identification module can process user input more accurately and efficiently, providing stable and reliable slot extraction services, thereby enhancing the user experience and performance of the entire system.
[0248] 5. Output intent and slot list
[0249] Finally, the standardized semantic understanding results are passed to the subsequent dialogue management module, and the results include a list, each of which contains intent results and slot results, for further processing and response by the subsequent dialogue management module. Please refer to Table 4. Through the above technical solution, the present invention can effectively process the user's dynamic multi-intent and provide accurate intent recognition and slot extraction in various application scenarios, thereby improving the overall performance and user experience of the dialogue system.
[0250] Table 4
[0251] Question Intent recognition results Slot extraction results Open the surveillance camera of the Y coal mine in X city and describe whether there is any abnormality [Open monitoring, monitoring description] [{Administrative region: X City, Location: Y Coal Mine, Location: Mine}, {Administrative region: X City, Location: Y Coal Mine, Location: Mine}] The city's Z Park surveillance also looks at [Open monitoring] [{Administrative region: City X, Location: Park Z}] Zoom in on the first [enlarge] [{Serial number: [1]}] Has there been any fire here in the past two years? [Event Search] [{Administrative region: City X, Location: Park Z, Time: [2022-3-26 20:23:26, 2024-3-26 20:23:26]}]
[0252] Please refer to 2. Figure 2 A dynamic multi-intent semantic understanding device 110 provided in an embodiment of the present invention includes:
[0253] Receiving module 1101, used for receiving the original query of the user;
[0254] A rewriting module 1102, configured to obtain a plurality of query lists for the original query by rewriting according to the conversation history and the original query;
[0255] The intent module 1103 is used to perform intent recognition on each of the query lists based on a preset dynamic intent slot configuration, obtain a pending intent recognition result and a pending slot recognition result corresponding to each of the query lists, and extract a target intent recognition result and a preliminary slot recognition result therefrom;
[0256] The slot module 1104 is used to perform slot extraction on the preliminary slot recognition result based on the dynamic intended slot configuration to obtain a target slot recognition result;
[0257] The output module 1105 is used to construct a target answer list for the original query according to the target intent recognition result and the target slot recognition result, and output the target answer list for display.
[0258] It should be noted that the implementation principle of the aforementioned dynamic multi-intention semantic understanding device 110 can refer to the implementation principle of the aforementioned dynamic multi-intention semantic understanding method, which will not be repeated here. It should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the dynamic multi-intention semantic understanding device 110 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above dynamic multi-intention semantic understanding device 110. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in software form.
[0259] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0260] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the above-mentioned dynamic multi-intent semantic understanding device 110. Figure 3 As shown, Figure 3This is a structural block diagram of a computer device 100 provided in an embodiment of the present invention. The computer device 100 includes a dynamic multi-intent semantic understanding device 110, a memory 111, a processor 112 and a communication unit 113.
[0261] In order to realize data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, the electrical connection between these elements can be achieved through one or more communication buses or signal lines. The dynamic multi-intent semantic understanding device 110 includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or solidified in the operating system (OS) of the computer device 100. The processor 112 is used to execute the dynamic multi-intent semantic understanding device 110 stored in the memory 111, such as the software function modules and computer programs included in the dynamic multi-intent semantic understanding device 110.
[0262] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is running, it controls the computer device where the readable storage medium is located to execute the aforementioned dynamic multi-intent semantic understanding method.
[0263] For illustrative purposes, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. Numerous modifications and variations are possible in accordance with the above teachings. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.
Claims
1. A dynamic multi-intent semantic understanding method, characterized in that: include: Receive the user's original query; According to the conversation history and the original query, a plurality of query lists for the original query are obtained by rewriting; Based on the preset dynamic intent slot configuration, perform intent recognition on each of the query lists, obtain pending intent recognition results and pending slot recognition results corresponding to each of the query lists, and extract target intent recognition results and preliminary slot recognition results therefrom; Based on the dynamic intention slot configuration, performing slot extraction on the preliminary slot recognition result to obtain a target slot recognition result; Construct a target answer list for the original query according to the target intent recognition result and the target slot recognition result, and output the target answer list for display; The method of performing intent recognition on each query list based on the preset dynamic intent slot configuration, obtaining a pending intent recognition result and a pending slot recognition result corresponding to each query list, and extracting a target intent recognition result and a preliminary slot recognition result therefrom, includes: Based on the preset dynamic intent slot configuration, determine the corresponding candidate intent template and candidate slot template; Calling the intent regular expression configured in the preset intent rule engine, performing intent recognition on each of the query lists, and obtaining the first pending intent recognition result and the first pending slot recognition result corresponding to each of the query lists from the candidate intent template and the candidate slot template; Calling the intent recognition model constructed based on the pre-trained model, performing intent recognition on each of the query lists, and obtaining a second pending intent recognition result and a second pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates; Calling an intent native large language model configured with preset function calling rules, performing intent recognition on each of the query lists, and obtaining a third pending intent recognition result and a third pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates; According to the priorities of the intent rule engine, the intent recognition model, and the intent native large language model, the target intent recognition result and the preliminary slot recognition result are determined from the first pending intent recognition result, the first pending slot recognition result, the second pending intent recognition result, the second pending slot recognition result, the third pending intent recognition result, and the third pending slot recognition result corresponding to each of the query lists, wherein the priorities of the intent rule engine, the intent recognition model, and the intent native large language model are successively reduced; The step of performing slot extraction on the preliminary slot recognition result based on the dynamic intention slot configuration to obtain a target slot recognition result includes: Determining a slot configuration corresponding to the target intent recognition result according to the intent label corresponding to the target intent recognition result; Constructing a slot candidate list according to the slot configuration, wherein the slot configuration includes a slot regular expression field; Calling a slot regular expression configured in a preset slot rule engine, performing slot extraction on the preliminary slot identification result according to the slot regular expression field, and obtaining a first slot identification result from the candidate slot template; Calling a pre-trained slot recognition model to perform slot extraction on the preliminary slot recognition result, and obtaining a second slot recognition result from the candidate slot template; Calling the intent native large language model, performing slot extraction on the preliminary slot recognition result, and obtaining a third slot recognition result from the candidate slot template; According to the priorities of the slot rule engine, the slot recognition model, and the intent native large language model, the first slot recognition result, the second slot recognition result, and the third slot recognition result are merged to obtain a merged slot recognition result, wherein the priorities of the slot rule engine, the slot recognition model, and the intent native large language model are successively decreased; The merged slot identification result is standardized to obtain the target slot identification result.
2. The method according to claim 1, characterized in that The step of obtaining multiple query lists for the original query by rewriting according to the conversation history and the original query includes: Rewriting the conversation history and the original query input in a large language model trained with preset prompt words to obtain multiple pending query lists for the original query; Each of the pending query lists is converted into the query list in a preset data format.
3. The method according to claim 1, characterized in that The step of performing standardization processing on the merged slot identification result to obtain the target slot identification result includes: The merged slot recognition result is sequentially subjected to time standardization, sequence number standardization, and entity linking processing to obtain the target slot recognition result.
4. The method according to claim 1, characterized in that: The steps of performing the dynamic intent slot configuration include: Constructing an intent pool and a slot pool, wherein the intent pool includes a plurality of basic intent templates, and the slot pool includes a plurality of basic slot templates; In response to the user configuration interaction operation, the dynamic intent slot configuration is performed in combination with the relationship between the local intent and the global intent and the relationship between the built-in intent and the custom intent.
5. The method according to claim 1, characterized in that The step of constructing a target answer list for the original query according to the target intent recognition result and the target slot recognition result, and outputting and displaying the target answer list includes: Obtain a reply list module, wherein the reply list module includes a first column content, a second column content, and a third column content; The original query, the target intent recognition result and the target slot recognition result are sequentially configured into the first column content, the second column content and the third column content to construct the target answer list, and the target answer list is output and displayed.
6. A dynamic multi-intent semantic understanding device, characterized in that: include: A receiving module, used for receiving the original query of the user; A rewriting module, configured to obtain a plurality of query lists for the original query by rewriting according to the conversation history and the original query; An intent module, for performing intent recognition on each of the query lists based on a preset dynamic intent slot configuration, obtaining pending intent recognition results and pending slot recognition results corresponding to each of the query lists, and extracting a target intent recognition result and a preliminary slot recognition result therefrom; A slot module, used for performing slot extraction on the preliminary slot recognition result based on the dynamic intended slot configuration, to obtain a target slot recognition result; An output module, used to construct a target answer list for the original query according to the target intent recognition result and the target slot recognition result, and output the target answer list for display; The intent module is specifically used for: Based on the preset dynamic intent slot configuration, determine the corresponding candidate intent template and candidate slot template; call the intent regular expression configured in the preset intent rule engine, perform intent recognition on each of the query lists, and obtain the first pending intent recognition result and the first pending slot recognition result corresponding to each of the query lists from the candidate intent template and the candidate slot template; Calling the intent recognition model constructed based on the pre-trained model, performing intent recognition on each of the query lists, and obtaining a second pending intent recognition result and a second pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates; Calling an intent native large language model configured with preset function calling rules, performing intent recognition on each of the query lists, and obtaining a third pending intent recognition result and a third pending slot recognition result corresponding to each of the query lists from the candidate intent templates and the candidate slot templates; According to the priorities of the intent rule engine, the intent recognition model, and the intent native large language model, the target intent recognition result and the preliminary slot recognition result are determined from the first pending intent recognition result, the first pending slot recognition result, the second pending intent recognition result, the second pending slot recognition result, the third pending intent recognition result, and the third pending slot recognition result corresponding to each of the query lists, wherein the priorities of the intent rule engine, the intent recognition model, and the intent native large language model are successively reduced; The slot module is specifically used for: According to the intent label corresponding to the target intent recognition result, determine the slot configuration corresponding to the target intent recognition result; according to the slot configuration, build a slot candidate list, the slot configuration includes a slot regular expression field; call the slot regular expression configured in the preset slot rule engine, perform slot extraction on the preliminary slot recognition result according to the slot regular expression field, and obtain a first slot recognition result from the candidate slot template; call the slot recognition model based on pre-training, perform slot extraction on the preliminary slot recognition result, and obtain a second slot recognition result from the candidate slot template; call The intent native large language model performs slot extraction on the preliminary slot recognition result, and obtains a third slot recognition result from the candidate slot template; merges the first slot recognition result, the second slot recognition result, and the third slot recognition result according to the priorities of the slot rule engine, the slot recognition model, and the intent native large language model, and outputs a merged slot recognition result, wherein the priorities of the slot rule engine, the slot recognition model, and the intent native large language model decrease in sequence; and normalizes the merged slot recognition result to obtain the target slot recognition result.
7. A computer device, characterized in that: The computer device comprises a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 5.
8. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method according to any one of claims 1 to 5.
