A method for solving reasoning question answering of comparison questions in text data

By transforming the general map into attribute enhancement map, combining template matching and NLP word segmentation, the lack of expansion in the reasoning question-and-answer in the general knowledge graph is solved, and automated and efficient answers to comparison questions are realized.

CN115269793BActive Publication Date: 2025-08-12中电莱斯信息系统有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210824257.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-14
Publication Date
2025-08-12
Estimated Expiration
2042-07-14

AI Technical Summary

Technical Problem

The existing technology is weak in solving inference questions and answers in the general knowledge graph, relies on a large amount of manpower and prior knowledge, and lacks effective systematic methods.

Method used

By transforming the general map into attribute enhancement map, using template matching and NLP word segmentation, distinguishing relationship types, and generating inference results through knowledge feedback and key-value memory networks, we realize automatic answers to comparative questions.

Benefits of technology

It improves the efficiency and adaptability of inference questions in comparison questions, reduces the dependence on manpower and prior knowledge, and provides a more flexible map transformation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269793B_ABST
    Figure CN115269793B_ABST
Patent Text Reader

Abstract

The present invention provides a method for solving reasoning questions and answers of comparison-type problems in text data, comprising: 1. Automatically or semi-automatically transforming a general graph by distinguishing relationship categories, and constructing a knowledge graph into a graph with attribute relationships and association-type relationships prominently marked. At this time, the knowledge system structure is strengthened, providing the basic conditions for answering "comparison-type problems". In "comparison-type problems", the part used for comparison often exists as an attribute. The present invention can take advantage of the graph structure design to obtain the reasoning results of comparison-type problems and define it as an attribute-enhanced graph. 2. In the attribute-enhanced graph described in 1, attributes and relationships are often not single. In the present invention, a new knowledge feedback scheme is provided. This mapping scheme can map the knowledge in the attribute-enhanced graph, and apply a key-value memory network to obtain answers to such questions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graphs and intelligent question answering, and in particular relates to a method for solving reasoning questions and answers about comparison problems in text data. Background Art

[0002] 1. Relationship Type Classification

[0003] In general knowledge graphs, relationship types are divided into three types:

[0004] (1) Attribute type, such as "Xiaoming-Height->173cm";

[0005] (2) Relational, such as “Xiao Ming - graduated from -> XX University”;

[0006] (3) Factual type, such as “(Nanjing->Subway Line->2)-Statistics in->2008”.

[0007] 2. Classification of Reasoning Problems

[0008] Knowledge reasoning refers to the process of machine thinking and problem solving in a computer based on knowledge identification, that is, the process of drawing a conclusion based on one or more premises.

[0009] In the process of knowledge reasoning, there are mainly the following types of problem classification.

[0010] In the process of knowledge question-answering reasoning, when the reasoning is only a simple connection, it is divided into two types.

[0011] (1) One is to use basic attributes as the purpose. For example, when the question contains "Yao Mou", the answer results will be his date of birth, height, etc.

[0012] (2) One is based on the entity as the purpose, such as "What delicious food is there near XXX station?" "Where is the nearest hospital?" "Who is XXX's wife?" The search purpose in this case is the entity itself.

[0013] When the reasoning questions and answers are complex, the search paths will be quite different depending on the question type.

[0014] (3) Typical examples include comparative questions, such as “Who are taller than Xiao Ming?” and “Which city has more subways, Nanjing or Guangzhou, in 2021?”

[0015] (4) And more complex search possibilities. For example, "Who can I contact Yao through?" "Who in our company can help me solve the reimbursement problem?"

[0016] Simple connection problems (1) and (2) can be answered through simple association. Complex reasoning (4) relies on research to simplify and define the problem. Currently, reasoning for comparison problems based on general graphs is often performed through template matching, which has weak scalability, relies on a large amount of manpower and prior knowledge, and relies on regular professional graphs.

[0017] 3. Reasoning Classification

[0018] Classified by methodology, it can be divided into pure formal reasoning, knowledge-based reasoning, statistical reasoning, and intuitive reasoning.

[0019] Classification by reasoning method. It can be divided into deductive reasoning, inductive reasoning, and analogical reasoning.

[0020] Classified by certainty. It is divided into deterministic reasoning and uncertain reasoning.

[0021] Classification by reasoning strategy: It can be divided into forward reasoning, backward reasoning, mixed reasoning, and meta-reasoning.

[0022] Classification of knowledge expression methods: divided into graph search method and logical theory method.

