Response method, apparatus, device, and storage medium

By obtaining a list of entities, types, and constraints of the problem, and using a classification model to convert it into a factual problem and generate a query graph, the problem of low efficiency in responding to complex problems in existing technologies is solved, and more efficient intelligent responses are achieved.

CN114117000BActive Publication Date: 2026-01-06HISENSE VISUAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111333097.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2026-01-06
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

Existing technologies cannot quickly and accurately respond to multi-hop relationship problems and constrained problems, resulting in low efficiency of intelligent response systems for complex problems.

Method used

By obtaining the entity list, type list, constraint list, and attribute value list of the problem, the problem type is determined using a preset classification model, and it is converted into an easy-to-process factual problem. A problem query graph is generated, and the knowledge graph is used to perform the query to obtain the response results.

Benefits of technology

It improves the accuracy and efficiency of the intelligent response system for complex questions and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114117000B_ABST
    Figure CN114117000B_ABST
Patent Text Reader

Abstract

The application provides a response method, device, equipment and storage medium. The method obtains a question, analyzes and processes the question, obtains an entity list, a type list, a constraint list and an attribute value list corresponding to the question, inputs the question into a preset classification model, determines a question type corresponding to the question according to an output result, converts the question if the question type is not a fact type question, obtains at least one target fact type question, generates a question query graph according to the entity list, the type list, the constraint list, the attribute value list and the at least one target fact type question, queries in a preset knowledge graph according to the question query graph, and obtains a response result. According to the question query graph, the response result corresponding to the question can be accurately determined in the knowledge graph, the accuracy and efficiency of the response are improved, and the user experience is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information interaction technology, and in particular to a response method, apparatus, device and storage medium. Background Technology

[0002] With the development of artificial intelligence technology, intelligent response is widely used in mobile communications, customer service, government and enterprise platforms, and other fields to provide users with services such as business inquiries and business reports. Knowledge-based question answering (KBQA) is a type of intelligent response that, given a natural language question, performs semantic understanding and parsing of the question, and then uses a knowledge base to query and reason to arrive at the answer.

[0003] In related technologies, intelligent response is mainly achieved through template matching, semantic parsing, and information retrieval methods. Template matching determines the answer by matching a user with a pre-set template. Semantic parsing is the most widespread and popular method in KBQA. It performs semantic analysis on natural language and transforms it into a semantic representation that the knowledge base can understand. Then, it uses semantics to perform structured queries to obtain the answer to the question. Information retrieval methods first extract information from the question, use the knowledge base to obtain candidate answers, and then rank the candidate answers to obtain the final answer.

[0004] However, the relevant technologies can only respond to simple problems, and cannot provide quick and accurate responses to complex problems such as multi-hop relationship problems and constrained problems. Summary of the Invention

[0005] This application provides a response method, apparatus, device, and storage medium to solve the technical problem that related technologies can only respond to simple problems, and cannot provide fast and accurate responses to complex problems such as multi-hop relationship problems and constrained problems.

[0006] Firstly, this application provides a response method, including:

[0007] Obtain the problem, parse and process the problem to obtain the entity list, type list, constraint list and attribute value list corresponding to the problem;

[0008] The question is input into a preset classification model, and the question type is determined based on the output.

[0009] If the question type is not a factual question, then the question is transformed to obtain at least one target factual question;

[0010] Generate a question query graph based on the entity list, the type list, the constraint list, the attribute value list, and the at least one target factual question;

[0011] Based on the question query graph, a query is performed in the preset knowledge graph to obtain the response result.

[0012] Here, in the embodiments of this application, when answering questions, questions can be classified and identified according to a preset classification model. For complex questions such as multi-hop relationship questions and constrained questions that are not easy to process directly, the questions can be converted into factual questions that are easy to process. Then, by combining the entity list, type list, constraint list and attribute value list corresponding to the question obtained by parsing, a question query graph is generated. Based on the question query graph, the corresponding answer result can be accurately determined in the knowledge graph, which improves the accuracy and efficiency of the answer and further improves the user experience.

[0013] In one possible design, the question types include factual questions, comparison questions, intersection questions, and yes / no questions;

[0014] The transformation process of the problem to obtain at least one target factual problem includes:

[0015] If the question type is a comparison question, then delete the pronoun phrases in the question and determine the target factual question based on the adjectives in the question;

[0016] If the question type is an intersection question, then the specific intersection phrases in the question are deleted, and at least two target factual questions are obtained based on the subject of the question;

[0017] If the question type is a yes / no question, then the target factual question is determined based on the entities and / or attributes in the question.

[0018] In this application embodiment, when classifying questions, the question types are divided into factual questions, comparison questions, intersection questions, and yes / no questions. Factual questions are those that are easy to answer, while other types of questions are not easy to answer quickly. Therefore, different conversion methods are provided based on different question types. The conversion of questions is based on the different characteristics of comparison questions, intersection questions, and yes / no questions, so as to obtain more accurate target factual questions, further improving the accuracy of the response and improving the user experience.

[0019] In one possible design, before inputting the question into a preset classification model and determining the question type based on the output, the method further includes:

[0020] Obtain training samples for multiple question types, and label the multiple question type training samples with question types;

[0021] The training samples with labeled question types are input into the classification model for training, resulting in a preset classification model.

[0022] Here, in this embodiment of the application, a large number of training samples with question type labels can be used to train the classification model to obtain accurate weights for the classification model. Thus, by inputting the question into the pre-trained model, the question type can be quickly obtained, which improves the efficiency of question classification and conversion, further improves the efficiency and accuracy of intelligent response, and enhances the user experience.

[0023] In one possible design, generating a question query graph based on the entity list, the type list, the constraint list, the attribute value list, and the at least one target factual question includes:

[0024] The beam search algorithm iteratively processes the entity list, the type list, the constraint list, the attribute value list, and the at least one target factual question to obtain multiple candidate query graphs.

[0025] The multiple candidate query graphs are filtered to obtain the question query graph.

[0026] Here, in this embodiment of the application, candidate query graphs are generated iteratively by beam search, which can find all query graphs related to the question, and then filter them to obtain the question query graph that is closest to the question, thereby obtaining an accurate response result based on the question query graph.

[0027] In one possible design, the filtering process of the multiple candidate query graphs to obtain the question query graph includes:

