A knowledge graph-based reading comprehension analysis method

By constructing a knowledge graph-based reading comprehension analysis method, the problem of inaccurate answer prediction in multi-question answering in machine reading comprehension was solved, thereby improving the accuracy of answer prediction.

CN115934962BActive Publication Date: 2025-12-09UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Machine reading comprehension is not accurate enough in predicting the answers to questions in a reading text in multi-question answering scenarios.

Method used

By constructing a knowledge graph-based reading comprehension analysis method, the reading text to be processed is obtained, the sentence knowledge graphs of each sentence to be processed in the main text are determined, and the text knowledge graph is constructed based on logical relation words. For the question stem in the question-and-answer section, the answer-related sentences are determined, and the target answer is determined through answer evaluation attributes.

Benefits of technology

It improves the accuracy of machine reading comprehension in answering multi-question questions in reading text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934962B_ABST
    Figure CN115934962B_ABST
Patent Text Reader

Abstract

The application discloses a kind of reading comprehension analysis methods based on knowledge graph, wherein the method comprises: obtaining to be processed reading text;Determine the sentence knowledge graph corresponding to each to be processed sentence in the text part respectively, and based on each sentence knowledge graph and the logical relationship word between adjacent to be processed sentence, the text knowledge graph corresponding to the text part is constructed;For each question stem in the question and answer part, based on the text knowledge graph, the answer associated sentence associated with the current question stem in the text part is determined;Based on the answer associated sentence, at least one current candidate answer associated with the current question stem is evaluated to determine the target answer based on the corresponding answer evaluation attribute. Solve the problem that machine reading comprehension is not accurate in predicting the answer corresponding to the question in the reading text in polynomial question and answer, and achieve the effect of improving the accuracy of determining the target answer corresponding to the question in the reading text.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine reading comprehension, and in particular to a reading comprehension analysis method based on a knowledge graph. BACKGROUND

[0002] Machine reading comprehension mainly investigates the degree of machine understanding of a given context, and is measured by the accuracy of predicting relevant answers to a question.

[0003] At present, machine reading comprehension is usually based on a pre-training model of word-level semantic embedding to process logical information in reading text, such as extracting noun phrases in reading text as logical symbols, or extracting logical features according to pre-set logical conjunctions. However, such a machine reading comprehension method can obtain a part of the logical relationship corresponding to the reading text, but the overall understanding of the reading text is not accurate enough, resulting in inaccurate prediction of the answers corresponding to the questions in the reading text in multiple-choice question answering.

[0004] In order to solve the above problems, it is necessary to improve the processing method of machine reading comprehension. SUMMARY

[0005] The present application provides a reading comprehension analysis method based on a knowledge graph to solve the problem of inaccurate prediction of answers corresponding to questions in reading text in machine reading comprehension in multiple-choice question answering.

[0006] In a first aspect, the present application provides a reading comprehension analysis method based on a knowledge graph, comprising:

[0007] obtaining a reading text to be processed; wherein the reading text to be processed comprises a text part and a question and answer part, the text part is composed of at least one reading paragraph, each reading paragraph comprises at least one sentence to be processed, the question and answer part comprises at least one question stem and at least one candidate answer associated with each question stem;

[0008] determining the sentence knowledge graph corresponding to each sentence to be processed in the text part, and constructing a text knowledge graph corresponding to the text part based on the logical relationship between each sentence knowledge graph and adjacent sentences to be processed;

[0009] For each question stem in the question and answer part, determine the answer associated sentence associated with the current question stem in the text part based on the text knowledge graph;

[0010] Based on the answer associated sentence, at least one current candidate answer associated with the current question stem is evaluated to determine the target answer based on the corresponding answer evaluation attribute.

[0011] The technical scheme of the embodiment is that a to-be-processed reading text is acquired through text scanning or text importing, and the sentence knowledge graph corresponding to each to-be-processed sentence in the text part is determined, and a text knowledge graph corresponding to the text part is constructed based on the sentence knowledge graph and the logical relation word between adjacent to-be-processed sentences. Through sentence division of the text part, at least one to-be-processed sentence is obtained, and a corresponding sentence knowledge graph is constructed according to the noun entity in each to-be-processed sentence. Further, the text knowledge graph corresponding to the text part of the to-be-processed reading text is constructed according to the sentence knowledge graph and the sentence logical relation between adjacent to-be-processed sentences. For each question stem in the question and answer part, the answer associated sentence associated with the current question stem in the text part is determined based on the text knowledge graph, and the to-be-matched noun entity in the question stem is extracted, and the answer associated sentence corresponding to the to-be-matched noun entity in the text part is determined based on the text knowledge graph. Further, at least one current candidate answer associated with the current question stem is evaluated based on the answer associated sentence to determine the target answer based on the corresponding answer evaluation attribute. The to-be-identified noun entity in each current candidate answer is extracted, and the candidate to-be-matched sentence corresponding to each to-be-identified noun entity in the text part is determined based on the text knowledge graph. The similarity between each candidate to-be-matched sentence and the answer associated sentence is calculated to determine the sentence evaluation attribute of the corresponding candidate to-be-matched sentence, and the answer evaluation attribute of the corresponding current candidate answer is determined based on the sentence evaluation attribute. The current candidate answer corresponding to the highest answer evaluation attribute is determined as the target answer. The problem of inaccurate prediction of the answer corresponding to the question in the reading text in the machine reading comprehension in the polynomial question and answer is solved, and the effect of improving the accuracy of determining the target answer corresponding to the question in the reading text is achieved.

