Intentional multi-classification question answering method, device, equipment and medium based on knowledge graph

By training entity recognition, question classification and text similarity matching models, the problem of complex number of candidate subgraph paths in the knowledge graph is solved, and the question-answer speed and accuracy are improved, especially the ability to handle complex questions.

CN115934914BActive Publication Date: 2025-08-19CHENGDU UNION BIG DATA TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211681146.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-08-19
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

Due to the complexity of the question, the number of candidate subgraph paths of entities in the knowledge graph is complex, resulting in a significant impact on the speed and accuracy of the question-and-answer.

Method used

The entity recognition model is trained to identify entities as categories containing relational entities and attribute entities, the question classification model is trained to divide the question into single-hop and multi-hop types, and the text similarity matching model is trained to find and generalize the subgraph path in the knowledge graph, and build a question-and-answer model containing these models.

Benefits of technology

Through entity recognition and question classification, the negative effect of answer strings other than entities in the question on matching the question with the optimal subgraph path is reduced, and the question-answer speed and accuracy are improved, especially the ability to handle complex conditional joint query sentences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934914B_ABST
    Figure CN115934914B_ABST
Patent Text Reader

Abstract

This application discloses a knowledge graph-based multi-classification question-answering method, apparatus, device, and medium. The method aims to address the problem of a large number of candidate subgraph paths for entities in a knowledge graph due to the complexity of questions, which significantly impacts the speed and accuracy of question answering. The method includes: training an entity recognition model to identify entities as entity categories containing relationship entities and attribute entities; training a question classification model to classify questions into types containing single-hop questions and multi-hop questions; training a text similarity matching model to search for subgraph paths in the knowledge graph based on the query content and generalize the subgraph paths; and constructing a question-answering model that includes the entity recognition model, question classification model, and text similarity matching model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph question answering, and in particular to a knowledge graph-based intent multi-classification question answering method, apparatus, equipment and medium. Background Art

[0002] Currently, knowledge graph question answering is primarily implemented using a search and ranking approach. By extracting information from the question, entities, relationships, and attributes are obtained, and candidate subgraph paths are constructed within the knowledge graph. The answer to the question is necessarily connected to the entity via a one- or multi-hop path. Finding the answer requires determining the optimal candidate subgraph path. Currently, deep learning techniques are mostly used to achieve the optimal match between the question and the candidate subgraph path, thereby determining the optimal candidate subgraph path and completing the question answering. However, due to the complexity of the question, the number of candidate subgraph paths for the entity in the knowledge graph is relatively large, significantly impacting the speed and accuracy of the question answering. Summary of the Invention

[0003] The main purpose of this application is to provide a knowledge graph-based intention multi-classification question answering method, device, equipment and medium, aiming to solve the problem that due to the complexity of the question, the number of candidate subgraph paths of the entity in the knowledge graph is large, which has a great impact on the question answering speed and accuracy.

[0004] To solve the above technical problems, the present application proposes an intent multi-classification question answering method based on a knowledge graph, comprising:

[0005] Train the entity recognition model to identify entities as entity categories including relationship entities and attribute entities;

[0006] Train a question classification model to classify questions into single-hop questions and multi-hop questions.

[0007] Train a text similarity matching model to find subgraph paths in the knowledge graph based on the query content and generalize the subgraph paths;

[0008] Construct a question-answering model that includes the entity recognition model, question classification model, and text similarity matching model.

[0009] As an optional implementation of the present application, the training entity recognition model includes: the training data includes relationship entities and attribute entities, the relationship entities include entities connected with relationship edges, and the attribute entities are not connected with relationships.

[0010] As an optional implementation of the present application, the training text similarity matching model includes:

[0011] Use entities in the question to find subgraph paths in the knowledge graph;

[0012] generalizing the subgraph path;

[0013] The question and subgraph path combination is scored and sorted, and the subgraph path whose score meets the preset conditions is regarded as the optimal subgraph path corresponding to the question.

[0014] In specific applications, the text similarity model is used to complete the selection of the optimal subgraph path for questions. By generalizing the subgraph path, the negative impact of answer strings other than entities in the question on the matching between the question and the optimal subgraph path can be reduced.

[0015] As an optional implementation of the present application, constructing the question-answering model includes:

[0016] Identifying question entities using the entity recognition model;

[0017] Identifying question types using the question classification model;

[0018] According to the question type, the text similarity matching model is used to query matching answers.

[0019] In specific applications, the question-answering model obtains the question entity string through the entity recognition model, and uses different query models according to different question types to obtain the final answer to the question.

[0020] As an optional implementation of the present application, the training entity recognition model further includes: inputting a question into the entity recognition model, obtaining interactive semantic information, forward and backward time sequence information, and determining entities in the question.

[0021] In specific applications, by inputting the interactive semantic information between the words in the question, and then through the forward and backward time sequence information of the question, and finally by constraining all sequences with the "BIO" order ("BX" represents the beginning of the entity, "IX" represents the end of the entity, and "OX" represents not belonging to any type), the sequence with the highest score is obtained to determine the entity in the question.

[0022] As an optional implementation of the present application, the entity recognition model may be a sequence labeling model.

[0023] As an optional implementation of the present application, when the question type is a conditional joint query type, the following steps are included:

[0024] Divide the question sentence according to the question sentence entity to obtain a question sentence short sentence character string;

[0025] Calculating a conditional joint query score for the question;

[0026] When the conditional joint query score is within a preset threshold range, determining that the question is a joint query question;

[0027] Based on each short sentence string, all subgraph paths of the entity corresponding to the short sentence string are constructed in the knowledge graph, and the optimal subgraph path is analyzed to obtain the answer to the question.

[0028] In specific applications, joint query can solve the problem that joint query questions cannot be fully answered based solely on candidate subgraph paths.

[0029] To solve the above technical problems, the present application also proposes: an intention multi-classification question-answering device based on a knowledge graph, which is characterized by including:

[0030] An entity recognition model training module is used to train an entity recognition model to identify entities as entity categories including relationship entities and attribute entities;

[0031] The question classification model training module is used to train the question classification model and classify questions into types including single-hop questions and multi-hop questions;

[0032] A text similarity matching model training module is used to train a text similarity matching model, find subgraph paths in the knowledge graph based on the query content, and generalize the subgraph paths;

[0033] The question-answering model construction module is used to construct a question-answering model including the entity recognition model, question classification model, and text similarity matching model.

[0034] To solve the above technical problems, an embodiment of the present application further proposes: an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described above.

[0035] To solve the above technical problems, an embodiment of the present application further proposes: a computer-readable storage medium, on which a computer program is stored, and a processor executes the computer program to implement the above method.

[0036] Compared with the prior art, the knowledge graph-based intention multi-classification question answering method described in the embodiment of the present application trains an entity recognition model to identify entities as entity categories containing relationship entities and attribute entities; trains a question classification model to classify questions into types containing single-hop questions and multi-hop questions; trains a text similarity matching model to search for subgraph paths in the knowledge graph based on the query content and generalize the subgraph paths; and constructs a question answering model that includes the entity recognition model, the question classification model, and the text similarity matching model. The training entity recognition model includes: the training data includes relationship entities and attribute entities, the relationship entities include entities connected to relationship edges, and the attribute entities are not connected to them by relationships. The training text similarity matching model includes: using entities in the question to search for subgraph paths in the knowledge graph; generalizing the subgraph paths; scoring and ranking the combination of the question and the subgraph path, and selecting the subgraph path whose score meets the preset conditions as the optimal subgraph path corresponding to the question. The construction of the question-answering model includes: using the entity recognition model to identify question entities; using the question classification model to identify question types; and based on the question type, using the text similarity matching model to query matching answers. The training of the entity recognition model also includes: inputting the question into the entity recognition model, obtaining interactive semantic information, forward and backward time series information, and determining the entities in the question. The entity recognition model can be a sequence labeling model. When the question type is a conditional joint query type, it includes: dividing the question according to the question entities to obtain question short sentence strings; calculating the conditional joint query score of the question; when the conditional joint query score is within a preset threshold range, determining that the question is a joint query question; based on each short sentence string, constructing all subgraph paths corresponding to the entity of the short sentence string in the knowledge graph, parsing the optimal subgraph path, and obtaining the answer to the question. This method solves the problem that due to the complexity of the question, the number of candidate subgraph paths for the entity in the knowledge graph is relatively large, which has a significant impact on the speed and accuracy of question answering. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is the structural flow chart of the question-answering model of this application;