[0028] Calculate the feature parameters for each candidate query graph, wherein the feature parameters include the similarity between the query graph and the question text, the number of entities in the query graph, the sum of entity link scores, the number of types, the sum of type link scores, the number of constraints, the number of attribute values, the number of hops in the relation path, and the number of answers executed by the query graph;

[0029] Based on the feature parameters, a multidimensional feature vector corresponding to each candidate query graph is obtained;

[0030] The multidimensional feature vector is input into a preset prediction model, and the prediction score of each candidate query graph is obtained based on the output results.

[0031] The question query graph is determined based on the predicted score of each candidate query graph.

[0032] Here, in this embodiment of the application, nine features are constructed for each candidate query graph: similarity between the query graph and the question text, number of entities in the query graph, sum of entity link scores, number of types, sum of type link scores, number of constraints, number of attribute values, number of hops in the relationship path, and number of answers executed by the query graph. These features are concatenated to obtain a multi-dimensional feature vector, which is then input into a preset prediction model to obtain a prediction score. The prediction score accurately reflects the similarity between the candidate query graph and the question. By sorting the prediction scores, an accurate question query graph can be obtained, further improving the accuracy of the response.

[0033] In one possible design, the process of parsing the problem to obtain the entity list, type list, constraint list, and attribute value list corresponding to the problem includes:

[0034] The question is input into a preset extraction model, and the corresponding ordinary entity, topic entity, type, and attribute value are obtained based on the output.

[0035] Link the set of ordinary entities and the set of topic entities with a preset knowledge graph, and determine the entity list corresponding to the question in the preset knowledge graph;

[0036] Link the type with the preset knowledge graph, and determine the list of types corresponding to the question in the preset knowledge graph;

[0037] Based on the attribute values ​​and preset matching rules, determine the constraint list and attribute value list.

[0038] Here, in this embodiment of the application, the problem is obtained by first extracting the ordinary entities, topic entities, types, and attribute values ​​corresponding to the problem through a preset extraction model. Then, the entities and types are linked to a preset knowledge graph to obtain the entities in the knowledge graph related to the problem. Then, according to the attribute values ​​and preset matching rules, the constraint list and attribute value list are determined. This can accurately extract the content in the problem and accurately determine the entity list, type list, constraint list, and attribute value list related to the problem, which is convenient for subsequent problem response processing.

[0039] In one possible design, before inputting the problem into the preset extraction model, the following is also included:

[0040] Multiple question extraction training samples are obtained, and the multiple question extraction training samples are labeled. The labels include ordinary entities, topic entities, types, and attribute values.

[0041] The training samples with labeled questions are input into the extraction model for training, resulting in a preset extraction model.

[0042] Here, this application embodiment uses a model to identify ordinary entities, subject entities, types, and attribute value references in the problem, which can quickly and accurately obtain results, further improving response efficiency and user experience.

[0043] Secondly, this application provides a response device, comprising:

[0044] The parsing module is used to obtain the problem, parse and process the problem, and obtain the entity list, type list, constraint list and attribute value list corresponding to the problem;

[0045] The classification module is used to input the question into a preset classification model and determine the question type corresponding to the question based on the output result.

[0046] A conversion module is used to convert the question if the question type is not a factual question, to obtain at least one target factual question;

[0047] The generation module is used to generate a question query graph based on the entity list, the type list, the constraint list, the attribute value list, and the at least one target factual question;

[0048] The response module is used to perform a query in a preset knowledge graph based on the question query graph to obtain the response result.

[0049] In one possible design, the question types include factual questions, comparison questions, intersection questions, and yes / no questions;

[0050] The conversion module is specifically used for:

[0051] If the question type is a comparison question, then delete the pronoun phrases in the question and determine the target factual question based on the adjectives in the question;

[0052] If the question type is an intersection question, then the specific intersection phrases in the question are deleted, and at least two target factual questions are obtained based on the subject of the question;

[0053] If the question type is a yes / no question, then the target factual question is determined based on the entities and / or attributes in the question.

[0054] In one possible design, before the classification module inputs the question into a preset classification model and determines the question type based on the output, the above device further includes:

[0055] The first training module is specifically used for:

[0056] Obtain training samples for multiple question types, and label the multiple question type training samples with question types;

[0057] The training samples with labeled question types are input into the classification model for training, resulting in a preset classification model.

[0058] In one possible design, the generation module is specifically used for:

[0059] The beam search algorithm iteratively processes the entity list, the type list, the constraint list, the attribute value list, and the at least one target factual question to obtain multiple candidate query graphs.

[0060] The multiple candidate query graphs are filtered to obtain the question query graph.

[0061] In one possible design, the generation module is further specifically used for:

[0062] Calculate the feature parameters for each candidate query graph, wherein the feature parameters include the similarity between the query graph and the question text, the number of entities in the query graph, the sum of entity link scores, the number of types, the sum of type link scores, the number of constraints, the number of attribute values, the number of hops in the relation path, and the number of answers executed by the query graph;

[0063] Based on the feature parameters, a multidimensional feature vector corresponding to each candidate query graph is obtained;

[0064] The multidimensional feature vector is input into a preset prediction model, and the prediction score of each candidate query graph is obtained based on the output results.

[0065] The question query graph is determined based on the predicted score of each candidate query graph.

[0066] In one possible design, the parsing module is specifically used for:

[0067] The question is input into a preset extraction model, and the corresponding ordinary entity, topic entity, type, and attribute value are obtained based on the output.

[0068] Link the set of ordinary entities and the set of topic entities with a preset knowledge graph, and determine the entity list corresponding to the question in the preset knowledge graph;

[0069] Link the type with the preset knowledge graph, and determine the list of types corresponding to the question in the preset knowledge graph;

[0070] Based on the attribute values ​​and preset matching rules, determine the constraint list and attribute value list.

[0071] In one possible design, before the parsing module inputs the problem into the preset extraction model, the above-mentioned device further includes:

[0072] The second training module is used for:

[0073] Multiple question extraction training samples are obtained, and the multiple question extraction training samples are labeled. The labels include ordinary entities, topic entities, types, and attribute values.

[0074] The training samples with labeled questions are input into the extraction model for training, resulting in a preset extraction model.

[0075] Thirdly, this application provides a response device, comprising: at least one processor and a memory;

[0076] The memory stores computer-executed instructions;