[0012] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0014] Figure 1 is a flowchart of a reading comprehension analysis method based on a knowledge graph according to an embodiment of the present application;

[0015] Figure 2is a flowchart of a knowledge graph-based reading comprehension analysis method according to Embodiment Two of the present application;

[0016] Figure 3 is a schematic diagram of a sentence knowledge graph construction method according to Embodiment Two of the present application;

[0017] Figure 4 is a schematic diagram of a text knowledge graph construction method according to Embodiment Two of the present application;

[0018] Figure 5 is a schematic diagram of a method for determining a candidate answer according to Embodiment Two of the present application. DETAILED DESCRIPTION

[0019] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0021] Before the technical solution is described in detail, the application scenario of the technical solution will be introduced, so as to better understand the technical solution. The accuracy of machine reading comprehension is mainly determined according to the degree of understanding of the machine reading comprehension text, and the accuracy of the answer options corresponding to the reading comprehension questions. It can be understood that in a reading comprehension text, there are usually two parts, namely the text part and the question and answer part, and in the question and answer part, there are at least one question and at least one answer option associated with each question. In order to verify the accuracy of machine reading comprehension, the reading text can be analyzed and processed based on machine reading, and the target answer corresponding to each question can be predicted. Further, according to the accuracy of the target answer as the correct answer, the accuracy of machine reading when reading comprehension is performed can be determined.

[0022] Embodiment One

[0023] Figure 1A flowchart of a reading comprehension analysis method based on a knowledge graph is provided for Embodiment One of the present application. This embodiment can be applied to determine the target answer corresponding to a question in a reading text in a polynomial reading comprehension.

[0024] As shown in Figure 1 , the method comprises:

[0025] S110, obtaining a reading text to be processed.

[0026] The reading text to be processed can be understood as a complete reading comprehension text. The reading text to be processed includes a text part and a question and answer part. The text part is composed of at least one reading paragraph. Each reading paragraph includes at least one sentence to be processed. The question and answer part includes at least one question stem and at least one candidate answer associated with each question stem. The sentence to be processed is a sentence in the text part. For example, each reading paragraph in the text part can be divided into at least one sentence text according to punctuation marks to obtain the sentence to be processed. It can be understood that in the question and answer part of a reading text to be processed, at least one question stem can be included. Each question stem can correspond to at least one candidate answer.

[0027] For example, the text part of the reading text to be processed includes at least one reading paragraph. The question and answer part can include three question stems. Each question stem can correspond to four candidate answers. The reading comprehension method based on the logical knowledge graph provided in this technical solution can analyze the text part to determine the target answer corresponding to each question stem from at least one candidate answer corresponding to each question stem.

[0028] Specifically, when obtaining the reading text to be processed, the reading text to be processed can be obtained by file import or file scanning, or it can also be obtained from a standard data set. For example, at least one reading text can be downloaded from the ReClor data set as the reading text to be processed. For example, the reading text to be processed in the document can be identified by file scanning. The text part of the reading text to be processed can be analyzed and processed based on machine reading to determine the target answer corresponding to each question stem in the question and answer part of the reading text to be processed.

[0029] S120, respectively determining the sentence knowledge graph corresponding to each sentence to be processed in the text part, and constructing a text knowledge graph corresponding to the text part based on the logical relationship words between each sentence knowledge graph and adjacent sentences to be processed.

[0030] The sentence knowledge graph can be understood as a logical knowledge graph based on a noun entity in the to-be-processed sentence as a central node and an entity category of the noun entity as an associated node. In the technical solution, each to-be-processed sentence contains at least one noun entity, and according to each noun entity and the associated entity category, the corresponding sentence knowledge graph corresponding to the to-be-processed sentence can be determined, and then according to each sentence knowledge graph and the sentence logical relationship between adjacent to-be-processed sentences, a text knowledge graph corresponding to the main body of the to-be-processed reading text can be constructed. That is, the text knowledge graph is composed of the sentence knowledge graphs corresponding to each to-be-processed sentence.

[0031] In actual application, when processing the to-be-processed reading text, the main body and the question and answer part of the to-be-processed reading text need to be processed respectively. For the main body, each to-be-processed sentence in at least one reading paragraph in the main body needs to be processed respectively, and a sentence knowledge graph corresponding to each to-be-processed sentence needs to be constructed. It can be understood that there is a certain sentence logical relationship between each to-be-processed sentence, and there is usually a more obvious logical relationship word between two adjacent to-be-processed sentences. Based on the logical relationship word, the sentence logical relationship between adjacent to-be-processed sentences can be determined. For example, the logical relationship word can be a connection symbol, or a relationship connection word, such as “but”, “unless” and “then”, etc. It can be understood that each two adjacent to-be-processed sentences can be connected as a sentence group, and then the main body can be connected, and then a text knowledge graph corresponding to the main body can be constructed according to the sentence knowledge graphs corresponding to each to-be-processed sentence.

[0032] For example, the main body includes to-be-processed sentence 1, to-be-processed sentence 2, to-be-processed sentence 3, to-be-processed sentence 4 and to-be-processed sentence 5, each to-be-processed sentence corresponds to a sentence knowledge graph, which is sentence knowledge graph 1, sentence knowledge graph 2, sentence knowledge graph 3, sentence knowledge graph 4 and sentence knowledge graph 5 respectively. Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Further, according to the logical relationship word between each to-be-processed sentence, the logical association relationship between the corresponding sentence knowledge graphs can be determined, and then each sentence knowledge graph can be connected to obtain a text knowledge graph. Specifically, the text knowledge graph can be a link graph, in which each to-be-processed sentence is a node, and each node includes the corresponding sentence knowledge graph of the to-be-processed sentence, and according to the logical relationship between each to-be-processed sentence, the logical relationship path between the corresponding sentence knowledge graphs is determined, and the text knowledge graph is obtained.