[0023] Classification through heuristic knowledge utilization. It is divided into heuristic reasoning and non-heuristic reasoning. Summary of the Invention

[0024] Purpose of the invention: The purpose of the present invention is to enhance the ability to answer "comparison questions" in graph reasoning question answering. The present invention specifically provides a method for answering comparison questions in text data, comprising the following steps:

[0025] Step 1: Transform the general graph into an attribute-enhanced graph;

[0026] Step 2: For comparison questions, use template matching and NLP word segmentation and part-of-speech matching to determine the comparison questions and related comparison attributes, and simplify the comparison questions;

[0027] Step 3: Feedback the attribute comparison to the entity comparison through the knowledge feedback method; at the same time, use the knowledge forward and reverse, active and passive to expand the binary group and generate the key-value hash memory space;

[0028] Step 4: Use the key-value memory method to obtain the problem reasoning results.

[0029] Step 1 includes:

[0030] Step 1-1: If the graph organization form is a graph database, organize the general graph into triples through graph traversal. If the graph organization form is triples, no transformation is performed.

[0031] Step 1-2, perform part-of-speech screening on the relationship types of triples, and then perform partial manual reorganization to distinguish entity-type relationships, fact-type relationships, and attribute-type relationships. The key to this part is the relationship words (that is, the normalized mapping of predicate verbs or relationship words). For example, in the interpersonal relationship graph, the predicates "born in" and "born in" have the direction of attribute-type relationships, while "friends", "classmates", "teaching" and other words have the direction of entity-type relationships. When studying a specific field graph, the relationship words are often small and limited (in the largest unit of thousands). For example, in the interpersonal relationship graph, use words such as "friends, couples, teachers and students, teaching, besties, parents" to screen key sentences, and use syntactic dependencies to find the corresponding entity relationships and organize them into an entity relationship network;

[0032] Steps 1-3 are the same as steps 1-2, but use different predicate matching methods to simplify and integrate factual relationships into triples of [phrase, relationship, attribute] or [phrase, relationship, entity]. In this case, factual relationships can be converted into attribute relationships or entity relationships, except that the entity is the phrase itself.

[0033] Steps 1-4 map attribute relationships. Using an attribute relationship vocabulary, attribute relationships are mapped and distinguished from entity relationships. The attribute relationship vocabulary requires semi-automatic verb extraction and manual screening based on relevant business objectives. For example, using the interpersonal relationship graph, the attribute relationship words to be summarized are only related to people, including "height, weight, age, birthplace, phone number, gender, occupation," and the corresponding predicate word set includes "height, weight, weight, years old, years old in years, lunar years, born in, born in, phone number, male, female, engaged in, employed," and so on. After filtering out key sentences, the corresponding attribute relationships are extracted using syntactic dependencies.

[0034] Steps 1-5 are to reorganize the graph to obtain an attribute-enhanced graph. The reorganized graph is characterized by distinguishing the relationship RP (relation property) between attributes and entities and the relationship RL (relation link) between entities, and specially marking them.

[0035] In step 2, the comparison type sentence is determined by matching the vocabulary of comparison conjunctions (such as "than, which one is more, more"); through NLP part-of-speech analysis, noun words and verb-object phrases in the sentence are obtained as comparison subjects, and adjectives are obtained as comparison keywords through part-of-speech screening. The comparison subjects and comparison keywords are directly combined to simplify comparison problems.

[0036] Step 3 includes:

[0037] Step 3-1: Determine any two triples of the same attribute type (s1, p1, o1) and (s2, p2, o2) in the attribute enhancement graph, for example (A, height, 166) (B, height, 172);

[0038] Step 3-2: For the comparison content of attributes o1 and o2, as relation p3, for example, "166 is shorter than 172";

[0039] Step 3-3: Through relation feedback, that is, the comparison of attributes is fed back to the entity, a new triple (s1, p3, s2) is obtained, for example (A, shorter than, B);

[0040] Step 3-4: Obtain one or more inverse relations (s2, p4, s1) through the antonym table, for example (B, higher than, A);

[0041] Step 3-5, use s+p as k to obtain the associated pair (k, v). Explain with an example, it is (A is lower than B) (B is higher than A);