[0077] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the response method as described in the first aspect and various possible designs of the first aspect.

[0078] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the response method described in the first aspect and various possible designs of the first aspect.

[0079] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the response method described in the first aspect and various possible designs of the first aspect.

[0080] The response method, apparatus, and storage medium provided in this application, wherein the method, when responding to a question, can classify and identify the question according to a preset classification model, thereby converting complex questions such as multi-hop relationship questions and constrained questions that are not easy to process directly into factual questions that are easy to process. Then, by combining the entity list, type list, constraint list and attribute value list corresponding to the question obtained by parsing, a question query graph is generated. Based on the question query graph, the corresponding response result can be accurately determined in the knowledge graph, which improves the accuracy and efficiency of the response and further enhances the user experience. Attached Figure Description

[0081] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0082] Figure 1 This is a schematic diagram illustrating an application scenario of the response method according to one or more embodiments of this application;

[0083] Figure 2 A flowchart illustrating a response method provided in an embodiment of this application;

[0084] Figure 3 This application provides a schematic diagram of a problem query.

[0085] Figure 4 This is a schematic diagram of an extended action query provided in an embodiment of this application;

[0086] Figure 5 This is another extended action query diagram provided in the embodiments of this application;

[0087] Figure 6 This application provides a schematic diagram of a connection action query.

[0088] Figure 7 This is a schematic diagram of an aggregation action query provided in an embodiment of this application;

[0089] Figure 8 This is another schematic diagram of an aggregation action query provided in an embodiment of this application;

[0090] Figure 9 A flowchart illustrating another response method provided in an embodiment of this application;

[0091] Figure 10 A schematic diagram of the overall architecture of a response method provided in an embodiment of this application.

[0092] Figure 11 This is a schematic diagram of the structure of a response device provided in an embodiment of this application;

[0093] Figure 12 This is a schematic diagram of the structure of a response device provided in an embodiment of this application.

[0094] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0095] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0096] The terms “first,” “second,” “third,” and “fourth,” etc. (if present), in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0097] Knowledge graphs (KGs), known in library and information science as knowledge domain visualizations or knowledge domain mapping maps, are a series of various graphs that display the development process and structural relationships of knowledge. They use visualization techniques to describe knowledge resources and their carriers, mining, analyzing, constructing, drawing, and displaying knowledge and their interrelationships. Knowledge graphs offer several advantages as a data source: First, higher data accuracy. As a structured data source, knowledge graphs can return more accurate answers to users, removing redundant information. Compared to other search engines that return a document or a webpage, this reduces the time users spend filtering information. Second, more convenient querying. Compared to plain text documents composed of natural language, computers can process structured data more easily. Therefore, compared to traditional intelligent responses based on plain text documents, KBQA can obtain response results more quickly and accurately.

[0098] In KBQA (Knowledge Base Query) technologies, the mainstream industrial application is based on template matching, while academic research primarily focuses on semantic parsing and information retrieval. Template matching offers the advantage of accurate and controllable answers. Semantic parsing, the most widespread and popular method in KBQA, analyzes natural language semantically and transforms it into a semantic representation that the knowledge base can understand, typically manifested as structured queries. Information retrieval methods first extract information from the question, use the knowledge base to obtain candidate answers, and then rank these candidates to obtain the final answer. However, these methods generally only solve simple problems, while practical applications often present many complex problems requiring reasoning to answer. The two most common types of complex problems are: multi-hop relation problems, such as the complex question "Who is the wife of the founder of Company A?", where the subject entity "Company A" and the answer entity are connected through a two-hop relationship of "founder" and "spouse," requiring consideration of longer relational paths to arrive at the correct answer; and constrained problems, such as "Who was the first president of Country B?", where the answer entity, in addition to having a "president" relationship with the entity "Country B," also needs to satisfy the "first" constraint. Multi-hop relationships and constraints can coexist in a problem, making it more complex. In addition, other types of complex problems, i.e., those where the answer is not an entity in the knowledge graph, may involve logic, comparison, and quantitative reasoning. For example, the question "How many rivers flow through country C and country D?" requires first obtaining the rivers flowing through countries C and D separately, and then generating the answer by counting the entities in the intersection of the two sets, which cannot provide a fast and accurate response.

[0099] To address the aforementioned technical issues, this application provides a response method, apparatus, response device, and storage medium. This method is a knowledge graph question-answering method based on deep learning and semantic parsing. When only one response is available, the question is first classified and identified, transforming complex questions into easily processed factual questions. Then, a question query graph is generated by combining semantic parsing. Based on the question query graph, the corresponding response result can be accurately determined in the knowledge graph.

[0100] Exemplary, Figure 1 This is a schematic diagram illustrating an application scenario of a response method according to one or more embodiments of this application. For example... Figure 1 As shown, the above architecture includes user 100 and response device 200.

[0101] In this system, user 100 can interact with response device 200 through the input device of the response device, and send a question to response device 200. After receiving the question, response device 200 responds according to the received question through its internal processor, and can output the response result to the user through the output device, thus realizing human-computer interaction and intelligent response.

[0102] In some embodiments, the responding device 200 can be a display device such as a smart TV or a smart refrigerator, or any smart terminal such as a smartwatch or a smartphone that can interact with the user.

[0103] In some embodiments, the interaction between the user 100 and the response device 200 can be achieved through voice interaction, text interaction, or other means. For example, the response device 200 can obtain the user's question through an input device such as a microphone or keyboard, and output the response result through an output device such as a display screen or a speaker.

[0104] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the architecture of the response system. In other feasible embodiments of this application, the above architecture may include more or fewer components than illustrated, or combine some components, or split some components, or arrange different components, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown can be implemented in hardware, software, or a combination of both.

[0105] Furthermore, the network architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0106] The technical solutions of this application are described below using several embodiments as examples. The same or similar concepts or processes may not be repeated in some embodiments.

[0107] Figure 2 This is a flowchart illustrating a response method provided in an embodiment of this application. The execution entity of this embodiment can be... Figure 1 The responding device 200 in the illustrated embodiment, or the processor of the responding device 200, can have its specific execution entity determined based on the actual application scenario. For example... Figure 2 As shown, the method includes the following steps:

[0108] S201: Obtain the problem, parse and process the problem to obtain the corresponding entity list, type list, constraint list and attribute value list.