[0033] For example, the text knowledge graph is wherein, ​​​​The sentence logical relationship between adjacent sentences to be processed is represented, and can also be used to represent the logical relationship path between the sentence knowledge graphs.

[0034] In the technical solution, in order to more clearly introduce the technical solution, the sentence knowledge graph corresponding to each sentence to be processed in the text part is determined, including: performing sentence division on the text part to obtain at least one sentence to be processed; based on entity recognition technology, extracting the to-be-used noun entity in each sentence to be processed, and determining the sentence knowledge graph corresponding to the corresponding sentence to be processed based on the to-be-used noun entity.

[0035] The entity recognition technology is an information extraction technology that can obtain entity data such as names and places from text data. In the technical solution, the entity recognition technology is used to extract noun entities in the sentence to be processed. For example, the sentence to be processed is "Xiaoming has two cats", and based on the entity recognition technology, the entity recognition of the sentence to be processed can obtain two noun entities corresponding to the sentence to be processed, namely "Xiaoming" and "cat", and the two noun entities are used as the to-be-used noun entity in the sentence to be processed. That is, the to-be-used noun entity is the noun entity in the sentence to be processed determined based on the entity recognition technology.

[0036] Specifically, when processing the text part, the text part can be divided into sentences, for example, the content of the text part can be punctuated by a natural language processing tool to obtain at least one sentence to be processed. Further, based on the entity recognition technology, the noun entities in each sentence to be processed can be detected to obtain the to-be-used noun entity corresponding to each sentence to be processed. Furthermore, based on the to-be-used noun entity in each sentence to be processed, the sentence knowledge graph corresponding to the corresponding sentence to be processed can be determined.

[0037] Optionally, determining the sentence knowledge graph corresponding to the corresponding sentence to be processed based on each to-be-used noun entity includes: for each to-be-used noun entity, determining at least one associated noun entity corresponding to the current noun entity according to entity semantic similarity, and determining a to-be-fused knowledge subgraph corresponding to each associated noun entity; merging each to-be-fused knowledge subgraph to obtain a current sentence knowledge graph corresponding to the current sentence to be processed.

[0038] The associated noun entity can be understood as a noun entity with similar semantics or entity category to the current noun entity. For example, the current noun entity is shopping software A, and shopping software B and shopping software C are also included in the to-be-processed sentence. The associated noun entity corresponding to the current noun entity is shopping software B and shopping software C. The to-be-fused knowledge subgraph can include a sentence knowledge graph determined based on the current noun entity and a sentence knowledge graph determined based on each associated noun entity. The current sentence knowledge graph is a sentence knowledge graph fused based on each to-be-fused knowledge subgraph.

[0039] For example, taking the entity category corresponding to the current noun entity as a cat family as an example, if the current noun entity is a lynx cat, the associated noun entity corresponding to the current noun entity is an orange cat, and the to-be-fused knowledge subgraph corresponding to the current noun entity is “lynx cat-cat stick”. The to-be-fused knowledge subgraph corresponding to the associated noun is “orange cat-yarn ball”. The current sentence knowledge graph obtained by merging the to-be-fused knowledge subgraphs corresponding to the current noun entity and the associated noun entity is “cat animal-cat stick-yarn ball”.

[0040] The advantage of such setting is that the to-be-fused knowledge subgraphs corresponding to similar noun entities are fused to obtain a knowledge graph with more abundant information, and the fused knowledge graph is used as the current sentence knowledge graph corresponding to the to-be-processed sentence in which the current noun entity is located, so that more perfect associated information can be obtained to more accurately analyze the to-be-processed sentence.

[0041] Optionally, based on the logical relationship words between each sentence knowledge graph and the adjacent to-be-processed sentence, a text knowledge graph corresponding to the main text part is constructed, including: extracting the logical relationship words between the adjacent to-be-processed sentences, and obtaining the to-be-spliced triple according to the sentence knowledge graphs corresponding to the adjacent to-be-processed sentences and the corresponding logical relationship words; according to the sentence order of each to-be-processed sentence, the corresponding to-be-spliced triple is sequentially spliced to obtain the text knowledge graph corresponding to the main text part.

[0042] Generally, the adjacent to-be-processed sentences are connected by logical relationship words, and the sentence logic between the adjacent to-be-processed sentences can be determined according to the logical relationship words. It should be noted that the logical relationship words include a sentence connector and / or a sentence connector word. The sentence connector can include punctuation marks such as period, exclamation mark, and question mark, which are used to represent the implicit logical relationship between the adjacent to-be-processed sentences. The sentence connector word includes connection words such as “but”, “then”, “although”, etc., which are used to represent the explicit logical relationship between the adjacent to-be-processed sentences.

[0043] The to-be-spliced triple is a triple formed based on adjacent to-be-processed sentences and logical relationships between the adjacent to-be-processed sentences. For example, the adjacent to-be-processed sentences are sentence 1 and sentence 2, denoted as s1 and s2 respectively, and the logical relationship between the sentence 1 and the sentence 2 is denoted as "r", and then the to-be-spliced triple is denoted as "s1-r-s2".

