Multi-level intent knowledge base management method and related devices thereof
By adopting a multi-level intent knowledge base management method, using a multi-level nested JSON data format and an entity class thesaurus, the problems of high difficulty in intent knowledge base management and poor generalization ability are solved, and the structured management and accurate recognition of intent base are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies for managing intent knowledge bases suffer from poor generalization capabilities and high management difficulty. In particular, when intents or business knowledge are updated and iterated, the intent knowledge base becomes chaotic, bloated, and difficult to maintain.
A multi-level intent knowledge base management method is adopted. By acquiring behavior categories, attribute categories, entity categories and intent tag data from the multi-level intent knowledge base, the data is structured using a multi-level nested JSON data format, and a space is reserved for inserting prompts. The data is recorded in combination with an entity class thesaurus and key-value pair format and displayed on the front-end management interface.
It achieves a hierarchical representation of the intent knowledge base, reduces the update frequency and management difficulty, improves the accuracy and generalization ability of intent recognition, and reduces the difficulty of model classification.
Smart Images

Figure CN115982326B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a multi-level intent knowledge base management method and a related device thereof. BACKGROUND
[0002] Before intelligent interaction systems such as intelligent question answering, agent assistance, intelligent assistants, etc. are put into application, an intent knowledge base needs to be constructed first. When a user inputs text, the user's intent is recognized through a model or rules, and then the intent knowledge base is searched according to the intent, and predefined content (including scripts, answers, actions, etc.) is output. As the core link of the entire interaction system, the intent knowledge base plays a key role in linking intents and business knowledge in the intelligent interaction system. In actual application, as the intent or business knowledge is updated and iterated, the intent knowledge base often becomes very chaotic and bloated due to the lack of effective management means, which makes it very difficult to test and maintain the intent knowledge base.
[0003] In the prior art, a standard question is directly taken as an intent label, the standard question is spread out in the intent knowledge base, and corresponding business knowledge is configured according to the standard question. When identifying, the standard question closest to the input text is searched in the library by a matching search method, and then the corresponding business knowledge is output. On the one hand, the construction and maintenance of such an intent knowledge base greatly depend on manual configuration of manpower; on the other hand, the design of the standard question also tests the business experience of the relevant personnel. Although a regular method is generally used to improve the generalization ability of the standard question, the improvement brought by such generalization is very limited as the intent is continuously expanded. Therefore, the prior art still has the problems of poor generalization ability and great management difficulty in managing the intent knowledge base. SUMMARY
[0004] The purpose of the embodiments of the present application is to propose a multi-level intent knowledge base management method and a related device thereof to solve the problem of poor generalization ability and great management difficulty in managing the intent knowledge base in the prior art.
[0005] To solve the above technical problems, the embodiments of the present application provide a multi-level intent knowledge base management method, which adopts the following technical solutions:
[0006] A multi-level intent knowledge base management method includes the following steps:
[0007] Obtaining behavior category data, attribute category data, entity category data and intent label data in a multi-level intent knowledge base;
[0008] Mapping the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule;
[0009] acquire a preset prompt script, and insert the prompt script into a reserved position in the target data structure according to a preset association relationship;
[0010] set a corresponding synonym for different entity category data in the target data structure according to a preset entity synonym dictionary, and record the entity category data and the synonym in a key-value pair format;
[0011] display the finally generated target data structure and the key-value pair to a preset front-end management interface, and complete the preliminary management of the multi-level intent knowledge base.
[0012] Further, before performing the step of mapping the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule, the method further comprises:
[0013] previously marking the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base in a distinguished mark form;
[0014] The target data structure is specifically a JSON multi-layer nested data format, and the step of mapping the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule specifically comprises:
[0015] According to the corresponding distinguished mark of the behavior category data, acquire target behavior category data, and set the target behavior category data as the outermost data in the JSON multi-layer nested data format;
[0016] According to the corresponding distinguished mark of the attribute category data, acquire target attribute category data, and set the target attribute category data as the next outer layer data in the JSON multi-layer nested data format;
[0017] According to the corresponding distinguished mark of the entity category data, acquire target entity category data, and set the target entity category data as the next inner layer data in the JSON multi-layer nested data format;
[0018] According to the corresponding distinguished mark of the intent label data, acquire target intent label data, and set the target intent label data as the innermost data in the JSON multi-layer nested data format.
[0019] Further, before performing the step of previously marking the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base in a distinguished mark form, the method further comprises:
[0020] The first part of the distinguishing field in the distinguishing mark is set according to different behavior categories, attribute categories, entity categories and intent labels to which the target data belongs, wherein the target data is any data in the multi-level intent knowledge base;
[0021] The second part of the distinguishing field in the distinguishing mark is set according to different specific categories, wherein the specific categories are any of the behavior categories, attribute categories, entity categories and intent labels;
[0022] The distinguishing mark is generated according to the first part of the distinguishing field and the second part of the distinguishing field.
[0023] Further, in the step of mapping the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule, the method further comprises:
[0024] A prompt dialogue insertion position is reserved in each data nesting layer of the JSON multi-layer nested data format;
[0025] The step of obtaining the preset prompt dialogue and inserting the prompt dialogue into the reserved position in the target data structure according to the preset association relationship comprises:
[0026] According to the association relationship, the data field corresponding to the current prompt dialogue in the multi-level intent knowledge base is identified;
[0027] The data field is taken as a search field, and the mapped data in the target data structure is taken as a search domain, so as to identify the mapping position information of the data field in the target data structure;
[0028] According to the mapping position information, the data nesting layer corresponding to the data field in the JSON multi-layer nested data format is determined;
[0029] The current prompt dialogue is inserted into the prompt dialogue insertion position reserved in the data nesting layer, so as to complete the insertion of the prompt dialogue into the target data structure.
[0030] Further, the step of recording the entity category data and the synonym in the key-value pair format comprises:
[0031] All entity category data in the multi-level intent knowledge base is obtained;
[0032] retrieving, from the entity synonym dictionary, a synonym corresponding to each entity category data in the all entity category data as a search term in sequence;
[0033] counting the number of synonyms corresponding to each entity category data;
[0034] if the current entity category data does not have a corresponding synonym, taking the current entity category data as key data and NULL as value data in the key-value pair;
[0035] if the number of synonyms corresponding to the current entity category data is 1, taking the current entity category data as key data and the synonym as value data in the key-value pair;
[0036] if the number of synonyms corresponding to the current entity category data is N, taking the current entity category data as key data, obtaining all synonyms corresponding to the current entity category data, constructing enumeration format data based on the all synonyms, and taking the constructed enumeration format data as value data, wherein N is a positive integer greater than 1.
[0037] Further, after the step of displaying the finally generated target data structure and the key-value pair to the preset front-end management interface to complete the preliminary management of the multi-level intent knowledge base, the method further comprises:
[0038] receiving, based on a preset receiving component, text data to be analyzed for intent by a user;
[0039] predicting, in sequence, a behavior category, an attribute category, an entity category, and an intent label corresponding to the text data according to a preset category classification prediction model;
[0040] determining whether the entity category is mapped in the target data structure;
[0041] if the entity category is mapped in the target data structure, obtaining prompt dialogues corresponding to the behavior category, the attribute category, the entity category, and the intent label in sequence according to the mapping level of the target data structure;
[0042] if the entity category is not mapped in the target data structure, identifying whether the entity category has a synonym according to the recorded key-value pair format data and the entity category;
[0043] if there is no synonym, obtaining prompt dialogues corresponding to the behavior category, the attribute category, and the intent label in sequence according to the mapping level of the target data structure;
[0044] If there is a synonym, the prompt words corresponding to the behavior category, attribute category, synonym and intention label are obtained in sequence according to the mapping level of the target data structure;
[0045] According to the preset verification component, the correctness of the obtained prompt words is verified.
[0046] Further, the step of verifying the correctness of the obtained prompt words according to the preset verification component specifically includes:
[0047] According to the prompt words and the preset correct result reference table, comparison is performed, and according to the comparison result, it is judged whether the prompt words are the prompt words output as expected;
[0048] After the step of judging whether the prompt words are the prompt words output as expected, the method further includes:
[0049] If the prompt words are the prompt words output as expected, the target data structure does not need to be adjusted;
[0050] If the prompt words are not the prompt words output as expected, the target data structure is optimized according to the preset tuning mechanism.
[0051] In order to solve the above technical problems, the embodiment of the application also provides a multi-level intention knowledge base management device, which adopts the technical scheme as follows:
[0052] A multi-level intention knowledge base management device includes:
[0053] A data acquisition module is configured to acquire behavior category data, attribute category data, entity category data and intention label data in a multi-level intention knowledge base.
[0054] A data structuring module is configured to map the behavior category data, attribute category data, entity category data and intention label data in the multi-level intention knowledge base into a target data structure according to a preset mapping rule.
[0055] A prompt word insertion module is configured to acquire a preset prompt word and insert the prompt word into a reserved position in the target data structure according to a preset association relationship.
[0056] A synonym setting module is configured to set corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and record the entity category data and the synonyms in a key-value pair format.
[0057] The management page display module is configured to display the finally generated target data structure and the key-value pair to a preset front-end management interface, thereby completing preliminary management of the multi-level intent knowledge base.
[0058] To solve the above technical problems, the embodiment of the application further provides a computer device, which adopts the technical scheme as follows:
[0059] A computer device includes a memory and a processor, the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the multi-level intent knowledge base management method.
[0060] To solve the above technical problems, the embodiment of the application further provides a computer readable storage medium, which adopts the technical scheme as follows:
[0061] A computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor to implement the steps of the multi-level intent knowledge base management method.
[0062] Compared with the prior art, the embodiment of the application has the following beneficial effects:
[0063] The multi-level intent knowledge base management method includes the following steps: obtaining behavior category data, attribute category data, entity category data, and intent label data in a multi-level intent knowledge base; mapping the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule; obtaining a preset prompt script and inserting the prompt script into a reserved position in the target data structure according to a preset association relationship; setting corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and recording the entity category data and the synonyms in a key-value pair format; and displaying the finally generated target data structure and the key-value pair to a preset front-end management interface, thereby completing preliminary management of the multi-level intent knowledge base. After the intent is represented in a structured manner, the hierarchical expression of the intent is more generalized, which can reduce the update frequency of the intent knowledge base and reduce the difficulty of intent management. After the hierarchical intent structure is adopted, the total number of categories can be reduced, the difficulty of model classification can be reduced, and the user intent can be more accurately identified by combining the entity extraction mode, thereby providing corresponding prompt scripts. BRIEF DESCRIPTION OF DRAWINGS
[0064] In order to more clearly illustrate the solutions in the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.
[0065] Figure 1 is an exemplary system architecture diagram to which the present application can be applied;
[0066] Figure 2 a flow chart of one embodiment of the multi-level intent knowledge base management method according to the present application;
[0067] Figure 3 is a flow chart of one specific embodiment of the step 202 shown in Figure 2
[0068] Figure 4 is a flow chart of one specific embodiment of the step 203 shown in Figure 2
[0069] Figure 5 is a flow chart of one specific embodiment of the step 204 shown in Figure 2
[0070] Figure 6 is a structural schematic diagram of one embodiment of the multi-level intent knowledge base management device according to the present application;
[0071] Figure 7 is a structural schematic diagram of one embodiment of the computer device according to the present application. DETAILED DESCRIPTION
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs; the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "include" and "have" and any variations thereof in the specification of the present application and claims and the above description of drawings are intended to cover non-exclusive inclusion. The terms "first", "second" and the like in the specification of the present application and claims or the above description of drawings are used to distinguish different objects, not to describe a particular order.
[0073] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. As will be apparent to those of ordinary skill in the art, embodiments described herein can be combined with other embodiments.
[0074] In order to better understand the scheme of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings.
[0075] As shown in Figure 1 The system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0076] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0077] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0078] The server 105 can be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
[0079] It should be noted that the multi-level intent knowledge base management method provided by the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the multi-level intent knowledge base management apparatus is generally provided in a server / terminal device.
[0080] It should be understood that Figure 1The number of terminal devices, networks and servers in the system is merely illustrative. Any number of terminal devices, networks and servers can be provided according to implementation needs.
[0081] With reference to the accompanying drawings still, Figure 2 , a flow chart of one embodiment of a multi-level intent knowledge base management method according to the present application is shown. The multi-level intent knowledge base management method includes the following steps:
[0082] Step 201, obtaining behavior category data, attribute category data, entity category data and intent label data in a multi-level intent knowledge base.
[0083] In this embodiment, the behavior category data corresponds to pre-set action behavior categories of users, including 8 categories, namely, “inquiry”, “complaint”, “intention”, “request”, “evaluation”, “information provision”, “general” and “comparison”; the attribute category data corresponds to attribute descriptions of business events, such as “claim settlement process”, “coverage”, “discount” and “deadline”; the entity category data corresponds to abstract entity objects of business events, such as “compulsory insurance”, “China Ping An” and “customer service”; and the intent label data is mainly personalized labels for recording intents, used to distinguish different business intents in the same case of behavior category data, attribute category data and entity category data.
[0084] Step 202, mapping the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base into a target data structure according to a pre-set mapping rule.
[0085] In this embodiment, before performing the step of mapping the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base into a target data structure according to a pre-set mapping rule, the method further includes pre-marking the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base in a form of distinguishing marks.
[0086] By pre-marking the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base in a form of distinguishing marks, different categories of data information in the multi-level intent knowledge base are represented, facilitating management of data in the multi-level intent knowledge base.
[0087] Before the step of marking the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base by using the different marking forms, the method further comprises: setting a first part of the different fields in the different marking forms according to the different behaviors, attributes, entities and intent labels to which the target data belongs, wherein the target data is any data in the multi-level intent knowledge base; setting a second part of the different fields in the different marking forms according to the different specific categories to which the target data belongs, wherein the specific category is any of the behavior category, the attribute category, the entity category and the intent label; and generating the different marking forms according to the first part of the different fields and the second part of the different fields.
[0088] By setting the first part of the different fields for the target data according to the four categories to which the target data belongs, i.e., the behavior category data, the attribute category data, the entity category data and the intent label data, for example, the target data is “evaluation”, and the category to which the target data belongs is the behavior category, and it is assumed that the first part of the different fields set for the behavior category data, the attribute category data, the entity category data and the intent label data are “act”, “attr”, “entity” and “label”, respectively, then the first part of the different fields corresponding to the target data “evaluation” is “act”, the behavior category data is divided into eight categories, and it is assumed that “evaluation” is the fifth category in the eight categories, then the second part of the different fields corresponding to the target data “evaluation” is “five”, and the different marking form of the target data “evaluation” is “act_five”, which is generated according to the first part of the different fields and the second part of the different fields.
[0089] By generating the different marking forms according to the first part of the different fields and the second part of the different fields, the target data in the intent knowledge base can be distinguished.
[0090] In the embodiment, the target data structure is specifically in the JSON multi-layer nested data format.
[0091] With reference to Figure 3 , Figure 3 is Figure 2 a flowchart of a specific embodiment of the step 202, comprising:
[0092] In step 301, the target behavior category data is obtained according to the different marking form corresponding to the behavior category data, and the target behavior category data is set as the outermost data in the JSON multi-layer nested data format.
[0093] Step 302, according to the distinguishing mark corresponding to the attribute category data, obtaining target attribute category data, and setting the target attribute category data as the next outer layer data in the JSON multi-layer nested data format;
[0094] Step 303, according to the distinguishing mark corresponding to the entity category data, obtaining target entity category data, and setting the target entity category data as the next inner layer data in the JSON multi-layer nested data format;
[0095] Step 304, according to the distinguishing mark corresponding to the intent label data, obtaining target intent label data, and setting the target intent label data as the innermost layer data in the JSON multi-layer nested data format.
[0096] By adopting the JSON multi-layer nested data format, the data in the multi-level intent knowledge base is sequentially mapped into the target data structure according to the four-level relationship of "action-attribute-entity-intent label", which facilitates the structured display and management of the data in the multi-level intent knowledge base.
[0097] In the embodiment, in the process of performing the step of mapping the action category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule, the method further comprises: reserving a prompt script insertable position in each data nested layer of the JSON multi-layer nested data format.
[0098] By reserving a prompt script insertable position in each data nested layer of the JSON multi-layer nested data format, the prompt script needed in the business process can be displayed in the target data structure, facilitating the management of the multi-level intent knowledge base.
[0099] Step 203, obtaining a preset prompt script, and inserting the prompt script into the position reserved in the target data structure according to a preset association relationship.
[0100] With reference to Figure 4 , Figure 4 is Figure 2 a flowchart of a specific embodiment of step 203, comprising:
[0101] Step 401, identifying the data field in the multi-level intent knowledge base corresponding to the current prompt script according to the association relationship;
[0102] Step 402, taking the data field as a retrieval field and the mapped data in the target data structure as a retrieval domain, identifying the mapping position information of the data field in the target data structure;
[0103] Step 403, determining the corresponding data nesting layer of the data field in the JSON multi-layer nested data format according to the mapping position information;
[0104] Step 404, inserting the current prompt into the prompt-insertable position reserved in the data nesting layer, to complete the insertion of the prompt into the target data structure.
[0105] In actual business processes, different data in the four-layer hierarchical relationship of "behavior-attribute-entity-intention label" may correspond to different prompts, for example, the prompt corresponding to the "preferential" in the attribute category data is "This preferential is very strong, not only can you enjoy cashback", and the prompt corresponding to the "compulsory insurance" in the entity category data is "Through this activity, you can enjoy free car washing at designated locations when purchasing compulsory insurance", therefore, the position of the prompt to be inserted is determined by the specific data corresponding to the prompt, and the prompt "This preferential is very strong, not only can you enjoy cashback" is inserted into the level of the attribute category data "preferential", and the prompt "Through this activity, you can enjoy free car washing at designated locations when purchasing compulsory insurance" is inserted into the level of the entity category data "compulsory insurance". According to the different data fields corresponding to the prompts in the multi-level intention knowledge base, the prompts are inserted respectively, which facilitates the management of the multi-level intention knowledge base.
[0106] Step 204, setting corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and recording the entity category data and the synonyms in a key-value pair format.
[0107] With reference to Figure 5 , Figure 5 is Figure 2 a flowchart of a specific embodiment of step 204, comprising:
[0108] Step 501, obtaining all entity category data in the multi-level intention knowledge base;
[0109] Step 502, sequentially taking each entity category data in the all entity category data as a search term to search for the synonyms corresponding to the each entity category data from the entity synonym dictionary;
[0110] Step 503, counting the number of synonyms corresponding to the each entity category data;
[0111] Step 504, if the current entity category data does not have corresponding synonyms, taking the current entity category data as the key data in the key-value pair and taking NULL as the value data;
[0112] If the number of synonyms corresponding to the current entity category data is 1, the current entity category data is taken as the key data in the key-value pair, and the synonym is taken as the value data.
[0113] Taking the entity category "compulsory insurance" as an example, assuming that there is a synonym "traffic compulsory liability insurance" for "compulsory insurance", and "compulsory insurance" is the current entity category data, the key-value pair format data ["compulsory insurance":"traffic compulsory liability insurance"] is constructed, wherein "compulsory insurance" is the key data, i.e. the key name, and "traffic compulsory liability insurance" is the value data, i.e. the key value.
[0114] If the number of synonyms corresponding to the current entity category data is N, the current entity category data is taken as the key data in the key-value pair, and all synonyms corresponding to the current entity category data are obtained, the enumeration format data is constructed based on the all synonyms, and the constructed enumeration format data is taken as the value data, wherein N is a positive integer greater than 1.
[0115] Similarly, taking "customer service" as an example, the synonyms of "customer service" contained in the synonym dictionary are "agent", "customer service staff" and "customer service personnel". First, the enumeration value ["agent", "customer service staff", "customer service personnel"] is generated in the form of enumeration, and "customer service" is the current entity category data. The key-value pair format data ["customer service":"agent", "customer service staff", "customer service personnel"] is constructed, wherein "customer service" is the key data, i.e. the key name, and "agent", "customer service staff" and "customer service personnel" are the value data, i.e. the key value.
[0116] By pre-setting the entity category synonym dictionary and the key-value pair format to arrange synonyms, the entity category data in the multi-level intent knowledge base can be managed, and the synonymous entities can also be managed.
[0117] In step 205, the finally generated target data structure and the key-value pair are displayed to the preset front-end management interface, and the preliminary management of the multi-level intent knowledge base is completed.
[0118] In the embodiment, after the step of displaying the finally generated target data structure and the key-value pair to the preset front-end management interface is performed, the method further comprises: receiving, based on a preset receiving component, text data input by a user and to be subjected to intent analysis; sequentially predicting, according to a preset category classification prediction model, a behavior category, an attribute category, an entity category and an intent label corresponding to the text data; determining whether the entity category is mapped in the target data structure; if the entity category is mapped in the target data structure, sequentially obtaining prompt dialogues corresponding to the behavior category, the attribute category, the entity category and the intent label respectively according to a mapping level of the target data structure; if the entity category is not mapped in the target data structure, identifying, according to the recorded key-value pair format data and the entity category, whether the entity category has a synonym; if there is no synonym, sequentially obtaining prompt dialogues corresponding to the behavior category, the attribute category and the intent label respectively according to the mapping level of the target data structure; if there is a synonym, sequentially obtaining prompt dialogues corresponding to the behavior category, the attribute category, the synonym and the intent label respectively according to the mapping level of the target data structure; and verifying, according to a preset verification component, correctness of the obtained prompt dialogues.
[0119] In the embodiment, the category classification prediction model can be an artificial intelligence model, which can at least predict a behavior category, an attribute category and an intent label corresponding to input text data of a user in the multi-level intent knowledge base according to the input text data.
[0120] Through the target structure data arranged after the preliminary management, intent prediction is performed on new text data input by a user, and prompt dialogues are sequentially provided according to a “behavior-attribute-entity-intent label” level. During the process, a synonym of an entity category is obtained in a key-value pair format to avoid that the predicted entity category is not displayed in the target data structure, and prompt dialogues corresponding to the synonym of the entity category are obtained as prompt dialogues corresponding to the entity category. Furthermore, if the entity category is not in the target data structure and has no synonym, prompt dialogues are sequentially provided according to a “behavior-attribute-intent label” level, so that relevant prompt dialogues can be screened out with the greatest possibility.
[0121] In the embodiment, the step of verifying the correctness of the obtained prompt dialogue according to the preset verification component specifically comprises: comparing the prompt dialogue with a preset correct result reference table, and judging whether the prompt dialogue is an expected output prompt dialogue according to the comparison result. In the embodiment, after the step of judging whether the prompt dialogue is an expected output prompt dialogue, the method further comprises: if the prompt dialogue is an expected output prompt dialogue, no adjustment is needed for the target data structure; and if the prompt dialogue is not an expected output prompt dialogue, the target data structure is optimized according to a preset tuning mechanism.
[0122] In the embodiment, the step of optimizing the target data structure according to the preset tuning mechanism specifically comprises: if the prompt dialogue is not an expected output prompt dialogue and the error dialogue is a prompt dialogue corresponding to the behavior category data, the behavior category data classification information in the multi-level intent knowledge base is updated and tuned; if the prompt dialogue is not an expected output prompt dialogue and the error dialogue is a prompt dialogue corresponding to the attribute category data, the attribute category data classification information in the multi-level intent knowledge base is updated and tuned; and if the prompt dialogue is not an expected output prompt dialogue and the error dialogue is a prompt dialogue corresponding to the entity category data or the intent label data, the target structure data and the synonym dictionary are updated and tuned.
[0123] The correctness of the prompt dialogue is ensured to be updated in time by judging whether the multi-level intent knowledge base needs to be tuned according to the output prompt dialogue.
[0124] The application obtains behavior category data, attribute category data, entity category data and intent label data in a multi-level intent knowledge base, maps the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule, obtains a preset prompt dialogue, and inserts the prompt dialogue into a reserved position in the target data structure according to a preset association relationship. Different entity category data in the target data structure is respectively provided with a corresponding synonym according to a preset entity synonym dictionary, and the entity category data and the synonym are recorded in a key-value pair format. The finally generated target data structure and the key-value pair are displayed to a preset front-end management interface, and preliminary management of the multi-level intent knowledge base is completed. After the intent is represented in a structured manner, the intent expression is more generalized in a hierarchical manner, which can reduce the update frequency of the intent knowledge base and reduce the difficulty of intent management. After the hierarchical intent structure is adopted, the total number of categories can be reduced, the difficulty of model classification can be reduced, and the user intent can be more accurately recognized in combination with the entity extraction mode, and the corresponding prompt dialogue is provided.
[0125] The embodiment of the application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is the use of digital computers or computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0126] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0127] In the embodiment of the application, after the intent is represented in a structured manner, the hierarchical expression of the intent is more generalized, which can reduce the update frequency of the intent knowledge base and reduce the difficulty of intent management. After adopting the hierarchical intent structure, the total number of categories can be reduced, and the difficulty of model classification can be reduced. In combination with the entity extraction method, the user intent can be more accurately identified, and the corresponding prompt technique can be provided.
[0128] Further reference Figure 6 , as an implementation of the method shown in Figure 2 , the application provides an embodiment of a multi-level intent knowledge base management device. The device embodiment corresponds to the method embodiment shown in Figure 2 , and the device can be applied to various electronic devices.
[0129] As shown in Figure 6 , the multi-level intent knowledge base management device 600 described in the embodiment includes a data acquisition module 601, a data structuring module 602, a prompt technique insertion module 603, a synonym setting module 604, and a management page display module 605. Among them:
[0130] The data acquisition module 601 is configured to acquire behavior category data, attribute category data, entity category data, and intent label data in the multi-level intent knowledge base.
[0131] The data structuring module 602 is configured to map the behavior category data, the attribute category data, the entity category data, and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule.
[0132] The prompt technique insertion module 603 is configured to acquire a preset prompt technique, and insert the prompt technique into a reserved position in the target data structure according to a preset association relationship.
[0133] The synonym setting module 604 is configured to set corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and record the entity category data and the synonyms in a key-value pair format.
[0134] The management page display module 605 is configured to display the finally generated target data structure and the key-value pair to a preset front-end management interface, and complete preliminary management of the multi-level intent knowledge base.
[0135] In some specific embodiments of the present application, the multi-level intent knowledge base management apparatus 600 further comprises a prompt script acquisition module. The prompt script acquisition module is configured to receive text data to be analyzed for intent based on a preset receiving component; further configured to sequentially predict a behavior category, an attribute category, an entity category and an intent label corresponding to the text data according to a preset category classification prediction model; further configured to determine whether the entity category is mapped in the target data structure; further configured to, if the entity category is mapped in the target data structure, sequentially acquire prompt scripts corresponding to the behavior category, the attribute category, the entity category and the intent label according to a mapping level of the target data structure; further configured to, if the entity category is not mapped in the target data structure, identify whether the entity category has synonyms according to the recorded key-value pair format data and the entity category; further configured to, if there is no synonym, sequentially acquire prompt scripts corresponding to the behavior category, the attribute category and the intent label according to the mapping level of the target data structure; and further configured to, if there is a synonym, sequentially acquire prompt scripts corresponding to the behavior category, the attribute category, the synonym and the intent label according to the mapping level of the target data structure.
[0136] In some specific embodiments of the present application, the multi-level intent knowledge base management apparatus 600 further comprises a prompt script verification and judgment module. The prompt script verification and judgment module is configured to verify the correctness of the acquired prompt script according to a preset verification component. Specifically, the prompt script is compared with a preset correct result reference table, and according to the comparison result, it is determined whether the prompt script is a prompt script output as expected. If the prompt script is a prompt script output as expected, the target data structure does not need to be adjusted. If the prompt script is not a prompt script output as expected, the target data structure is optimized according to a preset tuning mechanism.
[0137] In some specific embodiments of the present application, the multi-level intent knowledge base management device 600 further comprises an optimization updating submodule, which is configured to update and optimize the behavior category data classification information in the multi-level intent knowledge base if the prompt phrase is not the expected output prompt phrase and the error phrase is the prompt phrase corresponding to the behavior category data; is configured to update and optimize the attribute category data classification information in the multi-level intent knowledge base if the prompt phrase is not the expected output prompt phrase and the error phrase is the prompt phrase corresponding to the attribute category data; and is configured to update and optimize the target structure data and the synonym dictionary if the prompt phrase is not the expected output prompt phrase and the error phrase is the prompt phrase corresponding to the entity category data and the intent label data.
[0138] The present application obtains the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base, maps the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule, obtains a preset prompt phrase, and inserts the prompt phrase into a reserved position in the target data structure according to a preset association relationship; sets corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and records the entity category data and the synonyms in a key-value pair format; and displays the finally generated target data structure and the key-value pair to a preset front-end management interface, thereby completing the preliminary management of the multi-level intent knowledge base. After the intent data is represented in a structured manner, the hierarchical expression of the intent is more generalized, which can reduce the update frequency of the intent knowledge base and reduce the difficulty of intent management. After the hierarchical intent structure is adopted, the total number of categories can be reduced, the difficulty of model classification can be reduced, and the user intent can be more accurately identified in combination with the entity extraction mode, thereby providing corresponding prompt phrases.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by computer readable instructions instructing related hardware, and the computer readable instructions can be stored in a computer readable storage medium. When the program is executed, the processes of the above-mentioned embodiments can be included. The storage medium can be a non-volatile storage medium such as a magnetic disc, an optical disc, a read-only memory (ROM), or a random access memory (RAM).
[0140] It should be understood that although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless explicitly stated herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0141] To solve the above technical problems, the embodiments of the present application further provide a computer device. For details, please refer to Figure 7 , Figure 7 The basic structure block diagram of the computer device of the present embodiment is shown in FIG. 7.
[0142] The computer device 7 includes a memory 7a, a processor 7b, and a network interface 7c, which are connected to each other through a system bus. It should be noted that only the computer device 7 with components 7a-7c is shown in the figure, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0143] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and other computing devices. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and other means.
[0144] The memory 7a includes at least one type of readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 7a can be an internal storage unit of the computer device 7, such as a hard disk or a memory of the computer device 7. In other embodiments, the memory 7a can also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 7. Of course, the memory 7a can also include both an internal storage unit and an external storage device of the computer device 7. In this embodiment, the memory 7a is generally used to store an operating system and various application software installed on the computer device 7, such as computer readable instructions of the multi-level intent knowledge base management method, etc. In addition, the memory 7a can also be used to temporarily store various data that have been output or will be output.
[0145] The processor 7b can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 7b is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 7b is used to run computer readable instructions or process data stored in the memory 7a, such as computer readable instructions of the multi-level intent knowledge base management method.
[0146] The network interface 7c can include a wireless network interface or a wired network interface, which is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0147] The computer device provided in the embodiment belongs to the technical field of data processing. The application obtains behavior category data, attribute category data, entity category data and intention label data in a multi-level intention knowledge base; maps the behavior category data, the attribute category data, the entity category data and the intention label data in the multi-level intention knowledge base into a target data structure according to a preset mapping rule; obtains a preset prompt phrase, and inserts the prompt phrase into a reserved position in the target data structure according to a preset association relationship; sets corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and records the entity category data and the synonyms in a key-value pair format; and displays the finally generated target data structure and the key-value pair to a preset front-end management interface, to complete preliminary management of the multi-level intention knowledge base. After the intention is represented in a structured manner, the intention expression is more generalized in a hierarchical manner, the intention knowledge base update frequency can be reduced, and the intention management difficulty can be reduced. After the hierarchical intention structure is adopted, the total number of categories can be reduced, the model classification difficulty can be reduced, and the user intention can be more accurately recognized in combination with the entity extraction mode, to provide corresponding prompt phrases.
[0148] The application also provides another implementation, namely providing a computer readable storage medium storing computer readable instructions, which can be executed by a processor to make the processor execute the steps of the multi-level intention knowledge base management method as described above.
[0149] The computer readable storage medium provided in the embodiment belongs to the technical field of data processing. The application obtains behavior category data, attribute category data, entity category data and intention label data in a multi-level intention knowledge base; maps the behavior category data, the attribute category data, the entity category data and the intention label data in the multi-level intention knowledge base into a target data structure according to a preset mapping rule; obtains a preset prompt phrase, and inserts the prompt phrase into a reserved position in the target data structure according to a preset association relationship; sets corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and records the entity category data and the synonyms in a key-value pair format; and displays the finally generated target data structure and the key-value pair to a preset front-end management interface, to complete preliminary management of the multi-level intention knowledge base. After the intention is represented in a structured manner, the intention expression is more generalized in a hierarchical manner, the intention knowledge base update frequency can be reduced, and the intention management difficulty can be reduced. After the hierarchical intention structure is adopted, the total number of categories can be reduced, the model classification difficulty can be reduced, and the user intention can be more accurately recognized in combination with the entity extraction mode, to provide corresponding prompt phrases.
[0150] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method described in each embodiment of the present application.
[0151] Obviously, the above-described embodiments are only some of the embodiments of the present application, not all the embodiments, and the drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some of the technical features. Any equivalent structure made by using the content of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A multi-level intent knowledge base management method, characterized by, The method comprises the following steps: obtaining behavior category data, attribute category data, entity category data and intent label data in a multi-level intent knowledge base; mapping the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule, wherein the target data structure is specifically a JSON multi-layer nested data format, and the step of mapping the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule specifically comprises: obtaining target behavior category data according to a distinguishing mark corresponding to the behavior category data, and setting the target behavior category data as outermost data in the JSON multi-layer nested data format; obtaining target attribute category data according to a distinguishing mark corresponding to the attribute category data, and setting the target attribute category data as next-outermost data in the JSON multi-layer nested data format; obtaining target entity category data according to a distinguishing mark corresponding to the entity category data, and setting the target entity category data as next-innermost data in the JSON multi-layer nested data format; obtaining target intent label data according to a distinguishing mark corresponding to the intent label data, and setting the target intent label data as innermost data in the JSON multi-layer nested data format; obtaining a preset prompt phrase, and inserting the prompt phrase into a reserved position in the target data structure according to a preset association relationship; setting corresponding synonyms for different entity category data in the target data structure according to a preset entity synonym dictionary, and recording the entity category data and the synonyms in a key-value pair format; displaying the finally generated target data structure and the key-value pair to a preset front-end management interface, and completing preliminary management of the multi-level intent knowledge base.
2. The multi-tiered intent knowledge base management method of claim 1, wherein, Before the step of mapping the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule, the method further comprises: previously marking the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base in the form of distinguishing marks.
3. The multi-tiered intent knowledge base management method of claim 2, wherein, Before the step of previously marking the behavior category data, attribute category data, entity category data and intent label data in the multi-level intent knowledge base in the form of distinguishing marks, the method further comprises: previously setting a first part of distinguishing fields in the distinguishing marks according to differences in behavior categories, attribute categories, entity categories and intent labels to which target data belongs, wherein the target data is any data in the multi-level intent knowledge base; further setting a second part of distinguishing fields in the distinguishing marks according to differences of the target data in specific categories, wherein the specific categories are any of the behavior categories, attribute categories, entity categories and intent labels; The distinguishing mark is generated according to the first distinguishing field and the second distinguishing field.
4. The multi-tiered intent knowledge base management method of claim 2, wherein, In the process of performing the step of mapping the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule, the method further comprises: A prompt speech insertion position is reserved in advance in each data nesting layer of the JSON multi-layer nested data format; The step of obtaining the preset prompt speech and inserting the prompt speech into the reserved position in the target data structure according to the preset association relationship specifically comprises: According to the association relationship, the data field corresponding to the current prompt speech in the multi-level intent knowledge base is identified; The mapping position information of the data field in the target data structure is identified by taking the data field as a retrieval field and the mapped data in the target data structure as a retrieval domain; According to the mapping position information, the data nesting layer corresponding to the data field in the JSON multi-layer nested data format is determined; The current prompt speech is inserted into the prompt speech insertion position reserved in the data nesting layer, and the insertion of the prompt speech into the target data structure is completed.
5. The multi-tiered intent knowledge base management method of claim 1, wherein, The step of recording the entity category data and the synonym in the key-value pair format specifically comprises: All entity category data in the multi-level intent knowledge base is obtained; Each entity category data in the all entity category data is taken as a retrieval word to retrieve the synonym corresponding to each entity category data from the entity synonym dictionary; The number of synonyms corresponding to each entity category data is counted; If the current entity category data does not have a corresponding synonym, the current entity category data is taken as key data in the key-value pair, and NULL is taken as value data; If the number of synonyms corresponding to the current entity category data is 1, the current entity category data is taken as key data in the key-value pair, and the synonym is taken as value data; If the number of synonyms corresponding to the current entity category data is N, the current entity category data is taken as key data in the key-value pair, all synonyms corresponding to the current entity category data are obtained, and enumeration format data is constructed based on the all synonyms, and the constructed enumeration format data is taken as value data, wherein N is a positive integer greater than 1.
6. The multi-tiered intent knowledge base management method of claim 1, wherein, After performing the step of displaying the finally generated target data structure and the key-value pair to a preset front-end management interface to complete the preliminary management of the multi-level intent knowledge base, the method further comprises: Based on a preset receiving component, receiving text data to be analyzed for intent by a user; According to a preset category classification prediction model, the behavior category, the attribute category, the entity category and the intent label corresponding to the text data are predicted in sequence; It is judged whether the entity category is mapped in the target data structure; If the entity category is mapped in the target data structure, the prompt utterances corresponding to the behavior category, the attribute category, the entity category and the intent label are obtained in sequence according to the mapping level of the target data structure; If the entity category is not mapped in the target data structure, whether the entity category has a synonym is identified according to the recorded key-value pair format data and the entity category; If there is no synonym, the prompt utterances corresponding to the behavior category, the attribute category and the intent label are obtained in sequence according to the mapping level of the target data structure; If there is a synonym, the prompt utterances corresponding to the behavior category, the attribute category, the synonym and the intent label are obtained in sequence according to the mapping level of the target data structure; The correctness of the obtained prompt utterance is verified according to a preset verification component.
7. The multi-tiered intent knowledge base management method of claim 6, wherein, The step of verifying the correctness of the obtained prompt utterance according to the preset verification component specifically includes: Comparing the prompt utterance with a preset correct result reference table, and judging whether the prompt utterance is an expected output prompt utterance according to the comparison result; After the step of judging whether the prompt utterance is an expected output prompt utterance, the method further includes: If the prompt utterance is an expected output prompt utterance, the target data structure does not need to be adjusted; If the prompt utterance is not an expected output prompt utterance, the target data structure is optimized according to a preset tuning mechanism.
8. A multi-level intent knowledge base management apparatus, characterized by comprising: It includes: A data acquisition module is configured to acquire behavior category data, attribute category data, entity category data and intent label data in a multi-level intent knowledge base; A data structuring module is configured to map the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into a target data structure according to a preset mapping rule, wherein the target data structure is specifically a JSON multi-layer nested data format, and the step of mapping the behavior category data, the attribute category data, the entity category data and the intent label data in the multi-level intent knowledge base into the target data structure according to the preset mapping rule specifically includes: According to the distinguishing mark corresponding to the behavior category data, target behavior category data is obtained, and the target behavior category data is set as the outermost data of the JSON multi-layer nested data format; According to the distinguishing mark corresponding to the attribute category data, target attribute category data is obtained, and the target attribute category data is set as the next outer layer data of the JSON multi-layer nested data format; According to the distinguishing mark corresponding to the entity category data, target entity category data is obtained, and the target entity category data is set as the next inner layer data of the JSON multi-layer nested data format; According to the distinguishing mark corresponding to the intent label data, target intent label data is obtained, and the target intent label data is set as the innermost data of the JSON multi-layer nested data format; The prompt dialogue insertion module is configured to obtain a preset prompt dialogue and insert the prompt dialogue into a reserved position in the target data structure according to a preset association relationship; The synonym setting module is configured to set corresponding synonyms for different entity category data in the target data structure according to a preset entity category synonym dictionary, and record the entity category data and the synonyms in a key-value pair format; The management page display module is configured to display the finally generated target data structure and the key-value pair to a preset front-end management interface, and complete preliminary management of the multi-level intent knowledge base. 9.A computer device, comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the steps of the multi-level intent knowledge base management method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to implement the steps of the multi-level intent knowledge base management method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Man-machine interaction question-answering method and system based on complex intention intelligent identification
CN111708874A
Visual editing and persistence implementation method and system for knowledge graph
CN114491073A