[0109] In some embodiments, the problem can be resolved in the following way:

[0110] The problem is input into a preset extraction model, and the output results are used to obtain the common entities, topic entities, types, and attribute values ​​corresponding to the problem. The sets of common entities and topic entities are linked with a preset knowledge graph to determine the entity list corresponding to the problem in the preset knowledge graph. The types are linked with the preset knowledge graph to determine the type list corresponding to the problem in the preset knowledge graph. Based on the attribute values ​​and preset matching rules, the constraint list and attribute value list are determined.

[0111] This application uses a model to identify ordinary entities, subject entities, types, and attribute value references in the problem, which can quickly and accurately obtain results, further improving response efficiency and user experience.

[0112] Optionally, the preset extraction model can be the BERT-CRF model. As a large-scale pre-trained language model, the BERT model can capture semantic information and syntactic structure in the problem and make correct predictions.

[0113] In some embodiments, the training method of the preset extraction model includes: acquiring multiple question extraction training samples and labeling the multiple question extraction training samples, wherein the labels include ordinary entities, topic entities, types and attribute values; inputting the labeled question extraction training samples into the extraction model for training to obtain the preset extraction model.

[0114] In one feasible implementation, an extraction model is first established, consisting of a 12-layer Transformer Encoder and a CRF layer. The output of the previous layer serves as the input to the next layer, and the sequence of labels with the highest probability is obtained as the prediction result. During training, labels are extracted for each character of the question from the training samples, and then encoded into word vectors for input into the extraction model for training.

[0115] In some embodiments, the tag set is {B-ENT, I-ENT, B-TOPIC, I-TOPIC, B-TYPE, I-TYPE, B-ATTR, I-ATTR, O}, where {B(Begin), I(inside), O(Outside)} determines the scope of the mention, and {ENT, TOPIC, TYPE, ATTR} represent whether the mention belongs to a general entity, a topic entity, a type, or an attribute value, respectively. For example, the tagging result for the question "In which year was the TV series F, version E of actor E, released?" is {"B-ENT", "I-ENT", "I-ENT", "O", "O", "B-TYPE", "I-TYPE", "I-TYPE", "B-TOPIC", "I-TOPIC", "I-TOPIC", "I-TOPIC", "O", "O", "O", "O", "O", "O", "O", "O"}.

[0116] Here, in this embodiment of the application, the problem is obtained by first extracting the ordinary entities, topic entities, types, and attribute values ​​corresponding to the problem through a preset extraction model. Then, the entities and types are linked to a preset knowledge graph to obtain the entities in the knowledge graph related to the problem. Then, according to the attribute values ​​and preset matching rules, the constraint list and attribute value list are determined. This can accurately extract the content in the problem and accurately determine the entity list, type list, constraint list, and attribute value list related to the problem, which is convenient for subsequent problem response processing.

[0117] In some possible designs, it is necessary to link the entities, types, and other elements obtained from the pre-defined extraction model to the corresponding nodes in the knowledge graph, thereby finding the entities and types related to the problem in the knowledge graph to form entity lists and type lists. Linking the sets of ordinary entities and topic entities to the pre-defined knowledge graph determines the entity list corresponding to the problem within the pre-defined knowledge graph; similarly, linking types to the pre-defined knowledge graph determines the type list corresponding to the problem within the pre-defined knowledge graph.

[0118] In some embodiments, entity linking includes: for the input question, obtaining a general entity set e and a topic entity set te, and then merging the two sets to obtain the entity set E = {e∪te} in the question. The goal of entity linking is to link entity mentions in the entity set E to entities in the KG. Entity linking consists of two stages: candidate entity generation and candidate entity reordering. For each entity mention, a candidate entity list is first obtained using a pre-constructed "reference-entity" dictionary. Considering that there may be unseen references in real-world applications, entity vectors are pre-generated based on the entity and its description. When a reference does not exist in the dictionary, a pre-trained language model (such as BERT) is used to encode the entity mention and its question context, and the K nearest neighbors with a similarity exceeding a threshold between the reference and the entity vector are selected as candidate entities, where K is any positive integer.

[0119] Optionally, to accelerate the execution of this stage, Facebook AISimilarity Search (FAISS) is used to speed up feature matching. FAISS is an efficient similarity search and clustering algorithm for dense vectors. FAISS is built around an index type that stores a set of vectors and provides a function to perform L2 and / or dot product vector comparisons in the search.

[0120] Optionally, after obtaining candidate entities, multiple question and candidate entity features are extracted and constructed based on the question context and entity attributes. The trained model is then used to score the candidate entities, and finally, the candidate entity with the highest score is taken as the entity linking result. The list of entity linking results is the entity list.

[0121] In some embodiments, type linking includes: for the input question, obtaining a set of type references through a preset extraction model, and the goal of type linking is to link the type references in the question to types in the KB. For example, for the question "What movies has G starred in?", the type t = {"movies"} in the question is obtained and linked to "movies".

[0122] Optionally, a tree-like type structure graph can be constructed based on the entity types in the KB, where coarse-grained types are the parent nodes of fine-grained types. After filtering out coarse-grained types (such as geography and lifestyle) that are often not included in user-input natural language questions, multiple types of different granularities can be obtained. Similar to entity linking, a "reference-type" dictionary can be constructed for these multiple types. Most references can be directly assigned to types using the dictionary. For the remaining references, a fuzzy search can be used to obtain a set of types corresponding to references with similarity higher than a certain threshold. For types with hierarchical relationships in the set, only the type with the highest similarity is retained. Similar to entity linking, the correct type is automatically selected based on other entities in the question during the query graph generation stage.

[0123] In some possible designs, all attribute values ​​obtained through a preset extraction model constitute an attribute value list.

[0124] In some possible designs, attribute values ​​can be filtered and a list of attribute values ​​can be obtained by using preset matching rules.

[0125] It is understood that the preset matching rules here can be determined according to the actual situation, and the embodiments of this application do not impose specific restrictions.

[0126] In some possible designs, the constraint list is determined based on attribute values ​​and preset matching rules, including:

[0127] Constraint types are categorized into extremum constraints (such as "first highest" and "earliest") and range constraints (such as "20 to 22" and "after 2000"). To detect constraints in the problem, a series of matching rules are manually constructed based on the training corpus.

