A data processing method and apparatus
By constructing a question classification system with a multi-level semantic expression layer and an automatic question generalization expression model library, the problems of low efficiency and high cost of question generalization expression in intelligent question answering systems are solved, and efficient and low-cost question matching and answer output are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2023-09-04
- Publication Date
- 2026-04-14
AI Technical Summary
Existing intelligent question answering systems suffer from low configuration efficiency and high manual costs in generalizing question expressions, making it difficult to adapt to diverse user questions.
A question classification system with a multi-level semantic expression layer is constructed. A question generalization expression model library is automatically generated through the question classification model. The question classification system is optimized by combining sample questions to achieve automatic generation and rapid updating of question generalization expressions.
It improves the configuration efficiency of question generalization expression, reduces manual costs, and enhances the accuracy and reliability of question matching, making it suitable for various business scenarios.
Smart Images

Figure CN117171321B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a data processing method and apparatus. Background Technology
[0002] With the rapid development of internet and artificial intelligence technologies, intelligent question answering is widely used in customer service, online education platforms, healthcare, financial institutions, and other fields. It can avoid waiting time for human customer service responses, quickly answer user questions, and improve user satisfaction, playing an increasingly important role in improving user experience and information retrieval. In the current field of intelligent question answering, a set of generalized question expressions is typically pre-configured, and a corresponding answer is assigned to each generalized expression. Upon receiving a user's question, the question answering engine first matches the corresponding generalized expression based on the user's question, and then outputs the answer for that generalized expression.
[0003] Currently, question answering engines all construct generalized expression of questions through manual configuration, which has technical problems such as low configuration efficiency and high manual cost. Summary of the Invention
[0004] This application provides a data processing method and apparatus to improve the efficiency of constructing generalized expression of questions and reduce labor costs.
[0005] The data collection, dissemination, and use in this application all comply with relevant national laws and regulations.
[0006] Firstly, this application provides a data processing method that can be applied to electronic devices with processing capabilities, such as intelligent robots and smart screens. The method includes:
[0007] A question classification system is constructed, comprising a multi-level semantic expression layer. Each level of the multi-level semantic expression layer contains multiple semantic expression types. Each higher-level semantic expression type is associated with at least one lower-level semantic expression type, and the multi-level associated semantic expression types form an association path. Each association path corresponds to a combination of multiple entity types and attribute types. An initial question generalization expression model library is constructed based on the question classification system. The initial question generalization expression model library includes multiple semantic expression classification results, and each semantic expression classification result corresponds to an association path in the question classification system. Question generalization expressions are added to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, resulting in the constructed question generalization expression model library.
[0008] In this method, the electronic device first constructs a question classification system, then constructs an initial question generalization expression model library based on the question classification system, and finally adds question generalization expressions to each semantic expression classification result in the initial question generalization expression model library using sample questions in the question library, thus obtaining the constructed question generalization expression model library (i.e., the question generalization expression set). This method enables the automatic generation of question generalization expressions, which not only saves human resources and reduces costs, but also improves the efficiency of constructing question generalization expressions.
[0009] Secondly, the question classification system in this method includes a multi-level semantic expression layer and a combination set of entity types and attribute types (the combination set of entity types and attribute types refers to a set composed of multiple entity types and attribute types). The question generalization expression model library is built based on this question classification system. For each possible user question, it can match the multi-level semantic expression layer, entity type, and attribute type. Therefore, the constructed question generalization expression model library has good versatility and scenario coverage, and can be applied to various business scenarios.
[0010] In addition, the question generalization expression model library is filled with question generalization expressions according to the question classification system, which facilitates the matching of question generalization expressions in the question generalization expression model library for user questions.
[0011] Optionally, the question classification system may also include: a multi-level semantic expression layer consisting of a three-level semantic expression layer;
[0012] The first-level semantic expression layer in the three-level semantic expression layer includes multiple semantic expression types such as definition, operation, and others. Of course, the above is just an example and is not limited to this.
[0013] Optionally, the second-level semantic expression layer in the three-level semantic expression layer includes at least one of the following semantic expression types: concept, scope, process, comparison, time, case, fee, judgment, account operation, password operation, card operation, file operation, business operation, general operation, navigation, and creation. Of course, the above are just examples and are not limited to these.
[0014] Optionally, the third-level semantic expression layer in the three-level semantic expression layer includes multiple semantic expression types such as: name, goal, meaning, introduction, domain, customer, organization, channel, type, matter, responsibility, rule, purpose, characteristic, requirement, feature, content, advantage, mechanism, region, object, rule, principle, condition, material, effective, definition, standard, clause, precaution, interest calculation rule, policy, method, reason, function, package, role, link, step, difference, connection, relationship, comparison, term, validity period, typical case, success case, failure case, plan, tariff standard, handling fee, interest rate, service fee, affirmative, negative, whether, register, log in, cancel, change password, open account, initial password, reset password, create card, report lost, replace card, cancel card, download, upload, continue download, print, copy, apply, refund, charge, pay, activate, calculate, process, tag, enter into inventory, sign contract, cancel, activate, associate, marketing, maintain, query, create, modify, delete, and configure at least one of these. Of course, the above are just examples and are not limited to this.
[0015] Optional entity types include one or more of the following: business, system, channel, user, product, account, time, location, organization, age, amount, number, mobile number, and other entities. Of course, these are just examples and are not exhaustive.
[0016] Optionally, attribute types include one or more of the following: general attributes, verb attributes, and other attributes. Of course, the above are just examples and are not limited to these.
[0017] Optionally, based on sample questions in the question database, a question generalization expression is added to each semantic expression classification result in the initial question generalization expression model library. This includes: extracting semantic expression keywords, entity keywords, and attribute keywords corresponding to each sample question in the question database; inputting the semantic expression keywords corresponding to each sample question into the question classification model; the input of the question classification model is the semantic expression keywords of the question, and the output is at least one semantic expression classification result corresponding to the question in the question generalization expression model library; if the question classification model outputs the semantic expression classification result of any sample question, after determining that the combination of entity keywords and attribute keywords of any sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of any sample question are combined and instantiated to form the question generalization expression corresponding to the semantic expression classification result of any sample question; and / or, if the question classification model does not output the semantic expression classification result of any sample question, then at least one of the question classification system, the question generalization expression model library, and the question classification model is optimized based on the semantic expression keywords of any sample question.
[0018] In this approach, question generalization expressions are added to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, resulting in a constructed question generalization expression model library. Furthermore, the question classification system, question generalization expression model library, and question classification model are optimized and updated based on sample questions for which no classification results have been obtained, enabling rapid updates to the question generalization expression model library and question classification system.
[0019] Optionally, the method also includes setting a corresponding answer for each question generalization expression in the constructed question generalization expression model library.
[0020] One method for setting corresponding answers is to add the corresponding answer for each question generalization expression to the pre-built question generalization expression model library; or,
[0021] Construct a question-answer library, where each answer corresponds to a question generalization expression in the constructed question generalization expression model library.
[0022] Optionally, the method further includes: obtaining user questions; extracting semantic expression keywords from user questions; inputting the semantic expression keywords from user questions into a question classification model to obtain at least one semantic expression classification result; determining at least one question generalization expression corresponding to the at least one semantic expression classification result from a pre-constructed question generalization expression model library; and outputting the answer to user questions based on the answer corresponding to the at least one question generalization expression.
[0023] In this approach, the semantic expression keywords of user questions are used to obtain the semantic expression classification of user questions based on a question classification model. The generalized expression of user questions is obtained from a pre-built question generalization expression model library to match the answers to user questions. This can meet the requirement that answers can be matched even if users ask questions in different ways, thus improving the reliability of this solution.
[0024] Optionally, if at least one question generalization expression is expressed as multiple question generalization expressions, then based on the answers corresponding to the at least one question generalization expression, the answer to the user question is output, including: inputting the multiple question generalization expressions and the user question into a similarity model, and determining the first question generalization expression with the highest similarity to the user question among the multiple question generalization expressions based on the output of the similarity model; wherein, the similarity model is trained based on sample questions in the question library and question generalization expressions in the constructed question generalization expression model library; calculating the matching degree between each question generalization expression and the user question, and determining the second question generalization expression with the highest matching degree; calculating the matching degree between the combination of entity keywords and attribute keywords in the user question and the combination of entity types and attribute types in each question generalization expression, and determining the third question generalization expression with the highest matching degree; and determining the answer to the user question based on the first question generalization expression, the second question generalization expression, and the third question generalization expression.
[0025] In this approach, three question-answer matching calculation methods are employed. By incorporating a question classification system and question generalization expression factors into the matching calculation methods, the accuracy and reliability of answer matching are improved.
[0026] Optionally, the answer to the user's question is determined based on the generalized expressions of the first, second, and third questions, including: if the answers of at least two of the generalized expressions of the first, second, and third questions are the same, then the answers corresponding to the at least two generalized expressions are taken as the answer to the user's question; if the answers corresponding to the generalized expressions of the first, second, and third questions are different, then the answer corresponding to the generalized expression of the third question is taken as the answer to the user's question.
[0027] In this method, the answer is determined according to the voting mode based on the result of matching the three types of questions and answers, and the priority of the answers is set, which improves the reliability of answer matching.
[0028] Optionally, when constructing the question classification system, the method further includes: extracting semantic expression keywords, entity keywords, and attribute keywords from each sample question in the question database to form a preliminary question classification system; training a combination of entity type and attribute type for each association path of semantic expression; constructing and training a question classification model based on the semantic expression keywords of each sample question; and optimizing the preliminary question classification system based on the question classification model to obtain the constructed question classification system.
[0029] In this approach, the question classification system is optimized based on the question training model using individual sample questions from the question database. This enables automatic optimization and updating of the question classification system, improving the efficiency of constructing the system and reducing costs.
[0030] Optionally, a question classification model can be trained based on the semantic keywords of each sample, including:
[0031] If the question classification model outputs a single classification result for any sample question, then it matches the entity keywords and attribute keywords of any sample question with combinations of multiple entity types and attribute types under the semantic expression classification result of that sample question. If a matching result exists, the semantic expression classification result of that sample question is output; if no matching result exists, the combination of entity keywords and attribute keywords of any sample question is added to the combination of multiple entity types and attribute types under the semantic expression classification result of that sample question. If the question classification model outputs an empty classification result for any sample question, then the semantic expression keywords, entity keywords, and attribute keywords of any sample question are respectively added to the corresponding multi-level semantic table in the initial question classification system. In the context of layer, entity type, and attribute type; if the question classification model outputs multiple classification results for any sample question, then when the semantic expression keyword of any sample question corresponds to a unique semantic expression type in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the semantic expression type of the semantic expression keyword of any sample question in the last level of the multi-level semantic expression layer; and / or, when the semantic expression keyword of any sample question corresponds to multiple semantic expression types in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the preset semantic expression type priority of the first level of the multi-level semantic expression layer.
[0032] In this approach, a question classification model is trained based on the semantic keywords of each sample question in the question database. A classification conflict resolution strategy is set to address the conflict that occurs when a single sample question appears in multiple categories during the question classification process. The question classification model is then optimized, which improves the reliability of this approach.
[0033] Secondly, this application provides a data processing apparatus, comprising: a construction module for constructing a question classification system, the question classification system including a multi-level semantic expression layer, each level of the multi-level semantic expression layer containing multiple semantic expression types, each upper-level semantic expression type being associated with at least one lower-level semantic expression type, and the multi-level associated semantic expression types forming an association path; each association path corresponding to a combination of multiple entity types and attribute types; the construction module is further configured to construct an initial question generalization expression model library based on the question classification system, the initial question generalization expression model library including multiple semantic expression classification results, each of the multiple semantic expression classification results corresponding to an association path in the question classification system; and a filling module for adding question generalization expressions to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, thereby obtaining the constructed question generalization expression model library.
[0034] Optionally, the multi-level semantic expression layer is a three-level semantic expression layer; wherein, the multiple semantic expression types of the first-level semantic expression layer in the three-level semantic expression layer include: definition, operation and others.
[0035] Optionally, when the filling module adds a question generalization expression to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, it specifically performs the following: extracting the semantic expression keywords, entity keywords, and attribute keywords corresponding to each sample question in the question library; inputting the semantic expression keywords corresponding to each sample question into the question classification model; the input of the question classification model is the semantic expression keywords of the question, and the output is at least one semantic expression classification result corresponding to the question in the question generalization expression model library; if the question classification model outputs the semantic expression classification result of any sample question, after determining that the combination of entity keywords and attribute keywords of any sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of any sample question are combined and instantiated to form the question generalization expression corresponding to the semantic expression classification result of any sample question; and / or, if the question classification model does not output the semantic expression classification result of any sample question, then at least one of the question classification system, the question generalization expression model library, and the question classification model is optimized based on the semantic expression keywords of any sample question.
[0036] Optionally, the construction module is also used to: set corresponding answers for each question generalization expression in the constructed question generalization expression model library. The methods for setting corresponding answers include: adding the corresponding answer for each question generalization expression in the constructed question generalization expression model library; or, constructing a question answer library where the answers correspond to each question generalization expression in the constructed question generalization expression model library.
[0037] Optionally, the data processing device further includes: an acquisition module for acquiring user questions; a matching module for extracting semantic expression keywords of user questions; inputting the semantic expression keywords of user questions into a question classification model to obtain at least one semantic expression classification result; determining at least one question generalization expression corresponding to the at least one semantic expression classification result from a pre-constructed question generalization expression model library; and outputting the answer to the user question based on the answer corresponding to the at least one question generalization expression.
[0038] Optionally, if at least one question generalization is expressed as multiple question generalizations, the matching module, when outputting the answer to the user question based on the answer corresponding to the at least one question generalization, further includes: inputting the multiple question generalizations and the user question into a similarity model; determining the first question generalization with the highest similarity to the user question based on the output of the similarity model; wherein, the similarity model is trained based on sample questions in the question library and question generalizations in the constructed question generalization model library; calculating the matching degree between each question generalization and the user question to determine the second question generalization with the highest matching degree; calculating the matching degree between the combination of entity keywords and attribute keywords in the user question and the combination of entity types and attribute types in each question generalization to determine the third question generalization with the highest matching degree; and determining the answer to the user question based on the first, second, and third question generalizations.
[0039] Optionally, when determining the answer to a user's question based on the generalized expressions of the first, second, and third questions, the matching module is further configured to: if the answers to at least two of the generalized expressions of the first, second, and third questions are the same, then the answers corresponding to the at least two generalized expressions are taken as the answer to the user's question; if the answers corresponding to the generalized expressions of the first, second, and third questions are different, then the answer corresponding to the generalized expression of the third question is taken as the answer to the user's question.
[0040] Optionally, when constructing the question classification system, the construction module is also used to: extract semantic expression keywords, entity keywords, and attribute keywords from each sample question in the question library to form a preliminary question classification system; train the combination of entity type and attribute type for each association path of semantic expression; construct and train a question classification model based on the semantic expression keywords of each sample question; and optimize the preliminary question classification system based on the question classification model to obtain the constructed question classification system.
[0041] Optionally, when training the question classification model based on the semantic expression keywords of each sample, the construction module is also used to: if the question classification model outputs a single classification result for any sample question, then match the entity keywords and attribute keywords of any sample question with combinations of multiple entity types and attribute types under the semantic expression classification result of any sample question; if a matching result exists, then output the semantic expression classification result of any sample question; if a matching result does not exist, then add the combination of entity keywords and attribute keywords of any sample question to the combinations of multiple entity types and attribute types under the semantic expression classification result of any sample question; if the question classification model outputs an empty classification result for any sample question, then supplement the semantic expression keywords, entity keywords, and attribute keywords of any sample question into the multiple entity types and attribute types under the semantic expression classification result of any sample question respectively. In the initial question classification system, the corresponding multi-level semantic expression layer, entity type, and attribute type are considered. If the question classification model outputs multiple classification results for any sample question, then when the semantic expression keyword of any sample question corresponds to a unique semantic expression type in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the semantic expression type of the semantic expression keyword in the last level of the multi-level semantic expression layer. And / or, when the semantic expression keyword of any sample question corresponds to multiple semantic expression types in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the preset priority of the semantic expression type in the first level of the multi-level semantic expression layer.
[0042] Thirdly, this application provides an electronic device including at least one processor, which, when executing a computer program stored in a memory, implements a method as described in the first aspect or any optional embodiment of the first aspect.
[0043] Fourthly, this application provides a computer-readable storage medium for storing instructions that, when executed, cause a method as described in the first aspect or any of the optional embodiments of the first aspect to be implemented.
[0044] Fifthly, this application provides a computer program product, including computer program code, which, when run on a computer, causes the method as described in the first aspect or any optional implementation of the first aspect to be implemented. The technical effects or advantages of one or more technical solutions provided in the second, third, fourth, and fifth aspects of this application can all be explained by corresponding technical effects or advantages of one or more technical solutions provided in the first aspect. Attached Figure Description
[0045] Figure 1A flowchart illustrating a data processing method provided in an embodiment of this application;
[0046] Figure 2 A flowchart illustrating a method for constructing a question classification system provided in this application embodiment;
[0047] Figure 3 A flowchart illustrating a user question answer matching method provided in this application embodiment;
[0048] Figure 4 A structural diagram of a data processing apparatus provided in an embodiment of this application;
[0049] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The technical solution of this application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of this application, and not limitations thereof. Unless otherwise specified, "multiple" in the description of the embodiments of this application refers to two or more. The term "and / or" in the embodiments of this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. In addition, the character " / " in this application generally indicates that the objects before and after are in an "or" relationship, and the character "→" indicates an association relationship.
[0051] The technical solution provided in this application is used to solve problems such as how to automatically generate generalized expression of questions and improve the accuracy of answer matching, thereby improving the configuration efficiency of generalized expression of questions, reducing labor costs, improving the accuracy of answer output, and improving user experience.
[0052] The embodiments of this application can be applied to various intelligent question-answering scenarios. For example, including but not limited to: financial customer service, shopping mall guides, hospital navigation, virtual customer service, digital humans, etc.
[0053] See Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application. The executing entity of this method can be any electronic device with processing capabilities, such as a smart robot, a smart screen, or a smart network platform. The method includes steps S101 to S103:
[0054] S101. Construct a question classification system, wherein the question classification system includes a multi-level semantic expression layer, each level of the multi-level semantic expression layer contains multiple semantic expression types, each upper-level semantic expression type is associated with at least one lower-level semantic expression type, and the multi-level associated semantic expression types form an association path; each association path corresponds to a combination of multiple entity types and attribute types.
[0055] Taking a three-level semantic expression layer as an example: the first-level semantic expression layer includes multiple first-level semantic expression types, the second-level semantic expression layer includes multiple second-level semantic expression types, and the third-level semantic expression layer includes multiple third-level semantic expression types; each first-level semantic expression type in the first-level semantic expression layer is associated with at least one second-level semantic expression type in the second-level semantic expression layer, and each second-level semantic expression type in the second-level semantic expression layer is associated with at least one third-level semantic expression type in the third-level semantic expression layer. A first-level semantic expression type, a second-level semantic expression type associated with that first-level semantic expression type, and a third-level semantic expression type associated with that second-level semantic expression type constitute an association path; each association path corresponds to a combination of multiple entity types and attribute types.
[0056] In one possible implementation, the semantic expression type in the first-level semantic expression layer includes one or more of the following: definition, operation, or others.
[0057] In one possible implementation, the semantic expression types in the second-level semantic expression layer include at least one of the following: concept, scope, process, comparison, time, case, fee, judgment, account operation, password operation, card operation, file operation, business operation, general operation, navigation, and creation.
[0058] In one possible implementation, the semantic expression types in the third-level semantic expression layer include at least one of the following: name, target, meaning, introduction, domain, customer, institution, channel, type, matter, responsibility, rule, purpose, characteristic, requirement, feature, content, advantage, mechanism, region, object, rule, principle, condition, material, effective, definition, standard, clause, precaution, interest calculation rule, policy, method, reason, function, package, role, link, step, difference, connection, relationship, comparison, term, validity period, typical case, success case, failure case, plan, tariff standard, handling fee, interest rate, service fee, affirmative, negative, whether, register, log in, cancel, change password, open account, initial password, reset password, create card, report lost, replace card, cancel card, download, upload, continue transmission, print, copy, apply, refund, charge, pay, activate, calculate, process, tag, enter into inventory, sign contract, cancel, activate, associate, marketing, maintain, query, create, modify, delete, and configure.
[0059] For example, Table 1 provides a specific example of a classification system, which is divided into three levels from top to bottom: the first-level semantic expression layer, the second-level semantic expression layer, and the third-level semantic expression layer.
[0060] Table 1. Classification System of Questions
[0061]
[0062]
[0063] It is understood that the specific types in the three-level semantic expression layer in this embodiment can be set according to the application scenario, and this application embodiment does not impose any restrictions.
[0064] This application uses a three-level semantic expression layer as an example, but it is not limited to this. For example, it can also be a two-level or four-level semantic expression layer.
[0065] As an example, Table 2 shows the semantic expression classification of the semantic expression layer and the semantic expression keywords in the user questions under each category.
[0066] Table 2. Semantic Expression Classification and Corresponding Keyword in User Questions
[0067]
[0068] For example, taking Table 2 as an example, if the semantic expression keywords in the user's question include "introduction", then the corresponding semantic expression categories matched are "definition" → "concept" → "introduction"; if the keywords in the user's question include "how" and "execute", then the corresponding semantic expression categories matched are "operation" → "general operation" → "configuration".
[0069] The examples listed above are all feasible cases, and the embodiments of this application are not limited to these.
[0070] In one possible implementation, the type of entity includes one or more of the following: business, system, channel, user, product, account, time, location, organization, age, amount, number, mobile number, and other entities.
[0071] In one possible implementation, the types of attributes in the attribute layer include one or more of the following: general attributes, verb attributes, and other attributes.
[0072] For example, Table 3 provides examples of entity types and their corresponding entity codes.
[0073] Table 3 Entity Types and Their Codes
[0074] Entity type Entity code business biz system sys channel chl user usr product prd Account acc time time Place addr mechanism org age age Amount amt number num Phone number tel Other entities ent_oth
[0075] For example, Table 4 provides examples of attribute types and their corresponding attribute codes.
[0076] Table 4 Attribute Types and Their Codes
[0077] Attribute type Attribute Code General properties prop Other attributes prop_oth Verb attributes prop_v
[0078] It is understood that the above entity keywords and their corresponding entity codes, as well as attribute keywords and their corresponding attribute codes, are only one possible implementation example. Different settings can be made according to the application scenario. This application embodiment does not limit this.
[0079] As an example, based on each of the semantic expression categories mentioned above, combinations of entity keywords and attribute keywords are trained to represent the appropriate questions corresponding to those entity keywords and attribute keywords under that semantic expression category. Table 5 shows the semantic expression categories and their corresponding combinations of entity codes and attribute codes.
[0080] Table 5. Semantic Representation Classification and Corresponding Combinations of Entity and Attribute Codes
[0081]
[0082] For example, taking Table 5 as an example, the entity code and attribute code combination corresponding to the association path of semantic expression classification as "definition" → "scope" → "rule" can be "[#biz]" (that is, the entity type is business and there is no attribute type) and "[#biz][#prop]" (that is, the entity type is business and the attribute type is general attribute).
[0083] The examples listed above are all feasible cases, and the embodiments of this application are not limited to these.
[0084] S102. Construct an initial question generalization expression model library based on the question classification system. The initial question generalization expression model library includes multiple semantic expression classification results. Each of the multiple semantic expression classification results corresponds to an association path in the question classification system.
[0085] It is understandable that the initial question generalization expression model library includes multiple pre-defined association paths formed by combinations of semantic expression types and their associated entity types and attribute types.
[0086] For example, taking Table 1 as an example, a related path in the semantic expression classification can be composed of three levels of semantic expression layers, such as: "definition" → "scope" → "method", or "operation" → "business operation" → "payment", etc.
[0087] A correlation path in semantic expression classification can also be composed of the first and second levels of the three-level semantic expression layer, such as "definition" → "scope".
[0088] S103. Based on the sample questions in the question library, add question generalization expressions to each semantic expression classification result in the initial question generalization expression model library to obtain the constructed question generalization expression model library.
[0089] For example, by adding question generalization expressions to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, a constructed question generalization expression model library can be obtained, which may include:
[0090] Extract semantic keywords, entity keywords, and attribute keywords from each sample question in the question database;
[0091] Input the semantic expression keywords corresponding to each sample question into the question classification model; the input of the question classification model is the semantic expression keywords of the question, and the output is at least one semantic expression classification result of the question in the question generalization expression model library;
[0092] If the question classification model outputs a semantic expression classification result for any sample question, after determining whether the combination of entity keywords and attribute keywords in that sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of that sample question are combined and instantiated to form a generalized expression of the question corresponding to the semantic expression classification result of that sample question; and / or,
[0093] If the question classification model does not output a semantic expression classification result for any sample question, then at least one of the question classification system, question generalization expression model library, and question classification model is optimized based on the semantic expression keywords of the sample question. Then, the semantic expression keywords of the sample question are input into the optimized question classification model, and the semantic expression classification result of the sample question is output. After determining that the combination of entity keywords and attribute keywords of the sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of the sample question are combined and instantiated to form the question generalization expression corresponding to the classification result of the sample question.
[0094] Among them, the question classification model is used to train the generalized expression model of questions, and to classify questions based on the question classification model.
[0095] Questions are classified based on the combination of generalized expressions, entity keywords, and attribute keywords.
[0096] In the specific implementation process, see Figure 2 The flowchart below illustrates a method for constructing a question classification system according to an embodiment of this application. The specific steps of the method are as follows:
[0097] First, a question classification system is constructed by extracting semantic expression keywords, entity keywords, and attribute keywords from each sample question in the question database to form a preliminary question classification system.
[0098] Then, a question classification model is constructed and trained based on the semantic keywords of each sample question:
[0099] If the semantic expression classification model outputs a single semantic expression classification result, then the entity keywords and attribute keywords of each sample question are used to match the combination of multiple entity types and attribute types under that semantic expression classification. If a match is found, the semantic expression classification result is output; otherwise, the combination of entity keywords and attribute keywords of each sample question is added to the combination of multiple entity types and attribute types under that semantic expression classification.
[0100] If the output of the question classification model is empty, then the semantic expression keywords, entity keywords and attribute keywords of each sample question will be added to the corresponding three-level semantic expression layer, entity type and attribute type in the question classification system.
[0101] If the question classification model outputs multiple results for a sample question, then when the semantic expression keyword of the sample question corresponds to a unique semantic expression type in the first-level semantic expression layer, the question classification model will output a classification result for the sample question according to the semantic expression type in the third-level semantic expression layer; and / or, when the semantic expression keyword of the sample question corresponds to multiple semantic expression types in the first-level semantic expression layer, the question classification model will output a classification result for the sample question according to the preset semantic expression type priority in the first-level semantic expression layer.
[0102] The preset priority of semantic expression types is: the semantic expression type of concept class is the lowest priority.
[0103] Finally, the question classification system is optimized based on the new categories that emerge in the training question classification model, forming a standard question classification system.
[0104] For example, combining the question classification system shown in Table 1 above, the entity types and their codes shown in Table 2, and the attribute types and their codes shown in Table 3, Table 6 is an example of a question generalization expression model library.
[0105] Table 6 Examples of Question Generalization Expression Models
[0106]
[0107] For example, combining the question classification system shown in Table 1 above and the question generalization expression model library shown in Table 6, Table 7 provides an example of matching user questions with question generalization expressions.
[0108] Table 7 Examples of User Question Matching and Generalized Expressions
[0109]
[0110]
[0111] See Figure 3 The flowchart below illustrates a user question-answer matching method provided in this application embodiment. The specific method steps are as follows:
[0112] First, obtain the user's question and extract the semantic expression keywords, entity keywords, and attribute keywords of the user's question;
[0113] For example, the semantic keywords of a user's question are "which", the entity keyword is "business", and the attribute keyword is "sub-business".
[0114] Then, the semantic keywords of the user's question are input into the question classification model to obtain at least one classification result;
[0115] For example, if the semantic keywords of a user's question are "which", the output semantic classification result is "definition" → "scope";
[0116] Next, at least one question generalization expression corresponding to the at least one classification result is determined from the constructed question generalization expression model library;
[0117] For example, if the semantic expression keyword of a user question is "which", the entity keyword is "business", and the attribute keyword is "sub-business", the corresponding semantic expression type is "definition" → "scope", and the corresponding entity and attribute combination is "[biz:***business][prop:sub-business]", the generalized expression of the question matching this user question is "What are the sub-businesses of ***business?".
[0118] Finally, based on the answer corresponding to the generalized expression of at least one question, the answer to the user's question is output.
[0119] For example, the method of outputting the answer to the user's question based on the corresponding answer to the at least one question generalization expression includes:
[0120] If the generalized expression of at least one question is expressed as a generalized expression of multiple questions, then:
[0121] The multiple generalized expressions of questions and the user's question are input into a similarity model. Based on the output of the similarity model, the first generalized expression of the question with the highest similarity to the user's question is determined. The similarity model is trained based on sample questions in the question library and question generalized expressions in the constructed question generalization expression model library.
[0122] Based on the matching degree between each question generalization expression and the user's question, determine the second question generalization expression with the highest matching degree;
[0123] Calculate the matching degree between the combination of entity keywords and attribute keywords of the user's question and the combination of entity keywords and attribute keywords of each of the multiple question generalization expressions, and determine the third question generalization expression with the highest matching degree;
[0124] Based on the generalized expressions of the first question, the second question, and the third question, the answer to the user's question is determined.
[0125] For example, the semantic keywords of a user's question, "Explain how to prepare the materials for handling business," are "explain," "how," "handle," and "materials," while the entity keyword is "business." The semantic expression types corresponding to these keywords can be "definition" → "concept" → "explain," or "operation" → "business operation" → "handle," or "definition" → "scope" → "materials." The entity and attribute combination of the user's question is "[biz:***business]." The generalized expressions of the questions corresponding to the above semantic expression types are "***business refers to?", "How to handle ***business?", or "What materials are needed for ***business?". Since there are three matching results for the generalized expressions of the questions, three matching calculations are required for judgment.
[0126] For example, the method for determining the answer to a user question based on generalized expressions for the first question, the second question, and the third question includes:
[0127] When generalized expressions for the first question, the second question, and the third question all exist, then:
[0128] If at least two of the generalized expressions of the first, second, and third questions have the same answer, then the answer of the generalized expression of at least two questions shall be taken as the answer to the user's question.
[0129] For example, using the above example, if the generalized expressions of the first question, the second question, and the third question are all "What materials are needed for *** business?", then the answer corresponding to the generalized expression "What materials are needed for *** business?" will be output as the answer to the user's question.
[0130] If the answers to the generalized expressions of the first, second, and third questions are all different, then the generalized expression of the third question will be taken as the answer to the user's question.
[0131] For example, using the above example, if the first question is generalized to "What is *** business?", the second question to "How to handle *** business?", and the third question to "What materials are needed for *** business?", the answer to the generalized expression "What materials are needed for *** business?" is output as the answer to the user's question.
[0132] If only the generalized expression of the first question and the generalized expression of the second question exist, or if only the generalized expression of the second question exists, then the generalized expression of the second question shall be taken as the answer to the user's question.
[0133] For example, using the above example, if the first question is generalized to "How to process *** business?", the second question to "What materials are needed for *** business?", and the third question to be empty; or,
[0134] Alternatively, if the generalized expression of the first question is empty, the generalized expression of the second question is "What materials are needed for *** business?", and the generalized expression of the third question is empty, then the answer corresponding to the generalized expression of the second question "What materials are needed for *** business?" will be output as the answer to the user's question.
[0135] If only the generalized expression of the first question exists, then the generalized expression of the first question is taken as the answer to the user's question.
[0136] For example, using the above example, if the generalized expression of the first question is "What materials are needed for *** business?", and the generalized expressions of the second and third questions are both empty, then the answer corresponding to the generalized expression of the first question, "What materials are needed for *** business?", will be output as the answer to the user's question.
[0137] Of course, the above methods are just examples, and are not limited to these in practice.
[0138] It is understood that the various embodiments given above can be implemented individually or in combination.
[0139] The methods provided in the embodiments of this application have been described above. The apparatus provided in the embodiments of this application will be described below.
[0140] See Figure 4 This is a structural diagram of a data processing apparatus provided in an embodiment of this application. The apparatus includes modules / units / technical means for performing the methods executed by electronic devices in the above-described method embodiments.
[0141] For example, the device 400 may include:
[0142] Module 401 is used to construct a question classification system. The question classification system includes a multi-level semantic expression layer. Each level of the multi-level semantic expression layer contains multiple semantic expression types. Each upper-level semantic expression type is associated with at least one lower-level semantic expression type. The multi-level associated semantic expression types form an association path. Each association path corresponds to a combination of multiple entity types and attribute types. An initial question generalization expression model library is constructed based on the question classification system. The initial question generalization expression model library includes multiple semantic expression classification results. Each of the multiple semantic expression classification results corresponds to an association path in the question classification system.
[0143] The filling module 402 is used to add question generalization expressions to each semantic expression classification result in the initial question generalization expression model library based on the sample questions in the question library, so as to obtain the constructed question generalization expression model library.
[0144] In one optional implementation, the multi-level semantic expression layer is a three-level semantic expression layer; wherein, the multiple semantic expression types of the first-level semantic expression layer in the three-level semantic expression layer include: definition, operation, and others.
[0145] In one optional implementation, when the filling module 402 adds a question generalization expression to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, it is specifically used to: extract the semantic expression keywords, entity keywords, and attribute keywords corresponding to each sample question in the question library; input the semantic expression keywords corresponding to each sample question into the question classification model; the input of the question classification model is the semantic expression keywords of the question, and the output is at least one semantic expression classification result corresponding to the question in the question generalization expression model library; if the question classification model outputs the semantic expression classification result of any sample question, after determining that the combination of entity keywords and attribute keywords of any sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of any sample question are combined and instantiated to form the question generalization expression corresponding to the semantic expression classification result of any sample question; and / or, if the question classification model does not output the semantic expression classification result of any sample question, then at least one of the question classification system, the question generalization expression model library, and the question classification model is optimized based on the semantic expression keywords of any sample question.
[0146] In one optional implementation, the construction module 401 is further configured to: set a corresponding answer for each question generalization expression in the constructed question generalization expression model library. The method for setting the corresponding answer may be to add the answer corresponding to each question generalization expression in the constructed question generalization expression model library; or, to construct a question answer library, where the answers in the question answer library correspond to each question generalization expression in the constructed question generalization expression model library.
[0147] In one optional implementation, the data processing device further includes: an acquisition module for acquiring user questions; a matching module for extracting semantic expression keywords of user questions; inputting the semantic expression keywords of user questions into a question classification model to obtain at least one semantic expression classification result; determining at least one question generalization expression corresponding to the at least one semantic expression classification result from a pre-constructed question generalization expression model library; and outputting the answer to the user question based on the answer corresponding to the at least one question generalization expression.
[0148] In one optional implementation, if at least one question generalization is expressed as multiple question generalizations, the matching module, when outputting the answer to the user question based on the answer corresponding to the at least one question generalization, is further configured to: input the multiple question generalizations and the user question into a similarity model, and determine the first question generalization with the highest similarity to the user question among the multiple question generalizations based on the output of the similarity model; wherein, the similarity model is trained based on sample questions in the question library and question generalizations in the constructed question generalization model library; calculate the matching degree between each question generalization and the user question among the multiple question generalizations, and determine the second question generalization with the highest matching degree; calculate the matching degree between the combination of entity keywords and attribute keywords in the user question and the combination of entity type and attribute type in each question generalization among the multiple question generalizations, and determine the third question generalization with the highest matching degree; and determine the answer to the user question based on the first question generalization, the second question generalization, and the third question generalization.
[0149] In one optional implementation, when determining the answer to the user's question based on the generalized expressions of the first, second, and third questions, the matching module is further configured to: if the answers of at least two of the generalized expressions of the first, second, and third questions are consistent, then the answers corresponding to the at least two generalized expressions are taken as the answer to the user's question; if the answers corresponding to the generalized expressions of the first, second, and third questions are different, then the answer corresponding to the generalized expression of the third question is taken as the answer to the user's question.
[0150] In one optional implementation, when constructing the question classification system, the construction module 401 is further configured to: extract semantic expression keywords, entity keywords, and attribute keywords from each sample question in the question library to form a preliminary question classification system; train a combination of entity type and attribute type for each association path of semantic expression; construct and train a question classification model based on the semantic expression keywords of each sample question; and optimize the preliminary question classification system based on the question classification model to obtain the constructed question classification system.
[0151] In one optional implementation, when the construction module 401 trains the question classification model based on the semantic expression keywords of each sample, it is further configured to: if the question classification model outputs a classification result for any sample question, then match the entity keywords and attribute keywords of any sample question with the combination of multiple entity types and attribute types under the semantic expression classification result of any sample question; if a matching result exists, then output the semantic expression classification result of any sample question; if a matching result does not exist, then add the combination of entity keywords and attribute keywords of any sample question to the combination of multiple entity types and attribute types under the semantic expression classification result of any sample question; if the question classification model outputs an empty classification result for any sample question, then add the semantic expression keywords, entity keywords, and attribute keywords of any sample question to the combination of multiple entity types and attribute types under the semantic expression classification result of any sample question. These are respectively added to the corresponding multi-level semantic expression layer, entity type, and attribute type in the initial question classification system; if the question classification model outputs multiple classification results for any sample question, then when the semantic expression keyword of any sample question corresponds to a unique semantic expression type in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the semantic expression type of the semantic expression keyword in the last level of the multi-level semantic expression layer; and / or, when the semantic expression keyword of any sample question corresponds to multiple semantic expression types in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the preset semantic expression type priority of the first level of the multi-level semantic expression layer.
[0152] It should be understood that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0153] As one possible product form of the aforementioned device, see [link to product description]. Figure 5This application also provides an electronic device 500, including: at least one processor 501; and a communication interface 503 communicatively connected to the at least one processor 501; the at least one processor 501 executes instructions stored in the memory 502, causing the electronic device 500 to execute the method steps performed by the electronic device in the above method embodiment through the communication interface 503.
[0154] Optionally, the memory 502 is located outside the electronic device 500.
[0155] Optionally, the electronic device 500 includes a memory 502 connected to the at least one processor 501, and the memory 502 contains instructions executable by the at least one processor 501. (See attached image) Figure 5 The dashed line indicates that the memory 502 is optional for the electronic device 500.
[0156] The at least one processor 501 and the memory 502 can be coupled through an interface circuit or integrated together, which is not limited here.
[0157] This application embodiment does not limit the specific connection medium between at least one processor 501, memory 502, and communication interface 503. This application embodiment... Figure 5 At least one processor 501, memory 502, and communication interface 503 are connected via a bus 504. Figure 5 The connections between other components are shown in thick lines only and are not intended to be limiting. This bus section can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 5 It is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0158] It should be understood that the processor mentioned in the embodiments of this application can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.
[0159] For example, the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0160] It should be understood that the memory mentioned in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0161] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA, or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, the memory (storage module) can be integrated into the processor.
[0162] It should be noted that the memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.
[0163] As another possible product form, embodiments of this application also provide a computer-readable storage medium for storing instructions that, when executed, cause a computer to perform the method steps performed by any of the devices in the above method examples.
[0164] As another possible product form, the application embodiment also provides a computer program product, including computer program code, which, when run on a computer, causes the computer to execute the above-described method as the method steps executed by any of the devices in the embodiment.
[0165] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0166] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0167] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0168] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0169] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data processing method, characterized in that, include: A question classification system is constructed, which includes a multi-level semantic expression layer. Each level of the multi-level semantic expression layer contains multiple semantic expression types. Each upper-level semantic expression type is associated with at least one lower-level semantic expression type. The multi-level associated semantic expression types form an association path. Each association path corresponds to a combination of multiple entity types and attribute types. An initial question generalization expression model library is constructed based on the question classification system. The initial question generalization expression model library includes multiple semantic expression classification results. Each of the multiple semantic expression classification results corresponds to an association path in the question classification system. Based on the sample questions in the question library, add question generalization expressions to each semantic expression classification result in the initial question generalization expression model library to obtain the constructed question generalization expression model library; The construction of the question classification system includes: Semantic keywords, entity keywords, and attribute keywords are extracted from each sample question in the question database to form a preliminary question classification system; For each associated path of the semantic expression, a combination of entity type and attribute type is trained; A question classification model is constructed and trained based on the semantic keywords of each sample question; The preliminary question classification system is optimized based on the question classification model to obtain the constructed question classification system. The step of training a question classification model based on the semantic keywords of each sample question includes: If the question classification model outputs a single classification result for any sample question, then it matches the entity keywords and attribute keywords of the sample question with combinations of multiple entity types and attribute types under the semantic expression classification result of the sample question. If a matching result exists, the semantic expression classification result of the sample question is output; if no matching result exists, the combination of entity keywords and attribute keywords of the sample question is added to the combination of multiple entity types and attribute types under the semantic expression classification result of the sample question. If the classification result output by the question classification model for any sample question is empty, then the semantic expression keywords, entity keywords and attribute keywords of any sample question are respectively added to the corresponding multi-level semantic expression layer, entity type and attribute type in the initial question classification system; If the question classification model outputs multiple classification results for any sample question, then when the semantic expression keyword of any sample question corresponds to a unique semantic expression type in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the semantic expression type of the semantic expression keyword of any sample question in the last level of the multi-level semantic expression layer; and / or, when the semantic expression keyword of any sample question corresponds to multiple semantic expression types in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the preset semantic expression type priority of the first level of the multi-level semantic expression layer.
2. The method as described in claim 1, characterized in that, The multi-level semantic expression layer is a three-level semantic expression layer; wherein, the multiple semantic expression types of the first-level semantic expression layer in the three-level semantic expression layer include: definition, operation and others.
3. The method as described in claim 1, characterized in that, The step of adding question generalization expressions to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library includes: Extract the semantic expression keywords, entity keywords, and attribute keywords corresponding to each sample question in the question database; The semantic expression keywords corresponding to each sample question are input into the question classification model; the input of the question classification model is the semantic expression keywords of the question, and the output is at least one semantic expression classification result of the question in the question generalization expression model library; If the question classification model outputs a semantic expression classification result for any sample question, after determining that the combination of entity keywords and attribute keywords of the sample question matches the combination of entity type and attribute type under the semantic expression classification result, the entity keywords and attribute keywords of the sample question are combined and instantiated to form a question generalization expression corresponding to the semantic expression classification result of the sample question; and / or, if the question classification model does not output a semantic expression classification result for any sample question, then at least one of the question classification system, the question generalization expression model library, and the question classification model is optimized based on the semantic expression keywords of the sample question.
4. The method as described in claim 1, characterized in that, The method further includes: Set a corresponding answer for each question generalization expression in the constructed question generalization expression model library.
5. The method according to any one of claims 1-4, characterized in that, The method further includes: Get user questions; Extract semantic keywords from the user's question; Input the semantic keywords of the user's question into the question classification model to obtain at least one semantic classification result; From the constructed question generalization expression model library, determine at least one question generalization expression corresponding to the at least one semantic expression classification result; Based on the generalized expression of the at least one question, output the answer to the user's question.
6. The method as described in claim 5, characterized in that, If the at least one question generalization expression is expressed as multiple question generalization expressions, then the step of outputting the answer to the user question based on the answer corresponding to the at least one question generalization expression includes: The multiple question generalization expressions and the user question are input into a similarity model. Based on the output of the similarity model, the first question generalization expression with the highest similarity to the user question is determined from among the multiple question generalization expressions. The similarity model is trained based on sample questions in the question library and question generalization expressions in the constructed question generalization expression model library. Calculate the matching degree between each of the multiple question generalization expressions and the user question, and determine the second question generalization expression with the highest matching degree; Calculate the matching degree between the combination of entity keywords and attribute keywords of the user question and the combination of entity type and attribute type of each question generalization expression in the multiple question generalization expressions, and determine the third question generalization expression with the highest matching degree; The answer to the user's question is determined based on the generalized expressions of the first question, the second question, and the third question.
7. The method as described in claim 6, characterized in that, The step of determining the answer to the user's question based on the generalized expressions of the first question, the second question, and the third question includes: If at least two of the generalized expressions of the first question, the second question, and the third question have the same answer, then the answer corresponding to the at least two generalized expressions of the question shall be taken as the answer to the user question. If the answers corresponding to the generalized expressions of the first question, the second question, and the third question are different, then the answer corresponding to the generalized expression of the third question shall be taken as the answer to the user's question.
8. A data processing apparatus, characterized in that, include: The construction module is used to construct a question classification system. The question classification system includes a multi-level semantic expression layer. Each level of the multi-level semantic expression layer contains multiple semantic expression types. Each upper-level semantic expression type is associated with at least one lower-level semantic expression type. The multi-level associated semantic expression types form an association path. Each association path corresponds to a combination of multiple entity types and attribute types. The construction module is also used to construct an initial question generalization expression model library based on the question classification system. The initial question generalization expression model library includes multiple semantic expression classification results, and each of the multiple semantic expression classification results corresponds to an association path in the question classification system. The filling module is used to add question generalization expressions to each semantic expression classification result in the initial question generalization expression model library based on sample questions in the question library, so as to obtain the constructed question generalization expression model library; Specifically, the building module is used for: Semantic keywords, entity keywords, and attribute keywords are extracted from each sample question in the question database to form a preliminary question classification system; For each associated path of the semantic expression, a combination of entity type and attribute type is trained; A question classification model is constructed and trained based on the semantic keywords of each sample question; The preliminary question classification system is optimized based on the question classification model to obtain the constructed question classification system. The step of training a question classification model based on the semantic keywords of each sample question includes: If the question classification model outputs a single classification result for any sample question, then it matches the entity keywords and attribute keywords of the sample question with combinations of multiple entity types and attribute types under the semantic expression classification result of the sample question. If a matching result exists, the semantic expression classification result of the sample question is output; if no matching result exists, the combination of entity keywords and attribute keywords of the sample question is added to the combination of multiple entity types and attribute types under the semantic expression classification result of the sample question. If the classification result output by the question classification model for any sample question is empty, then the semantic expression keywords, entity keywords and attribute keywords of any sample question are respectively added to the corresponding multi-level semantic expression layer, entity type and attribute type in the initial question classification system; If the question classification model outputs multiple classification results for any sample question, then when the semantic expression keyword of any sample question corresponds to a unique semantic expression type in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the semantic expression type of the semantic expression keyword of any sample question in the last level of the multi-level semantic expression layer; and / or, when the semantic expression keyword of any sample question corresponds to multiple semantic expression types in the first level of the multi-level semantic expression layer, the question classification model will output a classification result for any sample question according to the preset semantic expression type priority of the first level of the multi-level semantic expression layer.
9. An electronic device, characterized in that, The electronic device includes at least one processor, which is configured to implement the method as described in any one of claims 1-7 when executing a computer program stored in a memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instructions that, when executed, cause the method as described in any one of claims 1-7 to be implemented.
11. A computer program product, characterized in that, The computer program product includes: computer program code, which, when run on a computer, causes the computer to perform the method described in any one of claims 1-7.
Citation Information
Patent Citations
Table question and answer method, system and device based on artificial intelligence and storage medium
CN114880446A
Document-based question generation method and device and server
CN115688792A
Knowledge graph-based intention multi-classification question and answer method, apparatus and device, and medium
CN115934914A