Apparatus and Method for Question Answering based on Knowledge Graph
Patent Information
- Application Number
- KR1020230101261
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2043-08-02
Smart Images

Figure 112023085396257-PAT00003_ABST
Abstract
Description
Technology Field
[0001] The present disclosure relates to a knowledge graph-based question answering system, and more specifically to a knowledge graph-based question answering device using natural language structure information. Background Technology
[0002] Recently, knowledge graphs have been widely utilized as a key pillar in the field of information retrieval to improve search efficiency by structurally and explicitly representing information on the web. A knowledge graph is a data model with a graph structure based on knowledge; by interconnecting large amounts of data according to their relationships, it facilitates semantic access to knowledge.
[0003] Meanwhile, a question-answering device is a device that provides answers to queries presented by users. Unlike conventional information retrieval devices that search for and provide documents related to the user's query, it can search for correct answers within documents and present them to the user. Question-answering devices generally provide responses to users through the stages of question analysis, candidate search, and correct answer extraction. Furthermore, research is being conducted on question-answering devices to provide more accurate responses that match the user's query intent by utilizing knowledge graphs. Additionally, recent question-answering devices are configured to accept natural language queries as input; as queries are input in natural language form, the question analysis stage, which accurately analyzes the user's query intent, is becoming relatively very important.
[0004] Existing natural language question answering devices have primarily utilized semantic parser techniques that convert unstructured natural language queries into structured, or logical, representations to extract the correct answer, or information extraction techniques that encode the natural language query and potential candidate entities in a subgraph into vectors, measure their respective similarity scores, and rank them to infer the correct answer.
[0005] However, in the case of semantic parser techniques, training must be performed only after the grammar and logical expressions of the natural language are correctly matched in advance. If the natural language and logical expressions in the training data are incorrectly matched, training cannot proceed correctly, leading to the problem of being unable to provide normal responses. Therefore, structural expressions corresponding to all natural language queries that can be utilized must be pre-labeled, which is difficult to implement in general-purpose question-answering devices that are not limited to such applications.
[0006] Furthermore, while information extraction techniques are relatively easier to generalize compared to semantic parser techniques, they have the problem of being difficult to verify which information was referenced to infer the correct answer. In other words, performance improvement is difficult due to the problem of interpreting the answer estimation process. The problem to be solved
[0007] The purpose of the present disclosure is to provide a question answer device and method capable of extracting an accurate answer to a query by utilizing dependency syntax information and component information, which are natural language structural information.
[0008] The present disclosure provides a question answer device and method capable of accurately identifying a correct answer inference path by decomposing a query sentence into noun phrase units, and then exploring a path while comparing the decomposed noun phrase units with knowledge graph components to derive a correct answer. means of solving the problem
[0009] According to one embodiment of the present disclosure, a question answering device comprises: a processor; and a memory for storing programs executed by the processor, wherein the processor decomposes a query sentence input in natural language format by phrase to set a topic entity, generates a plurality of recombination vocabularys having vocabularys extended sequentially to other noun phrases based on the topic entity in the query sentence, and sequentially searches a node corresponding to each of the plurality of recombination vocabularys sequentially obtained in a knowledge graph to extract a response to the query sentence.
[0010] The processor can extract noun phrases from the decomposed phrases in the query sentence and compare each extracted noun phrase with the entity corresponding to each node of the knowledge graph to set the most similar entity as the topic entity.
[0011] The processor can acquire the topic entity as an initial recombination vocabulary, determine sequentially adjacent noun phrases from the topic entity, and acquire each vocabulary extended from the previously acquired recombination vocabulary to the sequentially determined adjacent noun phrases as recombination vocabulary.
[0012] The above processor can obtain the above query sentence as a final expanded recombination vocabulary.
[0013] The processor generates a dependency matrix representing the dependency relationships between phrases decomposed from the query sentence, and can search for nodes in a knowledge graph based on the dependency matrix along with the plurality of recombination vocabularys.
[0014] The processor can analyze the dependency relationships between the phrases decomposed in the query statement and generate the dependency relationship matrix by constructing a matrix indicating whether each phrase depends on other phrases according to the analyzed dependency relationships.
[0015] The processor can select a node for the topic entity in the knowledge graph as an initial node, and then sequentially search for nodes corresponding to each of the multiple recombination vocabularys obtained sequentially to obtain an entity for the finally selected node as the response.
[0016] The processor can generate state information including a currently acquired query phrase embedding vector among a plurality of query phrase embedding vectors sequentially obtained by encoding the plurality of recombination vocabularys, an action history which is a set of actions determined according to a previous query phrase embedding vector, an initial node selected according to a topic entity among a plurality of nodes of the knowledge graph, and a currently selected node selected according to a previously determined action.
[0017] The processor can estimate an action score for each of the edges connected to the current selection node in the knowledge graph based on the state information, and determine the current action to select the edge with the largest action score.
[0018] The processor can transition the node connected to the edge selected from the current selected node to the next selected node according to the current action, and update the state information according to the transitioned state.
[0019] A question-answering method according to another embodiment of the present disclosure is a method performed by a computing device having a processor and a memory for storing programs executed by said processor, comprising: a step of decomposing a query sentence input in natural language format into phrases to set a topic entity; a step of generating a plurality of recombination vocabularys having vocabularys extended sequentially to other noun phrases based on said topic entity in said query sentence; and a step of sequentially searching for a node corresponding to each of said recombination vocabularys sequentially obtained in a knowledge graph to extract a response to said query sentence. Effects of the invention
[0020] After decomposing the query sentence of the present disclosure into noun phrase units, the decomposed noun phrase units are compared with knowledge graph components to explore paths and derive the correct answer, thereby obtaining the correct answer inference path and the correct answer and providing them to the user. Brief explanation of the drawing
[0021] Figure 1 shows an example of a knowledge graph. FIG. 2 shows a schematic configuration of a knowledge graph-based question answering device according to one embodiment. Figure 3 shows an example of the detailed configuration of the query encoding module of Figure 1. Figure 4 is an example to explain the operation of the query parsing module of Figure 3 parsing a query. Figure 5 is an example to explain the operation of the syntax recombination module of Figure 3. Figures 6 and 7 are examples to explain the operation of the dependency analysis module of Figure 3. Figure 8 shows an example of the detailed configuration of the agent module of Figure 2. FIG. 9 illustrates a knowledge graph-based question-answering method according to one embodiment. FIG. 10 is a drawing for explaining a computing environment including a computing device according to one embodiment. Specific details for implementing the invention
[0022] Hereinafter, specific embodiments according to embodiments of the present disclosure will be described with reference to the drawings. The following detailed description is provided to facilitate a comprehensive understanding of the methods, apparatuses, and / or systems described herein. However, this is merely illustrative and the present invention is not limited thereto.
[0023] In describing the embodiments of the present disclosure, detailed descriptions of known technology related to the present invention are omitted if it is determined that such detailed descriptions would unnecessarily obscure the essence of the embodiments. Furthermore, terms described below are defined with consideration of their functions in the present invention, and these may vary depending on the intentions or practices of the user or operator. Therefore, such definitions should be based on the content throughout this specification. Terms used in the detailed description are intended merely to describe specific embodiments and should not be limiting. Unless explicitly stated otherwise, expressions in the singular form include the meaning of the plural form. In this description, expressions such as “include” or “compose” are intended to refer to certain characteristics, numbers, steps, actions, elements, parts thereof, or combinations thereof, and should not be interpreted to exclude the existence or possibility of one or more other characteristics, numbers, steps, actions, elements, parts thereof, or combinations thereof other than those described. Additionally, terms such as “...part,” “...unit,” “module,” and “block” described in the specification refer to a unit that processes at least one function or operation, and this may be implemented in hardware, software, or a combination of hardware and software.
[0024] Figure 1 shows an example of a knowledge graph.
[0025] In a knowledge graph, entities representing independent and atomic entities in the real world are represented as nodes of the graph, and nodes can be linked by edges according to the relationship between two entities. As illustrated in Fig. 1, the entities forming the nodes in the knowledge graph mainly represent names of people such as Sylvia Brett, Charles Vyner Brooke, and Charles Brooke, or place names or objects such as London, Greenwich, and Burnham on the Sea. The edges connecting the nodes represent the relationships between the nodes, and in Fig. 1, it can be seen that relationships such as spouse, father, and birthplace represent the relationships between entities regarding people or between entities regarding people and places.
[0026] Such a knowledge graph can be viewed as a type of pre-generated database, and real-world facts can be represented as sets in the form of triples. Here, a triple is a subject entity (e j ) and object entity (e o A tuple containing a relationship(r) between ) <e j , r, e o It can be expressed in the form of ->).
[0027] Since the knowledge graph (G) is a set of triples having the form of tuples as described above, mathematically G = { <e j , r, e o >|e j , e oIt can be defined as {∈ E, r ∈ R}. Here, E and R represent the set of entities and the set of relationships in the knowledge graph, respectively, which are expressed as nodes and edges. Therefore, for convenience, entities and nodes, and relationships and edges will be equated in the following explanation.
[0028] And as shown in Fig. 1, the entities forming nodes in the knowledge graph generally consist mainly of noun phrase components in sentences, regardless of the object being represented.
[0029] FIG. 2 shows a schematic configuration of a knowledge graph-based question answering device according to one embodiment.
[0030] The knowledge graph-based question answering device according to the present disclosure is a device that provides a response to a query by utilizing a knowledge graph, and is trained using a reinforcement learning method to derive and provide a correct answer to an input natural language query. The question answering device has n consecutive tokens (w1, w2, …, w n A natural language query consisting of ) (q = {w1, w2, …, w n The purpose is to provide the correct answer for}) by searching for it in the knowledge graph.
[0031] When a natural language query is input, a knowledge graph-based question answering device can search for and extract triples among several triples in the knowledge graph that have a relationship associated with the query, and then provide entities obtained from the searched triples as a response.
[0032] Accordingly, the question-response device of the present disclosure may include a question encoding module (10), an environment module (20), and an agent module (30), as illustrated in FIG. 2. The question encoding module (10) receives a natural language question sentence as input, encodes it, and transmits it to the environment module (20). The agent module (30) is trained using a reinforcement learning method and extracts and provides a response to the question encoded and transmitted by the question encoding module (10).
[0033] The query encoding module (10) can encode the query in a way that allows the agent module (30) to easily extract an accurate response as well as track the process of extracting the response.
[0034] The environment module (20) is equipped with a knowledge graph, which is environment information for obtaining a response to a query. The environment module (20), which is equipped with a knowledge graph such as that shown in FIG. 1, is equipped with a current action (A) by the agent module (30). t When ) is determined, the determined action (A t Node (e) of the currently selected knowledge graph according to ) t One of the nodes connected by an edge (r) from ) is the next selected node (e t+1 Select as ). In other words, switch the state. At this time, the next selected node (e) is selected. t+1 ) is the currently selected node (e t ) It could be oneself(e t+1 = e t ).
[0035] And the initial node selected initially (e s ) and the currently selected node (e) selected at the current time (t). t ), an action history (h) representing a set of actions that moved from the initial node to the currently selected node. t ) and query syntax embedding vector (q) encoded and transmitted from the query encoding module (10) t NP including ) state information (S t = (q t NP , e s , e t , h t Generates )) and generated state information (S t ) is passed to the agent module (30).
[0036] The agent module (30) receives status information (S) from the environment module (20). t ) is authorized, and authorized status information (S t Action based on ) (At ) determines. At this time, the determined action is the current selected node (e) in the environment module (20). t The state where ) is selected is the next selection node (e t+1 ) can be switched to a selected state. That is, current state information (S t In ), the currently selected node (e t ) is the next state information (S t+1 In ), other nodes (e t+1 It can be made to switch to ).
[0037] FIG. 3 shows an example of the detailed configuration of the query encoding module of FIG. 2, FIG. 4 is an example for explaining the operation of the query parsing module of FIG. 3 parsing a query, FIG. 5 is an example for explaining the operation of the syntax recombination module of FIG. 3, and FIG. 6 and FIG. 7 are examples for explaining the operation of the dependency analysis module of FIG. 3.
[0038] Referring to FIG. 3, the query encoding module (10) may include a query parsing module (11), a query recombination module (12), a dependency analysis module (13), and an encoder (14).
[0039] The query parsing module (11) parses the query sentence when the query sentence is input. The query parsing module (11) receives a query sentence in natural language format and can decompose the received query sentence according to syntactic components. FIG. 4 shows an example in which the query parsing module (11) decomposes the query sentence when the natural language sentence “Where was the father of Syliva Brett’s other half born?” is input as a query sentence. FIG. 4 shows, as an example, a case in which tags are assigned by separating the query sentence by constituent components according to the “Penn Treebank syntactic tag set” and “Context-Free Grammars”. Here, SBARQ is “Direct question introduced by wh- WHADVP is a tag for “element”, SQ is a tag for “Wh-adverb phrase”, and SQ is “Yes / no questions and subconstituent of SBARQ excluding wh- This is a tag for the “element”. Additionally, tags such as noun phrase (NP), verb phrase (VP), adjective phrase (ADJP), and adverb phrase (ADVP) can be assigned to each decomposed syntactic component. Since the definitions for the remaining tags are also known, a detailed explanation is omitted here.
[0040] As illustrated in FIG. 4, the query parsing module (11) may decompose the query sentence according to syntactic components, but may also decompose it into a tree structure. However, this is merely an example, and the query parsing module (11) may decompose the query sentence into a structure other than a tree structure.
[0041] When a query sentence is decomposed according to syntactic components by a query parsing module (11), a query recombination module (12) extracts a topic entity representing a core syntactic from the decomposed query, recombines the extracted topic entity to gradually expand into a query sentence to generate multiple recombination vocabularys, and transmits the generated recombination vocabularys to an encoder (14).
[0042] The query recombination module (12) may include a topic entity extraction module (15) and a phrase recombination module (16). The topic entity extraction module (15) searches for the most core phrase among multiple phrases of the decomposed query sentence and obtains it as a topic entity.
[0043] As described above, in natural language query sentences, entities of the real world generally appear as nouns, and the nodes of the knowledge graph are also composed of entities for nouns. Accordingly, the topic entity extraction module (15) extracts noun phrases from among multiple phrases decomposed from the query sentence, and performs entity linking on each extracted noun phrase to compare with entities assigned to multiple nodes of the knowledge graph, thereby explicitly searching for the most similar entity and setting the searched entity as a topic entity.
[0044] For example, when “Where was the father of Syliva Brett’s other half born?” is entered as a query sentence, the topic entity extraction module (15) compares the noun phrases father, Syliva Brett’s, and other half with the entities assigned to the nodes of the knowledge graph of FIG. 1, respectively, and can extract “Syliva Brett”, the most similar entity, as a topic entity.
[0045] When a topic entity is extracted from the topic entity extraction module (15), the phrase recombination module (16) expands and recombines the query sentence in units of adjacent noun phrases centered on the extracted topic entity. The phrase recombination module (16) extracts the topic entity “Syliva Brett” as in (1) in the example of FIG. 5. <e>If authorized as ), the topic entity in the decomposed query statement ( <e>First, search for noun phrases located closest to ), and sequentially search for noun phrases located further away to obtain multiple recombined vocabulary.
[0046] As illustrated in FIG. 4, when the query parsing module (11) decomposes the query sentence into a tree structure, the syntax recombination module (16) can easily search for noun phrases at more distant locations sequentially starting from the nearest noun phrase based on the tree structure.
[0047] When the nearest noun phrase is found, the phrase recombination module (16) recombines from the topic entity to the entity of the found noun phrase in the query sentence as in (2) to " <e>Acquire “'s other half” as a single recombined vocabulary. Then, as in (3), search for the next nearest noun phrase, “the father of <e>'s other half' is obtained as another recombined vocabulary. Then, the next noun phrase in the sequence is searched, and if no noun phrase is found, the entire query sentence is obtained as a recombined vocabulary as in (4).
[0048] The syntax recombination module (16) applies a plurality of acquired recombination vocabularys to each encoder (14). At this time, the syntax recombination module (16) may apply a plurality of recombination vocabularys to the encoder (14) sequentially.
[0049] In the present disclosure, the query recombination module (12) extracts a topic entity and obtains multiple recombination vocabulary by recombining the query sentence in units of noun phrases, expanding from noun phrases close to the extracted topic entity to noun phrases located gradually further away. This is intended to enable the agent module (30) to search for a response to a query using a knowledge graph, thereby allowing the response to be searched through a path based on the sentence structure information of the natural language query sentence, so that an accurate response can be obtained. Furthermore, since the path through which the response is searched proceeds sequentially, the path for inferring the correct answer is clearly visible. Therefore, in the event of an incorrect answer, the cause of the incorrect answer can be easily inferred, thereby further improving the performance of the query answer device.
[0050] Meanwhile, the dependency analysis module (13) analyzes the dependency relationships between the phrases decomposed by the query parsing module (11) to generate a dependency relationship matrix, and transmits the generated dependency relationship matrix to the encoder (14).
[0051] The dependency analysis module (13) may include a dependency parsing module (17) and a dependency matrix generation module (18). The dependency parsing module (17) analyzes the dependencies between multiple phrases decomposed by the query parsing module (11). When the query parsing module (11) decomposes a query sentence, if the components of each phrase have already been identified as in FIG. 4, the dependency parsing module (17) can analyze the dependencies between phrases according to the identified phrase components. For example, if the query sentence is "When was the director of Titanic born?", the dependency parsing module (17) can analyze the dependencies between phrases as in FIG. 6. Referring to FIG. 6, it can be analyzed that "born" depends on three phrases: "When," "was," and "the director," "the director" depends on "of" which follows it, and "of" again depends on "Titanic."
[0052] The dependency matrix generation module (18) generates a dependency relationship matrix based on the dependency parsing results of the dependency parsing module (17). The dependency matrix generation module (18) can be generated by listing multiple phrases decomposed from a query sentence, such as in FIG. 7, in row and column directions, and assigning element values based on whether the phrase in each row depends on the phrase arranged in the column. Since each phrase naturally depends on itself, dependency values are assigned as element values to all elements in the diagonal matrix direction first. In the example of FIG. 6 mentioned above, since it was analyzed that 'the director' depends on 'of' which is located after it, and 'of' in turn depends on 'Titanic', dependency values were assigned to the elements of the 4th and 5th columns, respectively, in the 3rd and 4th rows. And since 'born' depends on three phrases, 'When', 'was', and 'the director', it can be seen that dependency values were assigned to all elements of the 1st to 3rd columns in the last 6th row. Here, as an example, the dependency value can be 1 and 0 can be assigned to the remaining elements.
[0053] When a dependency matrix is obtained by the dependency matrix generation module (18) as shown in FIG. 7, the obtained dependency matrix is applied to the encoder (14). At this time, the dependency matrix may be transmitted with element values separated by row, so that a dependency vector for each phrase may be applied to the encoder (14).
[0054] The dependency analysis module (13) provides inter-syntactic dependency information based on the natural language grammar structure to the encoder, thereby enabling the encoder (14) to increase the correlation between words with high grammatical relationships when encoding the recombination vocabulary, while eliminating the correlation between words with no grammatical relationships, thus enabling a more accurate query phrase embedding vector (q t NP Enables the creation of ).
[0055] Accordingly, the dependency analysis module (13), together with the query recombination module (12), enables the agent module (30) to search for a response to a query based on natural language grammar structure as well as natural language sentence structure information of the query sentence when searching for a response to a query, thereby enabling the extraction of a more accurate response.
[0056] The encoder (14) receives a plurality of recombination vocabularys and encodes them to form a plurality of query phrase embedding vectors (q t NP Obtain ) and the obtained multiple query syntax embedding vectors (q t NP ) is transmitted to the environment module (20). At this time, the encoder (14) converts each of the multiple recombination vocabularys into a token (w1, w2, …, w n Separated by ), each token (w1, w2, …, w n By embedding ) to query syntax embedding vector(q t NP ) It may also be possible. The encoder (14) may each token (w1, w2, …, w) according to various known embedding techniques. n ) can be embedded, and for example, tokens can be embedded by applying the word embedding technique "Glove: Global vectors for word representation".
[0057] In the present disclosure, the encoder (14) encodes each of a plurality of sequentially expanded recombination vocabularys to form a plurality of query embedding vectors (q t NP ) can be generated and passed to the environment module (20).
[0058] The encoder (14) has a topic entity (as shown in FIG. 5) <e>After ) is obtained, if 3 recombination vocabularys are obtained by expansion recombination at the noun phrase level, 4 (t = {1, 2, 3, 4}) query embedding vectors (q) according to the total of 4 recombination vocabularys t NP You can obtain ).
[0059] In the present disclosure, the encoder (14) is implemented as an artificial neural network and performs neural network operations on a plurality of recombined vocabularys that are applied to obtain a plurality of query phrase embedding vectors (q t NP You can obtain ).
[0060] The encoder (14) can be implemented based on a Transformer, which is a type of neural network that receives and converts natural language. Although Transformers are currently being applied in various fields, they were fundamentally developed for natural language translation; therefore, in this disclosure, the encoder (14) can be implemented based on an existing Transformer developed for natural language translation. The existing Transformer also handles a natural language query sentence (q) with multiple tokens (w1, w2, …, w n When input separated by ), it is configured to encode it to obtain an embedding vector, and then decode the obtained embedding vector to output the translated natural language. Therefore, using only the encoder of the already trained Transformer, multiple query phrase embedding vectors (q t NP You can also obtain ).
[0061] However, existing Transformers obtain embedding vectors based on the positional relationships between multiple tokens acquired from the input natural language sentence. In other words, the correlation for each token in the sentence is estimated based solely on position, regardless of grammatical association, and encoding is performed according to the estimated correlation. As a result, problems can arise where the correlation between tokens that are grammatically unrelated becomes high, or the correlation between tokens that are highly related becomes low.
[0062] In order to prevent such problems from occurring, the encoder (14) in the present disclosure receives a dependency relationship matrix along with a plurality of recombination vocabularys, and encodes each of the plurality of recombination vocabularys based on the received dependency relationship matrix to obtain a plurality of query embedding vectors (q t NP It is also possible to generate ). Accordingly, when implementing the encoder (14) using an existing transformer, the configuration for estimating position-based correlation in the encoder (14) can be removed and instead a configuration for estimating correlation according to a dependency matrix can be added and used.
[0063] A query encoding module (10) receives a natural language query sentence (q) and multiple query phrase embedding vectors (q t NP When ) is obtained, the environment module (20) obtains a query syntax embedding vector (q t NP ) authorized to receive state information (S t ) generates. At this time, the environment module (20) generates a plurality of query syntax embedding vectors (q t NP ) can be sequentially authorized. And the environment module (20) can receive authorized query syntax embedding vectors (q t NP Initial node (e) based on ) and topic entity s ), the currently selected node (e) selected at the current time (t). t ), initial node(e s From ) the currently selected node (e t Action that moves to ) (A1~ A t-1 Action history (h) including a set of ) t Check the status information (S) t = (q t NP , e s , e t , h t It generates )) and the generated state information (S t ) is passed to the agent module (30).
[0064] In the knowledge graph, initially (t = 1), nodes (e) corresponding to topic entities s Since ) is selected, the currently selected node (e1) is the same as the initial node (e1 = e s )하다. Topic Entity(e s Since ) has already been selected by the topic entity extraction module (15) of the query recombination module (12), the initial node (e) selected by the topic entity extraction module (15) s ) can be used as is. However, query syntax embedding vector(q t NP Initial node (e) according to ) s ) may be re-selected. And since there is no previously determined action in the agent module (30), the initial action history (h1) is an empty set (h1= Ψ). Therefore, the environment module (20) has an authorized query syntax embedding vector (q1 NP ) and initial node(e s ), currently selected node(e1= e s The action history (h1) of the ) and empty set is included in the state information (S1) and transmitted to the agent module (30).
[0065] Subsequently, when an action (A1) is determined in the agent module (30), the determined action (A1) is included in the action history (h2), and another node (e2) connected by an edge (r1) from the previously selected node (e1) of the knowledge graph is selected according to the determined action (A1). Then, the action history (h2) with the selected other node (e2) and the determined action added is included in the state information (S2) and transmitted to the agent module (30).
[0066] That is, the environment module (20) is the agent module (30) current state information (S t Action (A) depending on ) t If ) is decided, the decided action (A t Depending on ), the following status information (S t+1 The process of obtaining ) and transmitting it back to the agent module (30) is repeated. When the environment module (20) is in a state that changes by the number of recombination vocabulary words (T), the last state information (S T The selected node (e) in ) T The entity of ) can be extracted as a response.
[0067] The agent module (30) receives state information (S) from the environment module (20). t If ) is authorized, authorized status information (S t Action based on ) (A t ) is determined and transmitted to the environment module (20). At this time, the agent module (30) determines the syntax embedding vector (q t NP ) and initial node(e s ), currently selected node(e t ) and action history(h t Status information (S) including ) t = (q t NP , e s , e t , h t If )) is authorized, the authorized status information (S t In ), the currently selected node (e t All edges (r) connected to ) t * Check ) and syntax embedding vector(q t NP ) and action history(h t All edges confirmed based on ) (r t * Action to select one of ) (A t ) can be determined.
[0068] Figure 8 shows an example of the detailed configuration of the agent module of Figure 2.
[0069] Referring to FIG. 8, the agent module (30) may include a status check module (31), a history encoding module (32), and an action decision module (33). The status check module (31) receives status information (S) from the environment module (20). t ) is authorized. And authorized status information (S t Action History (h) in ) t While transmitting ) to the history encoding module (32), the previously selected current selected node (e t All edges (r) connected to ) t * Check ) to obtain the syntax embedding vector(q t NP It is passed to the action decision module (33) along with ).
[0070] The history encoding module (32) receives the action history (h) transmitted from the status check module (31). t Authorized for ), action history (h t All previously performed actions included in ) (A1~ A t-1 Encoding ) using neural network computation to encode the encoding history (h t ' ) is transmitted to the action decision module (33). The history encoding module (32) can also be implemented as an artificial neural network, for example, as a Long Short Term Memory (LSTM).
[0071] The action decision module (33) is the encoding history (h t ' ) and syntax embedding vector(q t NP Based on ), the currently selected node (e t All edges (r) connected to ) t * All actions that select each ) (A * Estimate the action score for ). Here, the action score can be estimated in the form of a probability value through a softmax function. And all possible actions (A * The action (A) with the highest action score among the estimated action scores for ) is the action currently to be executed (A t Select as ) and output to the environment module (20). That is, the currently selected node (e t Edges (r) connected to ) t * One of the edges (r) t Action (A) so that ) is selected t Determines the ). And the currently selected node (e t A single edge (r) connected to ) t When ) is selected, the environment module (20) selects the currently selected node (e t Selected edge(r) in ) t The node connected by ) is the next selected node (e t+1 Transitions to the state of ). At this time, all selectable edges (r t * ) contains the currently selected node (e t ) Edges that reconnect themselves may also be included. That is, edges for self-loops not provided in the knowledge graph are added to each node to allow it to be re-selected, thereby enabling more flexible search for the correct answer.
[0072] At this time, since a plurality of recombination vocabulary expanded from the topic entity into noun phrase units are obtained sequentially, the action decision module (33) is the initial node (e) of the topic entity s In ), sequentially select the next selection node (e) according to the sentence structure of the natural language query sentence t+1 Action (A) so that ) is selected t ) can be determined. Therefore, if the query sentence is "Where was the father of Syliva Brett's other half born?" as described above, the action determination module (33) can determine the initial node (e) corresponding to the topic entity "Syliva Brett". s From ) sequentially to the node of "Charles Vyner Brooke", the entity corresponding to the adjacent noun phrase "other half", and the node of "Charles Brooke", the entity corresponding to the next adjacent noun phrase "father", the next selected node (e t+1 You can determine the action so that ) is selected, and ultimately, depending on the entire query sentence, the birthplace "Burnham on Sea" can be selected as the response.
[0073] That is, by considering the sentence structure of the query and enabling the sequential search for responses along paths 1 to 4 as illustrated in FIG. 1, the question answering device is not only enabled to search for the correct answer more accurately but also allows verification of the process of searching for the correct answer. In addition, by further applying inter-syntactic dependencies in the query, the next selection node (e t+1 When selecting ), selecting highly relevant nodes enables the extraction of correct answers with greater reliability. In other words, the performance and reliability of the question answering device can be improved.
[0074] Meanwhile, in reinforcement learning, the agent module (30) must be repeatedly trained as a learning target. Accordingly, the question-answering device of the present disclosure may further include a reward module (not shown). The reward module calculates a reward by comparing the answer obtained from the environment module (20) with the correct answer for the question sentence, and can update the agent module (30) by providing the reward to the agent module (30) according to the calculated reward.
[0075] In the illustrated embodiments, each component may have different functions and capabilities other than those described below, and may include additional components other than those not described below. Additionally, in one embodiment, each component may be implemented using one or more physically separated devices, or by one or more processors or a combination of one or more processors and software, and may not be clearly distinguished in specific operation as in the illustrated examples.
[0076] And the question-answering device illustrated in FIG. 2 may be implemented in a logic circuit by hardware, firmware, software, or a combination thereof, or may be implemented using a general-purpose or specific-purpose computer. The device may be implemented using a hardwired device, a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), etc. Additionally, the device may be implemented as a system-on-chip (SoC) including one or more processors and controllers.
[0077] In addition, the question-and-answer device may be installed in the form of software, hardware, or a combination thereof on a computing device or server equipped with hardware elements. A computing device or server may refer to various devices that include, in whole or in part, communication devices such as communication modems for communicating with various devices or wired / wireless communication networks, memory for storing data for executing programs, and microprocessors for executing programs to perform calculations and commands.
[0078] FIG. 9 illustrates a knowledge graph-based question-answering method according to one embodiment.
[0079] Referring to FIG. 9, the knowledge graph-based question-answering method according to the present disclosure first receives a query sentence in natural language format (51). Then, the input query sentence is parsed and decomposed according to syntactic components (52). Then, noun phrases are extracted from the decomposed syntactic components, and each extracted noun phrase is compared with an entity constituting each node in the knowledge graph to extract a topic entity, which is the entity representing the most similar noun phrase (53). Then, as shown in FIG. 5, multiple recombination vocabularys are obtained by sequentially combining extended phrases up to adjacent noun phrases based on the noun phrase of the topic entity extracted from the query sentence (54). At this time, if no noun phrases exist in the query sentence, the entire query sentence is obtained as the final recombination vocabulary.
[0080] Meanwhile, the dependencies between the decomposed phrases are analyzed (55). That is, whether each phrase within the query statement depends on other phrases is analyzed as in FIG. 6. Then, a dependency relationship matrix as in FIG. 7 is generated based on the analyzed dependencies between phrases (56).
[0081] Here, the dependency parsing step (55) and the step of generating a dependency matrix (56) are shown as being performed after the step of extracting topic entities (53) and the step of obtaining recombination vocabulary (54); however, the dependency parsing step (55) and the step of generating a dependency matrix (56) may be performed in parallel with the step of extracting topic entities (53) and the step of obtaining recombination vocabulary (54). Additionally, depending on the case, the dependency parsing step (55) and the step of generating a dependency matrix (56) may be omitted.
[0082] When multiple recombination vocabularies are obtained, each of the obtained recombination vocabularies is encoded to obtain multiple query embedding vectors (q t NP ) generates (57). At this time, multiple query embedding vectors (q t NP ) can also be generated by encoding a dependency matrix along with a recombination vocabulary.
[0083] Multiple query embedding vectors (q t NP When ) is obtained, the environment module including the knowledge graph current state information (S t ) obtain (58). Here, multiple query embedding vectors (q t NP ) can be authorized sequentially, and the currently authorized query embedding vector(q t NP State information (S) based on ) t ) contains the current query embedding vector(q t NP Initial nodes (e) for ) and topic entities s ), currently selected node(e t ) and previously determined actions (A1~ A t-1 Action history (h) which is a set of t ) includes (S t = (q t NP , e s , e t , h t ))can be. Accordingly, the initial query embedding vector (q1) for the topic entity NP The initial state information (S1) according to ) includes an initial query embedding vector (q1 NP ) and initial node(e s ), currently selected node(e1= e s It may include an action history (h1) that is ) and an empty set.
[0084] Current status information (S t When ) is obtained, current state information (S t Action history included in ) (h t Encoding ) to encode the encoding history (h t ' ) obtain (59). And the encoding history (h t ' ) and syntax embedding vector(q t NP Based on ), the currently selected node (e) in the knowledge graph t All edges (r) connected to ) t * All actions that select each ) (A * The action score for ) is estimated by neural network computation (60). Here, the action score can be estimated in the form of a probability value. Then, the action (A) with the highest action score among the estimated action scores is the action currently to be executed (A t Determined by ) (61). Action (A t When ) is determined, the current selected node (e t Edges (r) connected to ) t * Among the determined actions (A t The edge (r) selected according to ) t The node connected by ) is the next selected node (e t+1 The state is switched to ) (62). At this time, each node (e t All edges (r) connected to ) t * Among ), edges for self-loops connecting itself are added, and the next selection node (e) according to the state transition is added. t+1 ) to the currently selected node (e t ) may be re-selected.
[0085] Then, it is determined whether the number of state transitions is greater than or equal to a reference number (63). Here, the reference number can be set to the number of acquired recombination vocabularys (T). If the number of state transitions is greater than or equal to the reference number, the last selected current selection node (e T ) can be extracted and output as a response (64). However, if the number of state transitions is less than the reference number, state information (S according to the transitioned state) t+1 Acquire ) again for the next action (A t+1 Determines ).
[0086] Although FIG. 9 describes each process as being executed sequentially, this is merely an illustrative description, and a person skilled in the art can apply various modifications and variations by changing the order described in FIG. 9, executing one or more processes in parallel, or adding other processes, within the scope of not departing from the essential characteristics of the embodiment of the present invention.
[0087] FIG. 10 is a drawing for explaining a computing environment including a computing device according to one embodiment.
[0088] In the illustrated embodiments, each component may have different functions and capabilities in addition to those described below, and may include additional components in addition to those not described below. The illustrated computing environment (70) may include a computing device (71) to perform the question-answering method illustrated in FIG. 9. In one embodiment, the computing device (71) may be one or more components included in the question-answering device illustrated in FIG. 2.
[0089] A computing device (71) includes at least one processor (72), a computer-readable storage medium (73), and a communication bus (75). The processor (72) can cause the computing device (71) to operate according to the exemplary embodiment described above. For example, the processor (72) can execute one or more programs (74) stored in the computer-readable storage medium (73). The one or more programs (74) may include one or more computer-executable instructions, and the computer-executable instructions may be configured to cause the computing device (71) to perform operations according to the exemplary embodiment when executed by the processor (72).
[0090] The communication bus (75) interconnects various other components of the computing device (71), including the processor (72) and the computer-readable storage medium (73).
[0091] The computing device (71) may also include one or more input / output interfaces (76) and one or more communication interfaces (77) that provide an interface for one or more input / output devices (78). The input / output interfaces (76) and the communication interfaces (77) are connected to a communication bus (75). The input / output devices (78) may be connected to other components of the computing device (71) through the input / output interfaces (76). An exemplary input / output device (78) may include an input device such as a pointing device (such as a mouse or trackpad), a keyboard, a touch input device (such as a touchpad or touchscreen), a voice or sound input device, various types of sensor devices and / or imaging devices, and / or an output device such as a display device, a printer, a speaker and / or a network card. An exemplary input / output device (78) may be included inside the computing device (71) as a component constituting the computing device (71), or it may be connected to the computing device (71) as a separate device distinct from the computing device (71).
[0092] Although the present invention has been described in detail above through representative embodiments, those skilled in the art will understand that various modifications and equivalent alternative embodiments are possible therefrom. Accordingly, the true technical scope of protection of the present invention should be determined by the technical spirit of the appended claims.< / e> < / e> < / e> < / e> < / e>
Claims
Claim 1 A device comprising a processor and a memory for storing programs executed by the processor, wherein the processor decomposes a query sentence input in natural language format into phrases to set a topic entity, generates a plurality of recombination vocabularys having vocabulary that is sequentially expanded to other adjacent noun phrases based on the topic entity in the query sentence, and for each search step in the knowledge graph, generates state information including an embedding vector of the recombination vocabulary sequentially obtained among the plurality of recombination vocabularys corresponding to the search step, initial node information, current node information, and previous search history information, and repeats the process of selecting one of a plurality of edges connected to the current node in the knowledge graph based on the state information and moving to the next search node a number of times corresponding to the number of recombination vocabularys, thereby extracting a response to the query sentence through a node search path according to the sentence structure of the query sentence. Claim 2 A query response device according to claim 1, wherein the processor extracts noun phrases from the phrases decomposed from the query sentence and sets the most similar entity as the topic entity by comparing each extracted noun phrase with the entity corresponding to each node of the knowledge graph. Claim 3 delete Claim 4 delete Claim 5 A question answering device according to claim 1, wherein the processor generates a dependency matrix representing dependency relationships between phrases decomposed from the query sentence, and searches for nodes in a knowledge graph based on the dependency matrix together with the plurality of recombination vocabularys. Claim 6 In paragraph 5, the processor analyzes the dependency relationships between phrases decomposed in the query sentence and, according to the analyzed dependency relationships, constructs a matrix indicating whether each phrase depends on other phrases to generate the dependency relationship matrix. Claim 7 A question-response device according to claim 1, wherein the processor selects a node for the topic entity in the knowledge graph as an initial node, and subsequently sequentially searches for nodes corresponding to each of the plurality of recombination vocabularys obtained sequentially to obtain an entity for the finally selected node as the response. Claim 8 delete Claim 9 A question-response device according to claim 1, wherein the processor estimates an action score for each of a plurality of edges connected to the current node in the knowledge graph based on the state information, and determines a current action to select the edge having the largest action score. Claim 10 In paragraph 9, the processor, according to the current action, A query response device that transitions a node connected to an edge selected from the current node to the next exploration node, and updates the state information according to the transitioned state. Claim 11 A method for performing a query response by a computing device having a processor and a memory for storing programs executed by said processor, comprising: a step of decomposing a query sentence input in natural language format into phrases to set a topic entity; a step of generating a plurality of recombination vocabularys having vocabularys that are sequentially expanded to other adjacent noun phrases based on said topic entity in said query sentence; a step of generating state information for each search step in a knowledge graph, including an embedding vector of a recombination vocabulary sequentially obtained among said recombination vocabularys corresponding to the search step, initial node information, current node information, and previous search history information; and a step of extracting a response to said query sentence through a node search path according to the sentence structure of said query sentence by repeating the process of selecting one of a plurality of edges connected to the current node in said knowledge graph based on said state information and moving to the next search node a number of times corresponding to the number of said recombination vocabularys. Claim 12 In claim 11, the step of setting the topic entity is a query response method in which a noun phrase is extracted from a phrase decomposed from the query sentence, and each extracted noun phrase is compared with an entity corresponding to each node of the knowledge graph to set the most similar entity as the topic entity. Claim 13 delete Claim 14 delete Claim 15 In claim 11, the step of generating the recombination vocabulary further generates a dependency matrix representing the dependency relationships between phrases decomposed in the query sentence, and the step of extracting the response is a query answer method that searches for nodes in a knowledge graph based on the dependency matrix together with the plurality of recombination vocabularys. Claim 16 In paragraph 15, the step of generating the recombined vocabulary is a question-answering method that analyzes the dependency relationships between phrases decomposed in the query sentence, and constructs a matrix indicating whether each phrase depends on other phrases according to the analyzed dependency relationships to generate the dependency relationship matrix. Claim 17 In claim 11, the step of extracting the response is a query-response method in which a node for the topic entity in the knowledge graph is selected as an initial node, and then nodes corresponding to each of the multiple recombination vocabularys obtained sequentially are sequentially searched to obtain an entity for the finally selected node as the response. Claim 18 delete Claim 19 In claim 11, the step of extracting the response is a query response method that estimates an action score for each of a plurality of edges connected to the current node in the knowledge graph based on the state information, and determines the current action to select the edge having the largest action score. Claim 20 In claim 19, the step of extracting the response is a query response method that transitions a node connected to an edge selected from the current node according to the current action to a next search node, and updates the state information according to the transitioned state.
Citation Information
Patent Citations
Question-answering system based on reconfiguration of dialogue
KR1020210055449A