[0128] In some embodiments, for extrema constraints, a series of rules such as "most [adj]" and "number [num][adj]" are defined, and a set of adjectives {"early", "high", "large", ...} is constructed, with numbers ranging from one to ten. For adjectives like "early" and "small", they are mapped to "+1" (meaning ascending order), and for adjectives like "high" and "large", they are mapped to "-1" (meaning descending order). If a rule contains both an adjective and a number, the mapping result of the adjective is multiplied by the number. Using this method, for each extrema constraint matched in the problem, ascending and descending order can be reflected by the sign of the number, the absolute value of the number can reflect the ranking, and the ASC, DESC, and LIMIT keywords of the SPARQL query language can be used for retrieval to obtain a list of constraints.

[0129] In some embodiments, for range constraints such as "1800 square kilometers", "22 years old", etc., for range constraints, if there are two numerical attribute values in the question and the pattern satisfies the specified rules {"A to B", "between A and B",...}, it is regarded as a range constraint of ">A and <B". Additionally, four rule sets are manually constructed, namely {"more than A", "greater than A", "above A",...}, {"below A", "less than A", "below A",...}, {"not exceeding A", "not greater than A",...}, {"not less than A", "not smaller than A", "above A",...}. If there is only a single numerical attribute value in the question, match the context. The constraints that satisfy the above rules are respectively ">A", ">A", "≤A", "≥A", and the constraints that do not satisfy any of the above rules are regarded as "=A", thus obtaining a constraint list.

[0130] S202: Input the question into a preset classification model, and determine the question type corresponding to the question according to the output result.

[0131] In some embodiments, the question types may include factual questions and non-factual questions.

[0132] In some embodiments, the question types may include factual questions, comparison questions, intersection questions, and yes / no questions.

[0133] S203: If the question type is not a factual question, perform transformation processing on the question to obtain at least one target factual question.

[0134] S204: Generate a question query graph according to the entity list, type list, constraint list, attribute value list, and at least one target factual question.

[0135] In some embodiments, a factual question q, an entity list e (where e0 is the subject entity), a type list t, an attribute value list a (non-numerical type, ordinary string), and a constraint list c can be input. The goal at this stage is to generate a list G (|G| ≤ K) of multiple candidate query graphs and the scores of each candidate query graph.

[0136] Optionally, the query graph consists of four types of nodes: constant nodes, variable nodes, answer nodes, and function nodes. Correspondingly, Figure 3 This is a schematic diagram of a question query graph provided by an embodiment of the present application. The corresponding question in the figure is "Who is the director who first filmed the TV series version of 'H'?" For example Figure 3As shown, constant nodes, variable nodes, and answer nodes are all entities, types, or attribute values ​​(numerical and time) existing in the KG. Constant nodes are fixed values, such as "H" and "TV series." Variable nodes and answer nodes are not specified in the query graph, meaning they can be any entity, type, or attribute that satisfies the conditions. Answer nodes are a special type of variable node; the entity, type, or attribute that satisfies the conditions is the answer to the question. Variable nodes and answer nodes are represented by ?y and ?x, respectively. Additionally, a special node, the function node, is designed to indicate the maximum / minimum constraints and range constraints in the question, such as +1. There are two types of edges in the question query graph: predicate edges and function edges. Predicate edges represent KG predicates, such as startup time. Function edges connect function nodes and have no relational meaning. The list of predicate edges between topic nodes and answers is considered the core relation path, and the substructures of nodes connected to the relation path are constraints on that node. For example, in... Figure 3 In this context, the core relationship path is "Director," and the type and start time are constraints on the entity H.

[0137] In some embodiments, generating a problem query graph based on an entity list, a type list, a constraint list, an attribute value list, and at least one target factual question includes: iteratively processing the entity list, type list, constraint list, attribute value list, and at least one target factual question using a beam search algorithm to obtain multiple candidate query graphs; and filtering the multiple candidate query graphs to obtain the problem query graph.

[0138] In some embodiments, beam search is used to iteratively generate a candidate query graph of size N, where N is any positive integer. The initial query graph contains only topic entities. The following three actions are defined to add edges and nodes to the query graph.

[0139] Option 1: Extend actions to expand the core relationship paths in the query graph. (Example) Figure 4 This is a schematic diagram of an extended action query provided in an embodiment of this application, such as... Figure 4 As shown, if the current query graph contains only the topic entity e0, the expansion action will find the relation r linked to e0 in the KG and add it to the path, with the other end of r becoming the answer node ? x. This is an example. Figure 5 This is another extended action query diagram provided in the embodiments of this application, such as... Figure 5 As shown, if the current query graph has an answer node ? x, the expansion operation changes ? x to a variable node ? y. This is achieved by performing the current query graph operation on the KG to find all corresponding entities for ? y in the KG, identifying the relation r that links to one of these entities, and finally connecting r to ? y. The other end of edge r becomes the new answer node ? x.

[0140] Option 2: Connect Action. The connect action connects the entity, type, and attribute values ​​in the question to the subject entity node or the answer node? x, as an example. Figure 6 This is a schematic diagram of a connection action query provided in an embodiment of this application, such as... Figure 6 As shown, we do not consider other variable nodes connected to the relation path here, because they have served as answer nodes in past iterations and the cases connected to that node should have already been considered. We can perform the current query graph to determine possible relationships and treat them as edges. In this step, we can filter out some unreasonable topic entity link results. For example, because the type "TV series" cannot be linked to "H (Qing Dynasty long novel of human relationships)," we can find that the reference to "H" is unlikely to point to that entity.

[0141] Option 3: Aggregation Action. This action queries the query graph for numerical or temporal attributes of the subject or answer entities, such as age or altitude, and adds the attribute nodes and constraints to the query graph. (Example provided). Figure 7 This is a schematic diagram of an aggregation action query graph provided in an embodiment of this application, such as... Figure 7 As shown, similar to the join action, other variable nodes in the relation path are not considered when joining.

[0142] Optionally, for aggregation actions, consider the special case where there are no subject entities in the question. In this case, to limit the search space, the initial query graph includes answer nodes and their type constraints. Exemplary, Figure 8 This is another schematic diagram of an aggregation action query provided in an embodiment of this application, such as... Figure 8 As shown, for this query graph, the expansion action converts the answer node into a variable node and adds new edges and answer nodes. The connection action and aggregation operation are the same as in the general case, but the new nodes and edges can only be connected to the answer node.