[0038] Figure 2 is a structural diagram of an entity recognition model in an embodiment of the present application;

[0039] Figure 3 is a structural diagram of a text similarity matching model in an embodiment of the present application;

[0040] Figure 4 This is the structural diagram of the knowledge graph question-answering system of this application. DETAILED DESCRIPTION

[0041] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0042] The main solution of the embodiment of this application is (as shown in the attached Figure 1 As shown): Provide an intent multi-classification question answering method based on a knowledge graph, including: training an entity recognition model to identify entities as entity categories including relationship entities and attribute entities; training a question classification model to classify questions into types including single-hop questions and multi-hop questions; training a text similarity matching model to search for subgraph paths in the knowledge graph based on the query content and generalize the subgraph paths; and constructing a question answering model including the entity recognition model, the question classification model, and the text similarity matching model.

[0043] Because in the prior art, when it comes to multi-relational complex questions, the accuracy of the model based on the matching of questions and relationships is poor, and it is not possible to complete the question and answer of complex questions well. Simply using the Bi-LSTM neural network can only obtain the temporal semantic information of the question, and cannot obtain the semantic interaction information between each word in the question. At the same time, it lacks the ability to constrain the order of word sequences, which affects the effect of entity recognition (CN113934831A). The present invention adopts pair similarity matching of questions and subgraph paths to achieve question and answer of complex multi-relational questions. In the entity recognition part, the present invention builds an entity recognition model based on Transformer, Bi-LSTM and CRF. The semantic interaction information between each word in the question can be obtained by Transformer. At the same time, the word sequence order can be constrained to a certain extent by CRF, thereby improving the effect of entity recognition. All candidate paths of the first-degree (one hop) and second-degree (two hop) triples of linked entities are constructed. This method without pruning will reduce the speed and accuracy of selecting the optimal path. At the same time, the candidate paths established based on first-degree and second-degree triples cannot adapt to all questions, such as conditional joint query questions and entity relationship search questions (CN113742446A). The present invention adopts an efficient multi-classification method based on entities to analyze user queries and classify questions. Candidate subgraphs are constructed according to different questions to reduce the complexity of selecting the optimal subgraph, so that the speed and accuracy are greatly improved. In addition, the knowledge graph question-answering system constructed by the present invention can also answer complex conditional joint query questions and entity relationship query questions. All relevant query graphs in the corresponding graph are constructed for the questions. Although the information of the corresponding graph of the question is complete, the large number of query graphs will reduce the question-answering speed. At the same time, there will be many query graphs that are similar to the answer but wrong, which will participate in the sorting and affect the accuracy (CN112989004A). The present invention adopts an efficient multi-classification method based on entities to classify questions and construct candidate subgraphs according to different categories of questions. This not only ensures that the graph information of this category of questions is not missing, but also reduces the complexity of selecting the optimal subgraph, greatly improving the speed and accuracy.

[0044] The method embodiment is as follows:

[0045] Step 1: Obtain large-scale data

[0046] Acquire large-scale data, including knowledge graphs and question training data. Question training data consists of question sentences and entity triples (subject entity string, relationship (attribute), answer).

[0047] Step 2: Train the entity recognition (NER) model through supervised deep learning methods

[0048] (1) The entity recognition (NER) model is implemented using a sequence labeling model.

[0049] (2) For the training labeled data, "BIO" annotation is used. The entity types are set to "relationship entity" and "attribute entity", that is, the relationship entity is annotated as "B-ER, I-ER" and the attribute entity is annotated as "B-EP, I-EP". The so-called relationship entity refers to the entity connected with the relationship edge in the knowledge graph. At the same time, the relationship entity has attributes and attribute values, such as "Yao Ming" and "NBA". The attribute entity refers to the entity that exists as an attribute value in the knowledge graph and has no relationship connected to it, such as "supersonic" and "183cm".

[0050] (3) The sequence labeling model used in this invention is based on Transformer, BiLSTM, and CRF. Figure 2 shown.