[0044] Similarly, the triple processing is performed on all adjacent to-be-processed sentences in the body part to obtain at least one to-be-spliced triple, and further, the to-be-spliced triples are spliced in order according to the sentence order of the to-be-processed sentences in the body part, so that a text knowledge graph corresponding to the body part is obtained. Optionally, the logical relationship words between the adjacent to-be-processed sentences are extracted, and the to-be-spliced triples are obtained based on the sentence knowledge graphs corresponding to the adjacent to-be-processed sentences and the corresponding logical relationship words, including: based on a character detection technology, the logical relationship words between the adjacent to-be-processed sentences are extracted; based on the logical relationship words, the inter-sentence logic between the adjacent to-be-processed sentences is inferred to obtain a sentence association relationship between the adjacent to-be-processed sentences; based on the sentence association relationship and the sentence knowledge graphs corresponding to the adjacent to-be-processed sentences, the to-be-spliced triples are obtained.

[0045] In S130, for each question stem in the question and answer part, based on the text knowledge graph, an answer-associated sentence associated with the current question stem is determined in the body part.

[0046] When the to-be-processed reading text is analyzed and processed, the question and answer part of the to-be-processed reading text includes at least one question stem, and each question stem corresponds to at least two candidate answers. Generally, when determining the target answer corresponding to each question stem, the sentence associated with the question stem, that is, the answer-associated sentence, can be found in the to-be-processed reading text.

[0047] For example, taking one of the question stems as the current question stem, the current question stem is "How many kinds of fruits are on the table?", and further, the to-be-processed sentence corresponding to the current question stem is queried in the text knowledge graph as the answer-associated sentence. For example, the to-be-processed sentence "There are different fruits on the table, including apples, bananas and oranges" is included in the text knowledge graph, and the to-be-processed sentence is the answer-associated sentence corresponding to the current question stem.

[0048] To more clearly introduce how to determine the answer associated sentence corresponding to the current question stem based on the text knowledge graph, a detailed introduction is made. Based on the text knowledge graph, at least one answer associated sentence corresponding to the current question stem is determined in the text part, which comprises: based on the entity recognition technology, extracting the to-be-matched noun entity in the current question stem; based on the text knowledge graph, determining the target sentence knowledge graph corresponding to the to-be-matched noun entity; in the text part, determining at least one answer associated sentence corresponding to the target sentence knowledge graph.

[0049] Wherein, the to-be-matched noun entity can be understood as the noun entity in the current question stem. The target sentence knowledge graph can be understood as the sentence knowledge graph corresponding to the to-be-matched noun entity. For example, the to-be-matched noun entity in the current question stem is "fruit", and the text knowledge graph includes the sentence knowledge graph corresponding to "fruit". The sentence knowledge graph corresponding to "fruit" is the target sentence knowledge graph corresponding to the to-be-matched noun entity.

[0050] Specifically, based on the entity recognition technology, the to-be-matched noun entity in the current question stem is extracted, and the target sentence knowledge graph corresponding to the to-be-matched noun entity is searched in the text knowledge graph. It can be understood that the text knowledge graph includes each to-be-processed sentence of the text part and the sentence knowledge graph corresponding to each to-be-processed sentence, that is, if the target sentence knowledge graph exists in the text knowledge graph, the answer associated sentence corresponding to the to-be-matched noun entity in the text part can be determined based on the target sentence knowledge graph, that is, the answer associated sentence corresponding to the current question stem.

[0051] S140, based on the answer associated sentence, at least one current candidate answer associated with the current question stem is evaluated to determine the target answer based on the corresponding answer evaluation attribute.

[0052] Wherein, the current candidate answer can be understood as the to-be-selected answer corresponding to the current question stem. For example, the current question stem corresponds to 3 answer options, and the target answer most matching the current question stem needs to be found from the 3 answer options. The 3 answer options are all current candidate answers corresponding to the current question stem. The answer evaluation attribute can be understood as the probability or matching degree of each current candidate answer as the target answer. The target answer is the correct answer corresponding to the current question stem.

[0053] Specifically, after determining the answer associated sentence corresponding to the current question stem, at least one current candidate answer can be evaluated based on the answer associated sentence, such as calculating the matching degree of each current candidate answer and the answer associated sentence to obtain the corresponding answer evaluation attribute, so as to determine the target answer corresponding to the current question stem according to each answer evaluation attribute.

[0054] Optionally, based on the answer-related sentence, the at least one current candidate answer associated with the current question stem is evaluated to determine the target answer based on a corresponding answer evaluation attribute, including: determining a to-be-recognized noun entity corresponding to the at least one current candidate answer associated with the current question stem, and determining a candidate to-be-matched sentence corresponding to each to-be-recognized noun entity in the text part; based on the answer-related sentence, each candidate to-be-matched sentence is evaluated to determine the target answer corresponding to the current question stem based on a corresponding sentence evaluation attribute.

[0055] The to-be-recognized noun entity can be understood as a noun entity extracted from the current candidate answer based on entity recognition technology. The candidate to-be-matched sentence can be understood as a to-be-processed sentence associated with the to-be-recognized noun entity in the text part. The sentence evaluation attribute can be understood as the similarity or matching degree of each candidate to-be-matched sentence with respect to the answer-related sentence. The higher the sentence evaluation attribute, the higher the matching degree of the corresponding candidate to-be-matched sentence with respect to the answer-related sentence, and accordingly, the greater the probability of the current candidate answer corresponding to the candidate to-be-matched sentence as the target answer.