[0143] In some embodiments, a list of candidate query graphs can be generated using the three optional methods described above. Assume that the t-th iteration produces N query graphs, denoted as Gt. In the (t+1)-th iteration, for each g∈Gt, the three actions defined above are applied to expand the query graph. The list of candidate query graphs represents the set of all resulting query graphs. Then, a prediction model can be used to score all candidate query graphs, and the top N candidate query graphs with the highest scores are used to participate in the next iteration. Iteration stops when the relation path reaches the maximum hop count or no query graph has a score higher than any query graph from the previous iteration.

[0144] Here, in this embodiment of the application, candidate query graphs are generated iteratively by beam search, which can find all query graphs related to the question, and then filter them to obtain the question query graph that is closest to the question, thereby obtaining an accurate response result based on the question query graph.

[0145] In some embodiments, filtering multiple candidate query graphs to obtain a question query graph includes: calculating feature parameters for each candidate query graph, wherein the feature parameters include the similarity between the query graph and the question text, the number of entities in the query graph, the sum of entity link scores, the number of types, the sum of type link scores, the number of constraints, the number of attribute values, the number of hops in the relationship path, and the number of answers executed by the query graph; obtaining a multi-dimensional feature vector corresponding to each candidate query graph based on the feature parameters; inputting the multi-dimensional feature vector into a preset prediction model, obtaining a prediction score for each candidate query graph based on the output; and determining the question query graph based on the prediction score of each candidate query graph.

[0146] Optionally, nine features are constructed for each candidate query graph: similarity between the query graph and the question text, number of entities in the query graph, sum of entity link scores, number of types, sum of type link scores, number of constraints, number of attribute values, number of hops in the relational path, and number of answers executed in the query graph. These features are concatenated to obtain a 9-dimensional feature vector, which is then input into a shallow feedforward neural network. Finally, an activation function is applied to obtain a score from 0 to 1. The training problem is treated as a ranking problem. Assuming that each question has several candidate query graphs, they are ranked according to their corresponding answer's F1 score. The goal is that the higher the F1 score of the query graph, the higher the score predicted by the model. The F1 score of the query graph is used as a reward, and reinforcement learning is used for training, enabling the model to select the correct query graph (the question query graph) from multiple candidate query graphs.

[0147] Here, in this embodiment of the application, nine features are constructed for each candidate query graph: similarity between the query graph and the question text, number of entities in the query graph, sum of entity link scores, number of types, sum of type link scores, number of constraints, number of attribute values, number of hops in the relationship path, and number of answers executed by the query graph. These features are concatenated to obtain a multi-dimensional feature vector, which is then input into a preset prediction model to obtain a prediction score. The prediction score accurately reflects the similarity between the candidate query graph and the question. By sorting the prediction scores, an accurate question query graph can be obtained, further improving the accuracy of the response.

[0148] S205: Based on the question query graph, perform a query in the preset knowledge graph to obtain the response results.

[0149] In step S204, the query graph with the highest score after multiple iterations is obtained as the question query graph. The question query graph is converted into the query language corresponding to the knowledge graph, which can be executed in KB to obtain the set of answers.

[0150] In the question-answering process of this application, the question can be classified and identified according to a preset classification model. For complex questions such as multi-hop relationship questions and constrained questions that are not easy to handle directly, the question can be converted into a factual question that is easy to handle. Then, by combining the entity list, type list, constraint list and attribute value list corresponding to the question obtained by parsing, a question query graph is generated. Based on the question query graph, the corresponding answer result can be accurately determined in the knowledge graph, which improves the accuracy and efficiency of the answer and further enhances the user experience.

[0151] In some embodiments of this application, a preset classification model can be established in advance, and correspondingly, Figure 9 A flowchart illustrating another response method provided in this application embodiment is shown below. Figure 9 As shown, the method includes:

[0152] S901: Obtain the problem, parse and process the problem to obtain the corresponding entity list, type list, constraint list and attribute value list.

[0153] S902: Obtain training samples for multiple question types and label the training samples for multiple question types; input the labeled training samples for question types into the classification model for training to obtain the preset classification model.

[0154] In some embodiments, the question types in the training samples can be pre-labeled to obtain a pre-defined classification model. A BiLSTM model is used to encode the questions, and the last hidden layer representation is used as the vector representation of the questions. Subsequently, a single-layer perceptron model is used to classify the questions.

[0155] S903: Input the question into the preset classification model and determine the question type based on the output.

[0156] S904: If the problem type is not a factual problem, then the problem is transformed to obtain at least one target factual problem.

[0157] In one possible design, the problem types include factual problems, comparison problems, intersection problems, and yes / no problems; the problems are transformed to obtain at least one target factual problem, including:

[0158] If the question type is a comparison question, delete the pronoun phrases in the question and determine the target factual question based on the adjectives in the question; if the question type is an intersection question, delete the specific intersection phrases in the question and obtain at least two target factual questions based on the subject in the question; if the question type is a yes / no question, determine the target factual question based on the entities and / or attributes in the question.

[0159] Exemplarily, Table 1 is a schematic table for question transformation. In some embodiments, the optional ways to transform other types of questions into fact-based questions are as follows:

[0160] For comparative questions, first remove the pronoun phrases in the question, such as "which" and "whose", then extract the comparative adjectives or adjectives in the question using rules and词性标注 (it seems there is a mistake here, should be "positional tagging"), and replace them with the form of "how + adjective". Finally, replace the subject "subject(1)……subject(2)" with subject(1) and subject(2) respectively to form two sub-questions, such as Examples ② and ③.

[0161] For intersection questions, first remove the specific phrases in the question, such as "together" and "jointly", then replace the subject "subject(1)……subject(2)" with subject(1) and subject(2) respectively to form two sub-questions, such as Examples ④ and ⑤.

[0162] For yes / no questions, if there is only an entity in the question, obtain the type of a certain entity in the question from the KG, and replace the entity with "what + type", and finally remove the interrogative word "right" at the end. If the entity is not labeled with a type in the KG, directly use the interrogative word "what". For example, if China has no type annotation, Example ⑥ will be changed to "What is the capital of U". If there is an entity and a single attribute value in the question, replace the attribute value with "what", and remove the interrogative word "right" at the end, as shown in Example ⑧.