[0051] (4) Input the question query, obtain the interactive semantic information between words through the Transformer encoder, and then obtain the forward and backward time sequence information of the question query through BiLSTM. Finally, all sequences are constrained by the "BIO" order through CRF ("BX" represents the beginning of the entity, "IX" represents the end of the entity, and "OX" represents not belonging to any type). The sequence with the highest score is obtained to determine the entity in the question query.

[0052] Step 3: Train the question classification model through supervised learning methods

[0053] (1) For the knowledge graph question answering system, the main purpose of training the question classification model is to classify single-hop and multi-hop questions into two categories. The present invention uses the BERT pre-trained model to achieve question classification.

[0054] (2) In the data labeling part, single-hop questions and multi-hop questions are marked as "0" and "1" respectively, and training data is constructed and trained to obtain a question classification model.

[0055] Step 4: Use supervised learning methods to train the text similarity matching model (see attached Figure 3 shown)

[0056] (1) The text similarity matching model is constructed based on Transformers, MLP and sotfmax, as shown in the attached Figure 3 shown.

[0057] (2) For the query Q=query, find the subgraph path P=Path in the graph through the entity.

[0058] (3) Given that the subgraph path contains answer strings other than the entities in the question, these answer strings will have a negative impact on the matching between the question and the optimal subgraph path. Therefore, it is necessary to generalize the answer part of the subgraph path and construct a subgraph path based on the question entities and relations / attributes. For example, generalize "Yao Ming-wife-Ye Li" to "Yao Ming--wife--PAD".

[0059] (3) During model training, Q and P are combined into a four-tuple pair (CLS, Q, SEP, P) and input into the model to obtain the hidden layer vector H_cls containing the classification semantic information of Q and P. After passing through MLP, the cross entropy loss function is used for loss calculation.

[0060] (4) During model prediction, the question Q and all subgraph paths are paired as input. All pairs output by the model are sorted by softmax to obtain scores. Pairs with scores greater than the threshold are selected to obtain the optimal subgraph path, thus completing the selection of the optimal subgraph path for the question.

[0061] Step 5: Build a question-answering system based on the trained model (see attached Figure 4 shown)

[0062] (1) Entities are determined based on the maximum substring match between n-grams and entities in the knowledge graph. Stop words are removed from the user-entered query, and the entity string is obtained through the entity recognition model. N-grams are constructed for the entity string, where n is the length of the entity string. The n-grams are sorted from largest to smallest in length, and fuzzy queries are performed starting with the longest word until an entity in the graph is successfully matched and used as the subject entity of the question.

[0063] (2) Use different query models according to different question types.

[0064] (3) Determine whether the question type is an entity query. When the character length of the entity differs from the character length of the question by no more than 1, the question type is determined to be an entity query (e.g., "Lionel Messi").

[0065] Finally, the entity obtained in (1) is returned as the answer to the entity query.

[0066] (4) Determine whether the question type is a relational query. When the number of subject entities is 2 and both are relational entities, the relational entity ratio score of the question is defined as:

[0067]

[0068] l_qe i Indicates the length of the i-th entity in the question, l_que indicates the length of the question. que_en When , the question is determined to be a relational query (e.g., “Are Yao Ming and Ye Li husband and wife?”), where γ represents the threshold of the relational entity ratio score of the relational query.

[0069] Get the relation entities str_en1 and str_en2 identified in (1), query all triples of str_en1 that contain triples of str_en2, and return the relations in these triples as the answer.

[0070] (5) The question type is determined to be a conditional joint query. j ) are attribute entities and the number is not less than 2, according to (str_en1, ···, str_en j ) Get the subscript (idx_en1, ···, idx_en) at the position in the question j ). Based on the attribute entity subscript idx_eni, a sliding window of length ∈ is set to divide the question sentence, and the corresponding question short sentence string is obtained as que_en i =query[idx_en i -∈:idx_en i +∈], define the conditional joint query score of the question:

[0071]

[0072]

[0073] l_qe i Indicates the i-th short sentence string que_en corresponding to the i-th entity i length,

[0074] avg lqe Indicates the average length of all question short sentence strings, Score union Indicates the conditional joint query score of the question. When α<Score unionWhen α is less than β, it indicates that the short sentences corresponding to the two entities are parallel query sentences, and the question type is determined to be a conditional joint query sentence (for example, "What fighter jets have a captain less than 6.21 meters and a wingspan greater than 9.87 meters?"), where α and β represent the lower and upper thresholds of the conditional joint query score.