[0056] Specifically, when analyzing each current candidate answer, entity recognition technology is used to perform entity recognition on each current candidate answer to obtain a corresponding to-be-recognized noun entity. Similarly, in the text knowledge graph, a sentence knowledge graph corresponding to each to-be-recognized noun entity can be determined, and based on each sentence knowledge graph, a candidate to-be-matched sentence associated with the corresponding current candidate answer can be determined in the text part. Further, based on the answer-related sentence, each candidate to-be-matched sentence is evaluated to determine the target answer corresponding to the current question stem based on a corresponding sentence evaluation attribute.

[0057] Optionally, based on the answer-related sentence, each candidate to-be-matched sentence is evaluated to determine the target answer corresponding to the current question stem based on a corresponding sentence evaluation attribute, including: determining the similarity of each candidate to-be-matched sentence with respect to the answer-related sentence, and determining the sentence evaluation attribute corresponding to the corresponding candidate to-be-matched sentence based on the similarity; based on each sentence evaluation attribute, an answer evaluation attribute corresponding to the corresponding current candidate answer is determined, and the current candidate answer corresponding to the highest answer evaluation attribute is determined as the target answer.

[0058] Specifically, when determining the similarity between each candidate matching statement and the answer associated statement, a semantic similarity calculation method can be used to calculate the similarity between each candidate matching statement and the answer associated statement, and the answer evaluation attribute corresponding to the candidate matching statement is determined according to the similarity. It can be understood that the answer evaluation attribute can be used to represent the similarity between the corresponding candidate matching statement and the answer associated statement. The higher the similarity, the higher the answer evaluation attribute, and the greater the probability that the current candidate answer corresponding to the candidate matching statement is the target answer. Therefore, the current candidate answer corresponding to the highest answer evaluation attribute is taken as the target answer.

[0059] It should be noted that in the present technical solution, the answer candidate statement associated with the current question stem can be one or more, and the number of matching statements associated with each current candidate answer can also be one or more. That is, taking one of the current candidate answers as an example, if the number of answer associated statements associated with the current question stem is 2 and the number of matching candidate statements associated with the current candidate answer is 3, then when determining the similarity between the current candidate answer and the current question stem based on the semantic similarity, 6 similarities can be obtained.

[0060] Further, in order to determine the similarity between the current candidate answer and the current question stem based on the similarity, the highest similarity value can be selected from the 6 similarities as the similarity between the current candidate answer and the current question stem. The advantage of this setting is that the answer evaluation attribute corresponding to the current candidate answer is directly determined according to the highest similarity, which is more convenient and fast.

[0061] Alternatively, the similarities can also be processed by averaging to obtain an average similarity, and the average similarity is taken as the similarity between the current candidate answer and the current question stem. The advantage of this setting is that the similarities between the candidate matching statements associated with the candidate answer and the answer associated statements can be considered comprehensively, so that the answer evaluation attribute obtained based on the average similarity is more stable, and the evaluation of the current candidate answer is more accurate.

[0062] The technical scheme of the embodiment acquires the to-be-processed reading text, acquires the to-be-processed reading text through text scanning or text importing, and the like. The sentence knowledge graph corresponding to each to-be-processed sentence in the text part is determined, and the text knowledge graph corresponding to the text part is constructed based on the sentence knowledge graph and the logical relationship word between adjacent to-be-processed sentences. At least one to-be-processed sentence is obtained by dividing the text part into sentences, and the corresponding sentence knowledge graph is constructed according to the noun entity in each to-be-processed sentence. Further, the text knowledge graph corresponding to the text part of the to-be-processed reading text is constructed according to the sentence knowledge graph and the sentence logical relationship between adjacent to-be-processed sentences. For each question stem in the question and answer part, the answer associated sentence associated with the current question stem is determined in the text part based on the text knowledge graph, the to-be-matched noun entity in the question stem is extracted, and the answer associated sentence corresponding to the to-be-matched noun entity is determined in the text part based on the text knowledge graph. Further, at least one current candidate answer associated with the current question stem is evaluated based on the answer associated sentence to determine the target answer based on the corresponding answer evaluation attribute. The to-be-identified noun entity in each current candidate answer is extracted, and the candidate to-be-matched sentence corresponding to each to-be-identified noun entity is determined in the text part based on the text knowledge graph. The similarity between each candidate to-be-matched sentence and the answer associated sentence is calculated to determine the sentence evaluation attribute of the corresponding candidate to-be-matched sentence, and the answer evaluation attribute of the corresponding current candidate answer is determined based on each sentence evaluation attribute. The current candidate answer corresponding to the highest answer evaluation attribute is determined as the target answer. The problem of inaccurate prediction of the answer corresponding to the question in the reading text in the machine reading comprehension in the polynomial question and answer is solved, and the accuracy of determining the target answer corresponding to the question in the reading text is improved.

[0063] Embodiment Two

[0064] In a specific example, as Figure 2As shown, a data set is obtained, such as the ReClor data set, which includes reading comprehension texts covering multiple fields of knowledge, each of which includes two parts, i.e., a text part and a question-answering part. For example, a reading comprehension text includes a context (i.e., the text part), a question and four candidate options (i.e., the question-answering part), and also includes the serial number of the correct option and the type of the question. The reading text to be processed is imported from the data set, and the reading text to be processed is processed to determine the target answer corresponding to the question in the question-answering part of the reading text to be processed. It can be understood that the reading text to be processed includes a text part and a question-answering part, the text part includes at least one reading paragraph, each reading paragraph includes at least one sentence to be processed, and the question-answering part includes at least one question stem, each of which corresponds to at least two candidate answers. Specifically, the reading text to be processed is obtained, and text component analysis is performed on the text part of the reading text to be processed to obtain at least one sentence to be processed, and a sentence knowledge graph corresponding to each sentence to be processed is constructed. Further, the logical relationship between adjacent sentences to be processed in the text part is extracted, and a context-related logical knowledge graph corresponding to the text part (i.e., a text knowledge graph corresponding to the text part) is constructed according to the logical relationship between adjacent sentences to be processed and the corresponding sentence knowledge graph. After obtaining the text knowledge graph, a neural-symbolic model based on the logical knowledge graph is constructed, which is used to predict and evaluate the candidate options corresponding to the question in the question-answering part of the reading text to be processed to obtain corresponding answer evaluation attributes, and the target answer is determined according to the answer evaluation attributes.