[0163]

[0164]

[0165] Table 1 Schematic Table for Question Transformation

[0166] Among them, in the question classification of the embodiments of the present application, the question types are divided into fact-based questions, comparative questions, intersection questions, and yes / no questions. Here, the fact-based questions are questions that are easy to process for answering, and other types of questions are not easy to answer quickly. Therefore, based on different question types, different transformation methods are provided, and the questions are transformed according to the different characteristics of comparative questions, intersection questions, and yes / no questions, so as to obtain more accurate target fact-based questions, further improving the accuracy of answering and enhancing the user experience.

[0167] S905: Generate a question query graph according to the entity list, type list, constraint list, attribute value list, and at least one target fact-based question.

[0168] S906: Query in the preset knowledge graph according to the question query graph to obtain the answer result.

[0169] The implementation processes of steps S901 and S905-S306 are similar to those of steps S201 and S204-S205, and will not be described in detail here.

[0170] This application embodiment can utilize a large number of question type training samples labeled with question type to train a classification model, thereby obtaining accurate weights for the classification model. By inputting a question into the pre-trained model, the question type can be quickly obtained, improving the efficiency of question classification and conversion, further enhancing the efficiency and accuracy of intelligent response, and improving the user experience.

[0171] In some embodiments, Figure 10 This is a schematic diagram of the overall architecture of a response method provided in an embodiment of this application, as shown below. Figure 10 As shown, the architecture can be divided into problem preprocessing ( Figure 10 The process involves three stages: problem analysis, problem classification and factual questions and annotation, query graph generation, and answer generation.

[0172] Optionally, in the question preprocessing stage, questions can be parsed based on question syntax and pre-trained language models, linking entities, types, and other elements to the corresponding nodes in the knowledge graph, and transforming complex questions into factual questions.

[0173] Optionally, in the query graph generation stage, the idea of ​​beam search can be used to iteratively generate candidate query graphs and sort query graphs based on the knowledge graph, thereby continuously expanding the edges and nodes in the query graph to obtain the final executable query graph.

[0174] Optionally, in the answer generation stage, the answers to multiple factual questions can be combined and transformed according to the type of the original question to generate the final answer.

[0175] Figure 11 This is a schematic diagram of the structure of a response device provided in an embodiment of this application, as shown below. Figure 11 As shown, the apparatus in this embodiment includes: a parsing module 1101, a classification module 1102, a conversion module 1103, a generation module 1104, and a response module 1105. The response device here can be the aforementioned response device 200 itself, or a chip or integrated circuit that implements the functions of the response device 200. It should be noted that the division of the parsing module 1101, classification module 1102, conversion module 1103, generation module 1104, and response module 1105 is only a logical functional division; physically, they can be integrated or independent.

[0176] The parsing module is used to obtain the question, parse and process the question, and obtain the entity list, type list, constraint list and attribute value list corresponding to the question.

[0177] The classification module is used to input questions into a preset classification model and determine the question type based on the output results.

[0178] The transformation module is used to transform the question if the question type is not a factual question, so as to obtain at least one target factual question;

[0179] The generation module is used to generate a question query graph based on a list of entities, a list of types, a list of constraints, a list of attribute values, and at least one target factual question.

[0180] The response module is used to query a preset knowledge graph based on the question query graph and obtain the response results.

[0181] In one possible design, the question types include factual questions, comparison questions, intersection questions, and yes / no questions;

[0182] The conversion module is specifically used for:

[0183] If the question type is a comparison question, delete the pronoun phrases in the question and determine the target factual question based on the adjectives in the question;

[0184] If the question type is an intersection question, then the specific intersection phrases in the question are deleted, and at least two target factual questions are obtained based on the subject in the question;

[0185] If the question type is a yes / no question, then the target factual question is determined based on the entities and / or attributes in the question.

[0186] In one possible design, before the classification module inputs the question into a preset classification model and determines the question type based on the output, the aforementioned device further includes:

[0187] The first training module is specifically used for:

[0188] Obtain training samples for multiple question types and label the training samples for multiple question types with question types;

[0189] The training samples with labeled question types are input into the classification model for training, resulting in a preset classification model.

[0190] In one possible design, the generation module is specifically used for:

[0191] The beam search algorithm iteratively processes the entity list, type list, constraint list, attribute value list, and at least one target factual question to obtain multiple candidate query graphs.

[0192] The multiple candidate query graphs are filtered to obtain the question query graph.

[0193] In one possible design, the generation module is also specifically used for:

[0194] Calculate the feature parameters for each candidate query graph, including the similarity between the query graph and the question text, the number of entities in the query graph, the sum of entity link scores, the number of types, the sum of type link scores, the number of constraints, the number of attribute values, the number of hops in the relational path, and the number of answers executed by the query graph.

[0195] Based on the feature parameters, a multidimensional feature vector corresponding to each candidate query graph is obtained;

[0196] The multidimensional feature vector is input into the preset prediction model, and the prediction score of each candidate query map is obtained based on the output results;

[0197] The question query graph is determined based on the predicted score of each candidate query graph.

[0198] In one possible design, the parsing module is specifically used for:

[0199] Input the question into the preset extraction model, and obtain the corresponding ordinary entity, topic entity, type and attribute value based on the output;

[0200] Link the collection of ordinary entities and topic entities with the preset knowledge graph, and determine the list of entities corresponding to the problem in the preset knowledge graph;

[0201] Link the types to the preset knowledge graph, and determine the list of types corresponding to the questions in the preset knowledge graph;

[0202] Based on the attribute values ​​and preset matching rules, determine the constraint list and attribute value list.

[0203] In one possible design, before the parsing module inputs the problem into the preset extraction model, the above-mentioned device further includes:

[0204] The second training module is used for:

[0205] Multiple question extraction training samples are obtained, and the multiple question extraction training samples are labeled. The labels include ordinary entities, topic entities, types, and attribute values.

[0206] The training samples with labeled questions are input into the extraction model for training, resulting in a preset extraction model.

[0207] Figure 12 A response device provided in this application embodiment (which can be...) Figure 1The diagram shows the structure of the response device 200. The components shown herein, their connections and relationships, and their functions are merely examples and do not limit the implementation of the present application described and / or required herein.

[0208] like Figure 12 As shown, the response device includes a processor 1201 and a memory 1202. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processor 1201 can process instructions executed within the terminal, including instructions stored in or on memory for displaying graphical information on external input / output devices (such as display devices coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory sets, if desired. Figure 12 Take a processor 1201 as an example.

[0209] Memory 1202, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions / modules corresponding to the method of the response device in the embodiments of this application (e.g., appendix). Figure 11 The parsing module 1101, classification module 1102, conversion module 1103, generation module 1104, and response module 1105 are shown. The processor 1201 executes various functional applications and data processing of the response device by running non-transient software programs, instructions, and modules stored in the memory 1202, thereby implementing the method of the response device in the above method embodiment.

[0210] The response device may further include an input device 1203 and an output device 1204. The processor 1201, memory 1202, input device 1203, and output device 1204 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.

[0211] Input device 1203 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the response device, such as a touch screen, keypad, mouse, or multiple mouse buttons, trackball, joystick, etc. Output device 1204 can be an output device such as a display device of the response device. This display device can include, but is not limited to, liquid crystal displays (LCDs), light-emitting diode (LED) displays, and plasma displays. In some embodiments, the display device can be a touch screen.

[0212] The response device in this application embodiment can be used to execute the technical solutions in the above-described method embodiments of this application. Its implementation principle and technical effect are similar, and will not be repeated here.

[0213] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement any of the above-described response methods.

[0214] This application also provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the response method described above.

[0215] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0216] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0217] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0218] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method of responding, c h a r a c t e r i z e d b y, The method comprises the following steps: acquiring a question, performing analysis processing on the question to obtain an entity list, a type list, a constraint list and an attribute value list corresponding to the question; inputting the question into a preset classification model to determine a question type corresponding to the question according to an output result; the question type comprises a fact type question and a non-fact type question, and the non-fact type question comprises a comparison type question, an intersection type question and a yes / no type question; if the question type is not the fact type question, performing conversion processing on the question to obtain at least one target fact type question; performing iterative processing on the entity list, the type list, the constraint list, the attribute value list and the at least one target fact type question by using a beam search algorithm to obtain a plurality of candidate query graphs; calculating a characteristic parameter of each candidate query graph, wherein the characteristic parameter comprises a query graph and question text similarity, an entity quantity in the query graph, an entity link score sum, a type quantity, a type link score sum, a constraint quantity, an attribute value quantity, a relationship path hop quantity and an answer quantity of query graph execution; obtaining a multi-dimensional feature vector corresponding to each candidate query graph according to the characteristic parameter; inputting the multi-dimensional feature vector into a preset prediction model to obtain a prediction score of each candidate query graph according to an output result; determining a question query graph according to the prediction score of each candidate query graph; performing query in a preset knowledge graph according to the question query graph to obtain a response result; the conversion processing on the question to obtain the at least one target fact type question comprises: if the question type is the comparison type question, deleting a pronoun phrase in the question and determining a target fact type question according to an adjective in the question; if the question type is the intersection type question, deleting a specific intersection phrase in the question and obtaining at least two target fact type questions according to a subject in the question; if the question type is the yes / no type question, determining a target fact type question according to an entity and / or attribute in the question.