[0075] According to each short sentence string que_en i , construct str_en in the knowledge graph i All subgraph paths Paths_en i =(eni_path1, ..., en i _path n ), the question Q and all subgraph candidate paths Paths_en i Form a pair S qp =[(que,en i- path1),…,(que,en i _path n )], input text similarity model to get the optimal pair (que, en i _path opt ), and parse the optimal subgraph path

[0076] en i _path opt , get the optimal attribute en corresponding to the entity i _pro opt Finally, combine the optimal attributes of the short sentence strings corresponding to all attribute entities to construct a CQL statement (for example, "match (w) where w.en i _pro opt =str_en i andw.en j _proo opt =str_en j return w”'), perform graph query, and return the final answer.

[0077] (6) Determine whether the question type is a single-hop entity query. When the number of entities is 1, input the question into the single-hop and multi-hop question classification model. When the model output is a single-hop question, determine that the question type is a single-hop relational entity query (for example, "Who is Yao Ming's wife?", "Who is the athlete nicknamed 'Dayao'?").

[0078] Perform single-hop relationship query and attribute query on the entities identified in (1), and construct the subgraph path en_path based on all single-hop relationships and attributes i _one, build subgraph paths and question pairs at the same time

[0079] S qpp_one =[(que,en-path1-one),…,(que,en-path i -one)], input text similarity matching model to obtain the optimal subgraph path, and parse to obtain the optimal entity relationship or attribute en_key opt , build CQL statements (e.g. "match(w)-[r:en_key opt ]->[n]return w","match(w)where w.en-pro opt =en_key opt returnw”), perform graph query and return the final answer.

[0080] (7) Determine whether the question type is a multi-hop entity question. Input the question into the question classification model, and the output is a multi-hop entity question, that is, determine the question type to be a multi-hop entity question. (For example, "Who is the president of the university where Yao Ming graduated?", "What song did Eason Chan and Faye Wong sing together?").

[0081] For the entity identified in (1): If it is a single entity, perform multi-hop relationship query and attribute query on the entity, and construct the subgraph path en_pat based on the multi-hop relationship and attributes hi -mul, build a pair with the question S qp_mnal =[(qlu,en_path1-mui),…,(que,en_path i -mul)], input the text similarity matching model, obtain the optimal subgraph path, construct a CQL statement to perform graph query to obtain the final answer. If there are multiple entities, construct a multi-hop relationship\attribute query for each entity, and combine multiple entities and relationships (attributes) to construct a subgraph path en m -path i _mul, also forms a pair with question sentences

[0082] S qp_mul =[(que,en1_path1-mul),…,(que,en m _path i -mul)], input the text similarity matching model, obtain the optimal subgraph path and resolve the optimal relationship (attribute) corresponding to each entity

[0083] Pn i key opt , construct CQL statements to perform graph queries and return the final answer.

[0084] Based on the same inventive concept, the embodiment of the present application further proposes: an intention multi-classification question-answering device based on a knowledge graph, characterized by including:

[0085] An entity recognition model training module is used to train an entity recognition model to identify entities as entity categories including relationship entities and attribute entities;

[0086] The question classification model training module is used to train the question classification model and classify questions into types including single-hop questions and multi-hop questions;

[0087] A text similarity matching model training module is used to train a text similarity matching model, find subgraph paths in the knowledge graph based on the query content, and generalize the subgraph paths;

[0088] The question-answering model construction module is used to construct a question-answering model including the entity recognition model, question classification model, and text similarity matching model.

[0089] It should be noted that each module in the knowledge graph-based intention multi-classification question-answering device in this embodiment corresponds one-to-one to each step in the knowledge graph-based intention multi-classification question-answering method in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned knowledge graph-based intention multi-classification question-answering method, which will not be repeated here.

[0090] In addition, in one embodiment, an embodiment of the present application further provides a computer program product, which implements the aforementioned method when executed by a processor.

[0091] In addition, in one embodiment, an embodiment of the present application further provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the aforementioned embodiment are implemented.

[0092] In some embodiments, the computer-readable storage medium may be a memory device such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface mount memory, optical disk, or CD-ROM; or various devices including any one or any combination of the above memories. The computer may be various computing devices including smart terminals and servers.

[0093] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0094] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0095] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0096] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0097] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0098] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a multimedia terminal device (which can be a mobile phone, a computer, a television receiver, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0099] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. The intention multi-classification question answering method based on knowledge graph is characterized by: include: Train the entity recognition model to identify entities as entity categories including relationship entities and attribute entities; The training entity recognition model includes: The training data contains relationship entities and attribute entities. The relationship entities represent entities connected to the relationship edge in the knowledge graph. The relationship entities have attributes and attribute values. The attribute entities represent entities that exist as attribute values in the knowledge graph and have no relationship entities connected to them. The training entity recognition model further comprises: inputting a question into the entity recognition model, obtaining interactive semantic information, forward and backward time sequence information, and determining entities in the question; Train a question classification model to classify questions into single-hop questions and multi-hop questions. Train a text similarity matching model to find subgraph paths in the knowledge graph based on the query content and generalize the subgraph paths; The training text similarity matching model includes: Use entities in the question to find subgraph paths in the knowledge graph; generalizing the subgraph path; Score and sort the question and subgraph path combinations, and select the subgraph path whose score meets the preset conditions as the optimal subgraph path corresponding to the question; Constructing a question-answering model including the entity recognition model, the question classification model, and the text similarity matching model; The question-answering model construction includes: Identifying question entities using the entity recognition model; Identifying question types using the question classification model; According to the question type, using the text similarity matching model to query matching answers; When the question type is a conditional joint query type, the following steps are included: Divide the question sentence according to the question sentence entity to obtain a question sentence short sentence character string; Calculating a conditional joint query score for the question; When the conditional joint query score is within a preset threshold range, determining that the question is a joint query question; Based on each short sentence string, all subgraph paths of the entity corresponding to the short sentence string are constructed in the knowledge graph, and the optimal subgraph path is analyzed to obtain the answer to the question.