[0065] In order to more clearly introduce the technical solutions, the technical solutions are described in detail.

[0066] After obtaining the reading text to be processed, the text part is divided into sentences based on the natural language processing toolkit NLTK to obtain at least one sentence to be processed, and the candidate answers in the question-answering part are also divided into sentences to obtain corresponding sentences to be processed. It should be noted that before dividing the text part and the candidate answers into sentences, the text part and the candidate answers need to be marked to avoid confusion when dividing the sentences. That is, although the text part and the candidate answers can be divided into sentences based on the natural language processing toolkit NLTK, they are actually divided into sentences respectively. For example, Figure 3As shown, the context (i.e., the text part) includes S1, S2, S3, …, Sn, and the candidate answers include o1, …, ok. The context and the candidate answers are input into a parser to perform sentence segmentation on the context and the candidate answers based on a natural language processing toolkit (NLTK) in the parser, to obtain a to-be-processed sentence corresponding to the context and a to-be-processed sentence corresponding to the candidate answers, so as to extract corresponding noun entities from the to-be-processed sentences respectively. That is, the to-be-processed sentences include words of different parts of speech, such as nouns, verbs, conjunctions, and the like. In the technical solution, the words in the to-be-processed sentences are tagged with parts of speech, so as to extract noun entities (i.e., to-be-used noun entities) from the to-be-processed sentence corresponding to the text part. Specifically, based on entity recognition technology, entity recognition is performed on the to-be-processed sentence of the text part. For example, the to-be-processed sentence is "Xiaoming has a cat", and through entity recognition, the to-be-used noun entities are "Xiaoming" and "cat". Further, according to the entity categories corresponding to the to-be-used noun entities, a sentence knowledge graph corresponding to the to-be-used noun entities is determined, that is, a sentence knowledge graph corresponding to the to-be-processed sentence. Specifically, the vector entity category corresponding to each to-be-used entity is predicted, and then input into an embedding layer to obtain a fixed-length continuous vector Each to-be-used noun entity and the corresponding entity category are concatenated to obtain Further, the vector is input into a pre-trained classifier to classify the entity category, so as to determine the entity category corresponding to each to-be-used noun entity. Based on this, through the to-be-used noun entities and the corresponding entity categories, a sentence knowledge graph corresponding to the to-be-processed sentence can be obtained.

[0067] More specifically, in order to determine the sentence knowledge graph corresponding to the to-be-processed sentence, the entity semantic similarity of the to-be-used noun entities in each to-be-processed sentence is calculated, at least one associated noun entity associated with the to-be-used noun entity is determined, and a to-be-fused knowledge subgraph corresponding to each associated noun entity is determined respectively, and then each to-be-fused knowledge subgraph is merged to obtain a sentence knowledge graph corresponding to the to-be-processed sentence. Exemplarily, as shown in the following table, the to-be-used noun entities in the to-be-processed sentence are "Xiaoming" and "cat", and the entity categories corresponding to the to-be-used noun entities are "person" and "animal" respectively. The to-be-used noun entities are associated with at least one associated noun entity, and the to-be-fused knowledge subgraph corresponding to each associated noun entity is determined respectively. The to-be-fused knowledge subgraph corresponding to the associated noun entity "Xiaoming" includes the knowledge graph of "Xiaoming", and the to-be-fused knowledge subgraph corresponding to the associated noun entity "cat" includes the knowledge graph of "cat". The to-be-fused knowledge subgraphs are merged to obtain a sentence knowledge graph corresponding to the to-be-processed sentence. Figure 3As shown, the sentence knowledge graph corresponding to the to-be-processed sentence S1 is "e1-r1-e2", wherein the to-be-used noun entity is e1, r1 represents the entity category of e1, and e2 is an associated noun entity associated with e1; the sentence knowledge graph corresponding to S2 is "e3-r2-e4", wherein the to-be-used noun entity is e3, r2 represents the entity category of e3, and e4 is an associated noun entity associated with e3; the sentence knowledge graph corresponding to S3 is "e2-r3-e4", wherein the to-be-used noun entity is e2, r3 represents the entity category of e2, and e4 is an associated noun entity associated with the to-be-used noun entity e2 based on r3, and "and "e3-r2-e4", wherein r4 represents the entity category of e2, and e5 is an associated noun entity associated with the to-be-used noun entity e2 based on r4; in Sn, the to-be-used noun entity is ei, rm represents the entity category of ei, and ej represents an associated noun entity associated with the to-be-used noun entity ei based on rm. Further, based on the sentence knowledge graphs, a text knowledge graph corresponding to the main text part can be constructed.

[0068] In constructing the text knowledge graph corresponding to the main text part, as shown in Figure 4 The inter-sentence logical relationship between adjacent to-be-processed sentences (i.e., based on the logical relationship words between adjacent to-be-processed sentences, the logical relationship between adjacent sentences is determined, including explicit logic and implicit logic) is extracted.