2. The method of claim 1, wherein, Before the inputting of the question into the preset classification model and the determination of the question type corresponding to the question according to the output result, the method further comprises the following steps: acquiring a plurality of question type training samples and performing question type labeling on the plurality of question type training samples; inputting the question type training samples carrying the labeled question type into a classification model for training to obtain the preset classification model.

3. The method according to claim 1 or 2, characterized in that, the analysis processing on the question to obtain the entity list, the type list, the constraint list and the attribute value list corresponding to the question comprises: inputting the question into a preset extraction model to obtain common entities, theme entities, types and attribute values corresponding to the question according to an output result; linking a set of the common entities and the theme entities with a preset knowledge graph to determine an entity list corresponding to the question in the preset knowledge graph; linking the types with the preset knowledge graph to determine a type list corresponding to the question in the preset knowledge graph; determining a constraint list and an attribute value list according to attribute values and a preset matching rule.

4. The method of claim 3, wherein, Before the problem is input to the preset extraction model, further comprising: Obtaining a plurality of question extraction training samples, and labeling the plurality of question extraction training samples, wherein the labels include ordinary entities, topic entities, types, and attribute values; Inputting the question extraction training samples with label annotations into an extraction model for training to obtain a preset extraction model.

5. A response device, characterized in that Comprise: The analysis module is used to acquire a question, and the question is analyzed and processed to obtain an entity list, a type list, a constraint list, and an attribute value list corresponding to the question; The classification module is used to input the question into a preset classification model, and determine a question type corresponding to the question according to an output result; The conversion module is used to convert the question if the question type is not a fact type question, and obtain at least one target fact type question; The generation module is used to generate a question query graph according to the entity list, the type list, the constraint list, the attribute value list, and the at least one target fact type question; The response module is used to query in a preset knowledge graph according to the question query graph, and obtain a response result; The question type includes a fact type question and a non-fact type question, and the non-fact type question includes a comparison type question, an intersection type question, and a yes / no type question; The conversion module is specifically used to delete a pronoun phrase in the question if the question type is the comparison type question, and determine a target fact type question according to an adjective in the question; If the question type is the intersection type question, a specific intersection phrase in the question is deleted, and at least two target fact type questions are obtained according to a subject in the question; If the question type is the yes / no type question, a target fact type question is determined according to an entity and / or attribute in the question; The generation module is specifically used to perform iterative processing on the entity list, the type list, the constraint list, the attribute value list, and the at least one target fact type question by a beam search algorithm to obtain a plurality of candidate query graphs; calculate a feature parameter of each candidate query graph, wherein the feature parameter includes a query graph and a question text similarity, an entity quantity in the query graph, an entity link score sum, a type quantity, a type link score sum, a constraint quantity, an attribute value quantity, a relationship path hop count, and an answer quantity of query graph execution; obtain a multi-dimensional feature vector corresponding to each candidate query graph according to the feature parameter; Input the multi-dimensional feature vector into a preset prediction model, and obtain a prediction score of each candidate query graph according to an output result; and determine a question query graph according to the prediction score of each candidate query graph.

6. A responding device, characterized by Comprise: At least one processor; And The memory is in communication connection with the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the responding method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Knowledge graph common sense question and answer method and system based on staged query

    CN112989005A