2. The knowledge graph-based multi-classification question answering method according to claim 1, characterized in that: The entity recognition model is a sequence labeling model.

3. The intention multi-classification question answering device based on knowledge graph is characterized by: include: An entity recognition model training module is used to train an entity recognition model to identify entities as entity categories including relationship entities and attribute entities; The training entity recognition model includes: The training data contains relationship entities and attribute entities. The relationship entities represent entities connected to the relationship edge in the knowledge graph. The relationship entities have attributes and attribute values. The attribute entities represent entities that exist as attribute values in the knowledge graph and have no relationship entities connected to them. The training entity recognition model further comprises: inputting a question into the entity recognition model, obtaining interactive semantic information, forward and backward time sequence information, and determining entities in the question; The question classification model training module is used to train the question classification model and classify questions into types including single-hop questions and multi-hop questions; A text similarity matching model training module is used to train a text similarity matching model, find subgraph paths in the knowledge graph based on the query content, and generalize the subgraph paths; The training text similarity matching model includes: Use entities in the question to find subgraph paths in the knowledge graph; generalizing the subgraph path; Score and sort the question and subgraph path combinations, and select the subgraph path whose score meets the preset conditions as the optimal subgraph path corresponding to the question; A question-answering model construction module, used to construct a question-answering model including the entity recognition model, question classification model, and text similarity matching model; The question-answering model construction includes: Identifying question entities using the entity recognition model; Identifying question types using the question classification model; According to the question type, using the text similarity matching model to query matching answers; When the question type is a conditional joint query type, the following steps are included: Divide the question sentence according to the question sentence entity to obtain a question sentence short sentence character string; Calculating a conditional joint query score for the question; When the conditional joint query score is within a preset threshold range, determining that the question is a joint query question; Based on each short sentence string, all subgraph paths of the entity corresponding to the short sentence string are constructed in the knowledge graph, and the optimal subgraph path is analyzed to obtain the answer to the question.

4. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 2.

5. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Query graph sorting method and system oriented to knowledge graph questions and answers

    CN112989004A

  • Knowledge graph question and answer method and system based on path sorting

    CN113742446A

  • Knowledge graph question and answer method based on deep learning

    CN113934831A

  • Linked data oriented entity classification method and system

    CN105912625A

  • Medical intelligent question and answer processing method and system based on knowledge graph reasoning

    CN112650840A