[0069] Specifically, adjacent sentences in the context of the main text part (i.e., adjacent to-be-processed sentences) generally have a logical relationship, which includes explicit logical relationship and implicit logical relationship.

[0070] First, the logical keywords in the list such as "if", "thus", "therefore", "unless" and other words that explicitly represent the logical relationship between sentences are labeled with their corresponding logical relationship, and the relevant sentences and the logical relationship between the sentences are obtained in the form of a triple, such as (s i , r, s j ), 0≤i<j≤n, wherein s i and s j are two adjacent sentences, r is the explicit logical relationship between the two sentences, and n is the number of sentences in the context.

[0071] Second, the implicit logical representation between the remaining sentences is obtained using the inter-sentence punctuation marks. Here, only the logical relationship between adjacent sentences is considered, and the logical relationship between sentences far apart is generally not close and thus not considered. The adjacent sentences are input, and the inter-sentence punctuation marks are obtained as r to obtain the complete logical relationship triple between adjacent sentences (i.e., to-be-spliced triples).

[0072] As shown in Figure 4As shown, the context (i.e., the text part) includes S1, S2, S3,..., Sn, and the inter-sentence logical triples (i.e., the to-be-spliced triples) between adjacent to-be-processed sentences can be determined by extracting logical relation words. Among them, the sentence logical relation between S1 and S2 is lr1, and the corresponding to-be-spliced triple is "S1-lr1-S2"; the sentence logical relation between S2 and S3 is lr2, and the corresponding to-be-spliced triple is "S2-lr2-S3"; the sentence logical relation between S(n-1) and Sn is lr(n-1), and the corresponding to-be-spliced triple is "S(n-1)-lr(n-1)-Sn". Based on the above obtained sentence knowledge graph corresponding to the to-be-processed sentence and the to-be-spliced triples between adjacent to-be-processed sentences, a logical perception graph corresponding to the text part (i.e., a text knowledge graph) can be obtained.

[0073] It should be noted that in the text knowledge graph, each to-be-processed sentence is taken as a node, the node information is the knowledge subgraph contained in the sentence, and the path is the logical relation r obtained in the to-be-spliced triple. Since there is a logical relation between each pair of adjacent sentences as a path, a unidirectional linked list is finally output, and the linked list node is a knowledge subgraph. Since part of the nodes of the knowledge subgraph are overlapped and merged, part of the nodes of the logical knowledge graph are overlapped.

[0074] Further, the pre-trained neural network model based on the logical knowledge graph includes a pre-training model encoding, a graph representation and graph reasoning, and a prediction part. After obtaining the text knowledge graph, the pre-training model in the pre-trained neural network model based on the logical knowledge graph is used to encode the to-be-processed reading text to obtain a text sequence combination. Among them, the text sequence combination can be represented as "question||option", where <s>context< / s> <s>For the special token in the pre-trained model, the maximum input length is 256. Further, based on the graph representation module, the logical knowledge graph (i.e., the text knowledge graph) constructed is used to construct a graph network using the embedding vector output by the pre-trained model, and based on the graph reasoning module, the to-be-recognized noun entity in the candidate answer is identified, and then the path corresponding to the option entity in the logical knowledge graph is extracted through breadth-first search, including the intra-sentence relationship path and the inter-sentence logical relationship path, so as to obtain the more relevant context knowledge (i.e., the candidate matching sentence) in the text part. At the same time, the entity extraction is performed on the question stem to obtain the to-be-matched noun entity, and based on the text knowledge graph, the answer associated sentence corresponding to the to-be-matched noun entity in the text part is determined.

[0075] Further, similarity calculation is performed on each candidate matching sentence and the answer associated sentence corresponding to the question stem, and the sentence evaluation attribute corresponding to each candidate matching sentence is obtained according to the similarity, and the answer evaluation attribute corresponding to the corresponding candidate answer is determined according to the sentence evaluation attribute. The highest answer evaluation attribute is found from each answer evaluation attribute, and the candidate answer corresponding to the highest answer evaluation attribute is determined as the target answer.

[0076] The technical scheme of the embodiment is that a to-be-processed reading text is acquired through text scanning or text importing, and a sentence knowledge graph corresponding to each to-be-processed sentence in the text part is determined, and a text knowledge graph corresponding to the text part is constructed based on the sentence knowledge graphs and logical relation words between adjacent to-be-processed sentences. Through sentence division of the text part, at least one to-be-processed sentence is obtained, and a corresponding sentence knowledge graph is constructed according to a noun entity in each to-be-processed sentence. Further, a text knowledge graph corresponding to the text part of the to-be-processed reading text is constructed according to each sentence knowledge graph and a sentence logical relation between adjacent to-be-processed sentences. For each question stem in the question and answer part, an answer associated sentence associated with the current question stem is determined in the text part based on the text knowledge graph, a to-be-matched noun entity in the question stem is extracted, and an answer associated sentence corresponding to the to-be-matched noun entity is determined in the text part based on the text knowledge graph. Further, at least one current candidate answer associated with the current question stem is evaluated based on the answer associated sentence to determine a target answer based on a corresponding answer evaluation attribute. A to-be-identified noun entity in each current candidate answer is extracted, and a candidate to-be-matched sentence corresponding to each to-be-identified noun entity is determined in the text part based on the text knowledge graph. The similarity between each candidate to-be-matched sentence and the answer associated sentence is calculated to determine a sentence evaluation attribute of the corresponding candidate to-be-matched sentence, and the answer evaluation attribute of the corresponding current candidate answer is determined based on each sentence evaluation attribute. The current candidate answer corresponding to the highest answer evaluation attribute is determined as the target answer. The problem of inaccurate prediction of an answer corresponding to a question in a reading text in machine reading comprehension in a polynomial question and answer is solved, and the effect of improving the accuracy of determining a target answer corresponding to a question in a reading text is achieved.