[0042] In step 3-6, the master is transformed to obtain (k', v), which can be explained as (higher than A, B) and (shorter than B, A) using examples.

[0043] The method used by the present invention is: 1. By distinguishing the relationship categories, the general graph is automatically or semi-automatically transformed to construct the knowledge graph into a graph with attribute relationships and association class relationships clearly marked. At this time, the knowledge system structure is strengthened, providing the basic conditions for answering "comparison type questions". In "comparison type questions", the part used for comparison often exists as an attribute. The present invention can take advantage of the graph structure design to obtain the reasoning results of comparison type questions and define it as an attribute enhanced graph. 2. In the attribute enhanced graph described in 1, the attributes and relationships are often not single. In the present invention, a new knowledge feedback scheme is provided. This mapping scheme can map the knowledge in the attribute enhanced graph and apply the key-value memory network to obtain the answer to such questions.

[0044] The principle of the present invention is:

[0045] (1) In the question conversion part: the present invention uses template matching and NLP to determine comparison questions and related comparison attributes.

[0046] (2) Attribute enhancement graph part: The present invention adopts an “entity->attribute relationship” mapping table, distinguishes attribute types through mapping matching, and adjusts the general graph into an attribute enhancement graph.

[0047] (3) In the knowledge feedback part: the present invention adopts the knowledge feedback transformation method to finally map the comparison questions into key-value pairs, and finally enter the knowledge reasoning process of key-value memory.

[0048] Compared with the prior art, the present invention has the following significant advantages:

[0049] (1) Currently, reasoning about comparison questions based on general graphs is often performed through template matching, which is not very scalable and relies on a lot of manpower and prior knowledge, as well as on standardized professional graphs. However, this invention can transform graphs in a wide range of fields, making the newly created graphs more convenient for reasoning and answering comparison questions.

[0050] (2) Currently, there is no systematic way to convert “comparison questions” into phrase key-value pairs. The present invention will provide a method for converting “comparison questions” into phrase key-value pairs, which can adapt to the attribute enhancement graph proposed in the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more apparent.

[0052] Figure 1 It is a specific flow chart of the present invention.

[0053] Figure 2 It is a schematic diagram of the attribute enhancement graph generation process in the present invention.

[0054] Figure 3 This is a schematic diagram of the basic framework of key-value memory reasoning under attribute enhancement.

[0055] Figure 4 This is a schematic diagram of an example of an enhanced graph structure. DETAILED DESCRIPTION

[0056] The present invention provides a method for solving reasoning questions and answers about comparison problems in text data, comprising:

[0057] Step 1: Transform the general graph into an attribute-enhanced graph;

[0058] Step 2: Determine and filter the comparison questions. The present invention uses template matching, NLP word segmentation, and part-of-speech matching to determine the comparison questions and related comparison attributes.

[0059] Step 3: Feedback the attribute comparison to the entity comparison through the knowledge feedback method; at the same time, use the knowledge forward and reverse, active and passive to expand the tuple and generate the key-value hash memory space.

[0060] Step 4: Use the key-value memory method to obtain the problem reasoning results.

[0061] Specific steps are as follows Figure 1 shown.

[0062] In step 1, the general knowledge graph is semi-automatically transformed. The core purpose of the transformation is to distinguish the types of relationships. For the construction of the target graph, the early stage relies on manual induction of attribute relationships. For example, the attribute relationship of a person may include (height, weight, date of birth...) and so on. Through matching and labeling methods, attributes and relationship types are distinguished. For factual relationships, such as "(Nanjing->Subway Line->2)-Statistics in->2008", it is converted into phrases and attributes, such as "2008 Nanjing-Subway Line->2" or "Nanjing 2 Subway Lines-Time->2008". The specific steps are as follows:

[0063] Organize the general graph into triples;

[0064] The fact class relationship is simplified and integrated into a triple of [phrase, relationship, attribute] or [phrase, relationship, entity]. At this time, the fact class relationship can be used as an attribute relationship or an entity relationship, and the knowledge entity is the phrase itself.

[0065] Map attribute class relationships. Map attribute class relationships through attribute class relationship vocabulary to distinguish the difference between attribute class relationships and relationships between entities.

[0066] Finally, the graph is reorganized to obtain the attribute enhanced graph. The characteristics of the reorganized graph are to distinguish the relationship RP (relation property) between attributes and entities and the relationship RL (relation link) between entities. Examples of enhanced graphs are as follows: Figure 4 shown.

[0067] The specific conversion process is as follows Figure 2 shown.

[0068] As shown in step 2, template matching, NLP word segmentation, and part-of-speech matching are used to identify comparison questions and related comparison attributes, thereby simplifying comparison questions. Comparative sentences are identified by matching the vocabulary of comparative conjunctions (e.g., "than, which one is more, more"). NLP part-of-speech analysis is used to identify nouns and verb-object phrases in the sentence as comparison subjects. Part-of-speech filtering is used to identify adjectives as comparison keywords. These two are then directly combined to simplify comparison questions.

[0069] As shown in step 3, the attribute augmentation graph generated in step 2 accumulates comparison question types. These questions, such as "higher than..." and "heaviest," can now be compared to generate a new comparison relationship. This relationship is then fed back to the entity itself (in this case, the person).

[0070] For the newly generated comparison relationship, the present invention uses a knowledge feedback method to generate a key-value Hash space for the comparison class. At this time, the key-value memory method is used to obtain the result of this question and answer.

[0071] The specific steps of knowledge feedback conversion are as follows:

[0072] (1) Enhance any two triples of the same type of attributes in the graph (s1, p1, o1) (s2, p2, o2), for example (A, height, 166) (B, height, 172)

[0073] (2) The comparison content of attributes o1 and o2 can be used as relation p3, for example, "166 is shorter than 172".

[0074] (3) Through relationship feedback, a new triple (s1, p3, s2) is obtained, for example (A, shorter than, B);

[0075] (4) At the same time, through the antonym table, one or more inverse relations (s2, p4, s1) can be obtained, for example (B, higher than, A).

[0076] (5) Then, using s+p as k, we obtain the associated pair (k, v). Using an example, we can say that (A is lower than B) (B is higher than A).

[0077] (6) At the same time, the master is transformed to obtain (k', v), which can be explained by examples as (higher than A, B) and (shorter than B, A).

[0078] As shown in step 4, the key-value memory method (KVMemNet) is used to obtain the reasoning answer. Figure 3 As shown in the figure, the shaded box portion is the innovative part of the present invention, which specifically includes the following steps:

[0079] Step 4-1, Key Hashing: Key-value hashing transform, converting the knowledge source into the form of (k, v) and selecting a subset from it;

[0080] For the triple (s, p, o), s and p are collectively referred to as k, and o is referred to as v. The subset selection criteria are: 1. k must share words with the input question; 2. The shared words must not be stop words; 3. Sort by the number of shared words and select the top N. Each question requires a key-value memory.

[0081] Combined with step 3, for the question "Athletes taller than A?", the first n data obtained will include (taller than Yi, Yao) (shorter than Yao, Yi) (shorter than Mount Everest, Mount Georgia) (taller than Mount Georgia, Mount Everest)... and so on, key-value pairs with a large number of common words in the first N.

[0082] Step 4-2, Key Addressing: Calculate a probability distribution for all keys in the key value according to the problem The vector space representing the question x (question embedding), Represents the key-value vector space (key embedding) formed by the key values of N key-value spaces, where i represents the i-th key value:

[0083]

[0084] Using the softmax function, we can find the probability of the question falling on a specific key-value pair based on the question and all N key-value pairs. We can also obtain the probability set of the question-to-answer value.

[0085] Step 4-3, Value Reading: Value reading, according to the probability distribution P of the key value N , transform the value vector space (value embedding), where The vector representation of the i-th value in the h-th iteration is used to calculate the weighted vector o of the value:

[0086]

[0087] Step 4-4, Query Updating: Problem space update, according to the probability of the key, calculate the weighted problem of the value, and use the j-th round mapping matrix R j Transform the initial problem vector of this round, q j Represents the initial question vector for round j.

[0088] q j+1 =R j (q j +o)

[0089] After the probability shift, the problem vector will change. Intuitively, the problem may become a shift problem such as (higher than A) or (higher than Georgia), which is expressed in vector form.

[0090] Use q j+1 Replace the problem vector Iterative update, after H steps of iteration, q H+1Input into the classifier and predict the answer:

[0091]

[0092] After the last iteration, the answer to the question with the highest probability can be obtained as the answer for this time.

[0093] In a specific implementation, the present application provides a computer storage medium and a corresponding data processing unit, wherein the computer storage medium is capable of storing a computer program that, when executed by the data processing unit, can execute the invention content of a method for solving reasoning questions and answers about comparison problems in text data provided by the present invention, as well as some or all of the steps in each embodiment. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0094] Those skilled in the art can clearly understand that the technical solutions in the embodiments of the present invention can be implemented by means of computer programs and their corresponding general hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a computer program, i.e., a software product. The computer program software product can be stored in a storage medium and includes several instructions for enabling a device including a data processing unit (which can be a personal computer, a server, a single-chip microcomputer, a MUU, or a network device, etc.) to execute the methods described in various embodiments of the present invention or certain parts of the embodiments.

[0095] The present invention provides a method for solving reasoning questions and answers about comparisons in text data. There are many methods and approaches for implementing this technical solution. The above is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art may make various improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.

Claims

1. A method for solving reasoning questions and answers about comparison problems in text data, characterized in that: The following steps are involved: Step 1: Input text data containing comparison questions and transform the general graph into an attribute-enhanced graph; Step 2: For comparison questions, use template matching and NLP word segmentation and part-of-speech matching to determine the comparison questions and related comparison attributes, and simplify the comparison questions; Step 3: Feedback the attribute comparison to the entity comparison through the knowledge feedback method; at the same time, use the knowledge forward and reverse, active and passive to expand the binary group and generate the key-value hash memory space; Step 4: Use the key-value memory network to obtain the reasoning results of comparison questions in the text data; Step 1 includes: Step 1-1: If the graph organization form is a graph database, organize the general graph into triples through graph traversal. If the graph organization form is triples, no transformation is performed. Steps 1-2: Perform part-of-speech screening and reorganization of the relationship types of triples to distinguish entity-type relationships, fact-type relationships, and attribute-type relationships. Key sentences are selected, and syntactic dependencies are used to find the corresponding inter-entity relationships and organize them into an entity relationship network. Steps 1-3 use different predicate matching methods to simplify and integrate factual relationships into triples of [phrase, relationship, attribute] or [phrase, relationship, entity], so that factual relationships can be converted into attribute relationships or entity relationships, except that the entity is the phrase itself; Steps 1-4: Map attribute relationships. Use the attribute relationship vocabulary to map attribute relationships and distinguish attribute relationships from entity relationships. After selecting key sentences, use the syntactic dependency method to extract the corresponding attribute relationships. Steps 1-5: Reorganize the graph to obtain an attribute-enhanced graph, distinguish the relationship RP between attributes and entities and the relationship RL between entities, and mark them specifically; In step 2, the comparison type sentence is determined by matching the vocabulary of comparative conjunctions. Through NLP part-of-speech analysis, noun words and verb-object phrases in the sentence are obtained as comparison subjects. Adjectives are obtained as comparison keywords through part-of-speech screening. The comparison subjects and comparison keywords are directly combined to simplify comparison problems. Step 3 includes: Step 3-1, determine any two triples of the same type of attributes (s1, p1, o1) and (s2, p2, o2) in the attribute enhancement graph; Step 3-2, for the comparison content of attributes o1 and o2, as relation p3; Step 3-3, through relationship feedback, that is, the comparison of attributes is fed back to the entity, and a new triple (s1, p3, s2) is obtained; Step 3-4, obtain one or more reverse relations (s2, p4, s1) through the antonym table; Step 3-5, use s+p as k to obtain the associated pair (k, v); Step 3-6, the master is transformed to obtain (k', v); Step 4 includes: Step 4-1: key-value hash transformation, converting the knowledge base into the form of association pairs (k, v) and selecting a subset from them; Step 4-2, key addressing; Step 4-3, value reading; Step 4-4, update the problem space; Step 4-1 includes: Form conversion: for the triple (s, p, o), s and p are used as k, and o is used as v; the selected subset meets the following three conditions: First, k has common words with the input question; second, the common words are not stop words; third, sort by the number of common words and select the top N; Each question requires the construction of memory space; Step 4-2 includes: calculating a probability distribution p for all key values according to the problem hi : Among them, Softmax represents the normalized exponential function, represents the vector space of the problem x, The key value vector space formed by the key values of N key value spaces, i ranges from 1 to N; Step 4-3 includes: according to the probability distribution of key values Perform transformation calculation on the vector space of Value, where The vector representation of the i-th value in the h-th iteration is the weighted vector o of the calculated value Value: Step 4-4 includes: after calculating the weighted value of Value according to the probability of the key value, using the j-th round mapping matrix R j Transform the initial problem vector of this round, q j Represents the initial question vector for round j: q j+1 =R j (q j +o) Use q jt1 Replace the vector space of the problem x Where T represents the matrix transpose.

Citation Information

Patent Citations

  • Entity comparison method, device and equipment, and computer readable storage medium

    CN113705236A

  • Relationship extraction method and device fusing relation phrase knowledge, and electronic equipment

    CN113705237A