[0077] It should be understood that the various forms of flow shown above can be reordered, added to, or deleted from. For example, each step described in the present application can be executed in parallel, in sequence, or in a different order, as long as the desired results of the technical scheme of the present application can be achieved, and the present application is not limited herein.

[0078] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.< / s> ​

Claims

1. A knowledge graph based reading comprehension analysis method, characterized in that, The method comprises: acquiring a to-be-processed reading text; wherein the to-be-processed reading text comprises a text part and a question and answer part, the text part is composed of at least one reading paragraph, each reading paragraph comprises at least one to-be-processed sentence, the question and answer part comprises at least one question stem and at least one candidate answer associated with each question stem; determining a sentence knowledge graph corresponding to each to-be-processed sentence in the text part respectively, and constructing a text knowledge graph corresponding to the text part based on the sentence knowledge graph and a logical relationship word between adjacent to-be-processed sentences; for each question stem in the question and answer part, determining an answer-related sentence associated with the current question stem in the text part based on the text knowledge graph; based on the answer-related sentence, evaluating at least one current candidate answer associated with the current question stem to determine a target answer based on a corresponding answer evaluation attribute; wherein the determining of the sentence knowledge graph corresponding to each to-be-processed sentence in the text part respectively comprises: performing sentence division on the text part to obtain at least one to-be-processed sentence; extracting a to-be-used noun entity in each to-be-processed sentence based on an entity recognition technology, and determining a sentence knowledge graph corresponding to the corresponding to-be-processed sentence based on each to-be-used noun entity; wherein the determining of the sentence knowledge graph corresponding to each to-be-processed sentence based on each to-be-used noun entity comprises: for each used noun entity, determining at least one associated noun entity corresponding to the current noun entity according to entity semantic similarity, and determining a to-be-fused knowledge subgraph corresponding to each associated noun entity; wherein the current noun entity is contained in the current to-be-processed sentence; merging each to-be-fused knowledge subgraph to obtain a current sentence knowledge graph corresponding to the current to-be-processed sentence.

2. The method of claim 1, wherein, The constructing of the text knowledge graph corresponding to the text part based on the sentence knowledge graph and the logical relationship word between adjacent to-be-processed sentences comprises: extracting a logical relationship word between adjacent to-be-processed sentences, and obtaining a to-be-spliced triple based on each sentence knowledge graph corresponding to the adjacent to-be-processed sentences and the corresponding logical relationship word; wherein the logical relationship word comprises a sentence connector and / or a sentence connection word; sequentially splicing the corresponding to-be-spliced triple according to the sentence order of each to-be-processed sentence to obtain a text knowledge graph corresponding to the text part.

3. The method of claim 2, wherein, The extracting of the logical relationship word between adjacent to-be-processed sentences and the obtaining of the to-be-spliced triple based on each sentence knowledge graph corresponding to the adjacent to-be-processed sentences and the corresponding logical relationship word comprises: extracting a logical relationship word between adjacent to-be-processed sentences based on a character detection technology; based on the logical relationship word, inferring the inter-sentence logic between the adjacent to-be-processed sentences to obtain a sentence association relationship between the adjacent to-be-processed sentences; based on the sentence association relationship and each sentence knowledge graph corresponding to the adjacent to-be-processed sentences, obtaining a to-be-spliced triple.

4. The method of claim 1, wherein, The determining, based on the text knowledge graph, at least one answer-related sentence associated with the current question stem in the body part comprises: extracting, based on the entity recognition technology, a to-be-matched noun entity in the current question stem; determining, based on the text knowledge graph, a target sentence knowledge graph corresponding to the to-be-matched noun entity; determining, in the body part, at least one answer-related sentence corresponding to the target sentence knowledge graph.

5. The method of claim 1, wherein, The evaluating, based on the answer-related sentence, at least one current candidate answer associated with the current question stem to determine a target answer based on a corresponding answer evaluation attribute comprises: determining a to-be-recognized noun entity corresponding to at least one current candidate answer associated with the current question stem, and determining, in the body part, a candidate to-be-matched sentence corresponding to each to-be-recognized noun entity; evaluating, based on the answer-related sentence, each candidate to-be-matched sentence to determine a target answer corresponding to the current question stem based on a corresponding sentence evaluation attribute.

6. The method of claim 5, wherein, The evaluating, based on the answer-related sentence, each candidate to-be-matched sentence to determine a target answer corresponding to the current question stem based on a corresponding sentence evaluation attribute comprises: determining a similarity of each candidate to-be-matched sentence relative to the answer-related sentence, and determining a sentence evaluation attribute corresponding to a corresponding candidate to-be-matched sentence based on each similarity; determining, according to each sentence evaluation attribute, an answer evaluation attribute corresponding to a corresponding current candidate answer, and determining a current candidate answer corresponding to a highest answer evaluation attribute as the target answer.

Citation Information

Patent Citations

  • Machine reading understanding method, system and device based on external knowledge enhancement

    CN111078836A

  • Text processing method and device based on knowledge graph, electronic equipment and medium

    CN113590776A