Document question and answer method and device based on topological graph structure

By extracting triplet information from documents and optimizing the topology graph structure, and combining this with a large model for document question answering, the problems of low retrieval accuracy and increased computation time in traditional methods are solved, achieving efficient and accurate document retrieval and question answering.

CN120804245AActive Publication Date: 2025-10-17广州极点三维信息科技有限公司
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510818842.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-10-17
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Traditional knowledge retrieval methods rely on manually designed keywords and large-scale semantic representations, resulting in low retrieval accuracy, increased computation time, lack of interpretability, and inconsistent information recall due to different large-scale models having different semantic representations of the same word.

Method used

By extracting triplet information from target documents, constructing a knowledge graph with a topological structure, performing similarity matching and topological search, and combining this with a large model for information extraction, comprehensive and efficient document question answering is achieved.

Benefits of technology

It improves the comprehensiveness and efficiency of document retrieval and question answering, reduces the consumption of computing resources, avoids recall loss caused by improper keyword settings and confusion in large model matching, and achieves deep understanding and accurate answers to complex documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804245A_ABST
    Figure CN120804245A_ABST
Patent Text Reader

Abstract

The invention discloses a document question and answer method and device based on a topological graph structure, and the method comprises the steps: carrying out the triple information extraction operation of a target document, and obtaining a first relation triple; constructing a target knowledge graph according to the first relation triple; performing triple information extraction operation on the input statement to obtain a second relation triple; according to the second relation triple, performing similarity matching on the target knowledge graph to obtain a first recall node; according to the first recall node, performing topology search on the target knowledge graph to obtain a second recall node; performing information extraction operation on the first recall node and the second recall node to obtain related node information; and inputting an input statement and the related node information into the large model to obtain a target answer. The method can improve the comprehensiveness and efficiency of document retrieval and question answering, and can be widely applied to the technical field of data analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data analysis, and in particular to a document question answering method and device based on a topological graph structure. BACKGROUND

[0002] In a traditional knowledge retrieval method, data is stored in a database in an isolated form. When a certain content needs to be retrieved, a retrieval keyword is designed, and the relevance of each document is calculated by the method of keyword proportion in the total number of characters, so as to recall relevant documents. Not only is the user's question requirement high, but also the quality of the recalled data depends on the quality of the database knowledge. In the era of big data and artificial intelligence, data is divided into blocks by a set block method. Each block is stored in a vector database after being represented by an Embedding vector. In retrieval, the retrieval content is also represented by an Embedding vector. The relevance score is calculated by comparing the vector with the vector in the vector database, so as to recall relevant documents. The traditional method relies too much on manual work, and the questioner needs to have a preliminary understanding of the document to perform accurate keyword retrieval. The vector retrieval relies too much on the semantic representation ability of a large model and the question method. Different large models have different semantic expressions for the same word element, lack of interpretability, and the same large model will also lead to different information retrieved by different question methods for the same event or product, resulting in low accuracy and confusion. Moreover, the calculation time of the large model in vector representation will greatly increase with the increase of the input. SUMMARY

[0003] Therefore, the embodiments of the present application mainly aim to provide a document question answering method and device based on a topological graph structure, so as to solve at least one of the problems in the prior art, and improve the comprehensiveness and efficiency of document retrieval and question answering.

[0004] To achieve the above-mentioned purpose, one aspect of the embodiments of the present application provides a document question answering method based on a topological graph structure, which comprises:

[0005] performing a triple information extraction operation on a target document to obtain a first relationship triple;

[0006] constructing a target knowledge graph according to the first relationship triple;

[0007] performing a triple information extraction operation on an input sentence to obtain a second relationship triple;

[0008] performing a similarity matching on the target knowledge graph according to the second relationship triple to obtain a first recall node;

[0009] performing a topological search on the target knowledge graph according to the first recall node to obtain a second recall node;

[0010] performing an information extraction operation on the first recall node and the second recall node to obtain relevant node information;

[0011] inputting the input sentence and the relevant node information into a large model to obtain a target answer.

[0012] In some embodiments, the performing a triple information extraction operation on the target document to obtain a first relationship triple includes the following steps:

[0013] performing parsing on the target document to obtain a text part, a picture part, and a table part;

[0014] performing triple information extraction on the text part through a named entity recognition model to obtain a third relationship triple;

[0015] obtaining a picture number, caption text information, and a picture link of the picture part to obtain a fourth relationship triple;

[0016] obtaining a table number, a table name, and table content of the table part to obtain a fifth relationship triple;

[0017] obtaining the first relationship triple according to the third relationship triple, the fourth relationship triple, and the fifth relationship triple.

[0018] In some embodiments, the constructing a target knowledge graph according to the first relationship triple includes the following steps:

[0019] establishing an entity node according to a subject element and an object element in the first relationship triple;

[0020] establishing a relationship edge between the subject element and the object element according to a relationship element in the first relationship triple;

[0021] obtaining an initial knowledge graph according to the entity node and the relationship edge;

[0022] performing topological optimization on the initial knowledge graph to obtain the target knowledge graph.

[0023] In some embodiments, the performing topological optimization on the initial knowledge graph to obtain the target knowledge graph includes the following steps:

[0024] performing Embedding vectorization representation on all the subject elements and all the object elements;

[0025] performing Embedding vectorization representation on relationship elements in first relationship triples with the same subject elements and the same object elements.

[0026] obtaining a first cosine similarity between the Embedding vectors corresponding to the relation edges;

[0027] merging the relation edges corresponding to the first cosine similarity greater than a first threshold;

[0028] obtaining a second cosine similarity between the Embedding vectors corresponding to the entity nodes;

[0029] merging the entity nodes corresponding to the second cosine similarity greater than a second threshold.

[0030] In some embodiments, the triple information extraction operation is performed on the input sentence to obtain a second relation triple, including the following steps:

[0031] The triple information extraction is performed on the input sentence by a named entity recognition model to obtain the second relation triple.

[0032] In some embodiments, the similarity matching is performed on the target knowledge graph according to the second relation triple to obtain a first recall node, including the following steps:

[0033] The similarity matching is performed on the subject elements, object elements and relation elements in the target knowledge graph according to the subject elements, object elements and relation elements in the second relation triple to obtain the first recall node.

[0034] In some embodiments, the topological search is performed on the target knowledge graph according to the first recall node to obtain a second recall node, including the following steps:

[0035] The first node probability of an entity node in the target knowledge graph that does not belong to the first recall node is set to 0;

[0036] The sum of each second node probability corresponding to each first recall node is set to 1, and each second node probability is equal;

[0037] An initial probability distribution is obtained according to the first node probability and the second node probability;

[0038] A transition matrix is obtained according to the initial probability distribution;

[0039] The random walk search is performed on the target knowledge graph according to the initial probability distribution and the transition matrix to obtain the second recall node.

[0040] To achieve the above object, another aspect of the embodiment of the present application provides a document question answering device based on a topological graph structure, which comprises:

[0041] A first module is configured to perform a triple information extraction operation on a target document to obtain a first relationship triple;

[0042] A second module is configured to construct a target knowledge graph according to the first relationship triple;

[0043] A third module is configured to perform a triple information extraction operation on an input sentence to obtain a second relationship triple;

[0044] A fourth module is configured to perform a similarity matching operation on the target knowledge graph according to the second relationship triple to obtain a first recall node;

[0045] A fifth module is configured to perform a topological search operation on the target knowledge graph according to the first recall node to obtain a second recall node;

[0046] A sixth module is configured to perform an information extraction operation on the first recall node and the second recall node to obtain relevant node information;

[0047] A seventh module is configured to input the input sentence and the relevant node information into a large model to obtain a target answer.

[0048] To achieve the above object, another aspect of the embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned document question answering method based on a topological graph structure when executing the computer program.

[0049] To achieve the above object, another aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above-mentioned document question answering method based on a topological graph structure.

[0050] To achieve the above object, another aspect of the embodiment of the present application provides a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the above-mentioned document question answering method based on a topological graph structure.

[0051] The embodiments of the present application at least have the following beneficial effects: the present application provides a document question and answer method and device based on a topological graph structure, the scheme obtains a first relationship triple through a triple information extraction operation on a target document; a target knowledge graph is constructed according to the first relationship triple; a second relationship triple is obtained through a triple information extraction operation on an input sentence; a first recall node is obtained by performing similarity matching on the target knowledge graph according to the second relationship triple; a second recall node is obtained by performing topological search on the target knowledge graph according to the first recall node; relevant node information is obtained by performing information extraction operation on the first recall node and the second recall node; the input sentence and the relevant node information are input into a large model to obtain a target answer, which can more comprehensively and quickly search and answer the document content. BRIEF DESCRIPTION OF DRAWINGS

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

[0053] Figure 1 is a flowchart of the document question and answer method based on the topological graph structure provided by the embodiments of the present application;

[0054] Figure 2 is a schematic diagram of the topological structure provided by the embodiments of the present application;

[0055] Figure 3 is a schematic diagram of the document question and answer process based on the topological graph structure provided by the embodiments of the present application;

[0056] Figure 4 is a schematic diagram of the hardware structure of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application, but are only examples of devices and methods consistent with some aspects of the embodiments of the present application as described in the appended claims.

[0058] It should be noted that although the functional modules are divided in the system schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a manner different from the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200" in the specification and claims and the above-mentioned drawings can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information, without departing from the scope of the embodiments of the present application. Depending on the context, the word "if" as used herein can be interpreted as "when" or "upon determining" or "in response to determining".

[0059] The terms "at least one", "multiple", "each", "any" and the like used herein include one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0061] Before the embodiments of the present application are described in detail, first, some nouns and terms involved in the embodiments of the present application are explained, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations.

[0062] Named Entity Recognition (NER) model is a natural language processing (NLP) technology used to identify entities with specific meanings from text, such as names, places, organizations, dates, times, etc.

[0063] Embedding vectorization is a technique for converting data (such as text, images, etc.) into vector representations, widely used in machine learning and natural language processing.

[0064] As shown in Figure 1 The embodiments of the present application provide a document question answering method based on a topological graph structure, which can include but is not limited to steps S100 to S700:

[0065] Step S100, performing a triple information extraction operation on a target document to obtain a first relationship triple;

[0066] Step S200, constructing a target knowledge graph according to the first relationship triple;

[0067] Step S300, performing a triple information extraction operation on the input sentence to obtain a second relationship triple;

[0068] Step S400, performing a similarity matching on the target knowledge graph according to the second relationship triple to obtain a first recall node;

[0069] Step S500, performing a topological search on the target knowledge graph according to the first recall node to obtain a second recall node;

[0070] Step S600, performing an information extraction operation on the first recall node and the second recall node to obtain related node information;

[0071] Step S700, inputting the input sentence and the related node information into a large model to obtain a target answer.

[0072] In step S100 of some embodiments, a triple information extraction operation is performed on the target document input by the user, and optionally, a "subject-relation-object" triple relationship is extracted through a professional field entity recognition NER small model.

[0073] In some embodiments, step S100 can include but is not limited to steps S110 to S150:

[0074] Step S110, parsing the target document to obtain a text part, a picture part, and a table part;

[0075] Step S120, performing a triple information extraction on the text part through a named entity recognition model to obtain a third relationship triple;

[0076] Step S130, obtaining a picture number, caption text information, and a picture link of the picture part to obtain a fourth relationship triple;

[0077] Step S140, obtaining a table number, table name, and table content of the table part to obtain a fifth relationship triple;

[0078] Step S150, obtaining the first relationship triple according to the third relationship triple, the fourth relationship triple, and the fifth relationship triple.

[0079] In steps S110 to S150 of some embodiments, the target document input by the user is first parsed, which can include a text part, a picture part, and a table part. For the text part, a professional field entity recognition (NER) small model is directly used to extract a "subject-relation-object" triple relationship, and a third relationship triple can be obtained, in which the "subject" element, the "relation" element, and the "object" element are all extracted from the text by the NER small model. For the picture part, the number of the picture is taken as the "subject" element of a fourth relationship triple, the caption text information of the picture is taken as the "relation" element of the fourth relationship triple, and the picture link of the picture is taken as the "object" element of the fourth relationship triple. For the table part, the number of the table is set as the "subject" element of a fifth relationship triple, the name of the table is set as the "relation" element of the fifth relationship triple, and the entire content of the table is set as the "object" element of the fifth relationship triple. The first relationship triple is obtained by combining the third relationship triple, the fourth relationship triple, and the fifth relationship triple, and the extraction of the entity triple information of the target document is realized.

[0080] In some embodiments, step S200 can include but is not limited to steps S210 to S240:

[0081] Step S210, establishing an entity node according to the subject element and the object element in the first relationship triple;

[0082] Step S220, establishing a relationship edge between the subject element and the object element according to the relation element in the first relationship triple;

[0083] Step S230, obtaining an initial knowledge graph according to the entity node and the relationship edge;

[0084] Step S240, topologically optimizing the initial knowledge graph to obtain the target knowledge graph.

[0085] In steps S210 to S240 of some embodiments, the target knowledge graph is obtained by topologically optimizing the extracted first relationship triple. Illustratively, the entity node is established according to the names of the "subject" element and the "object" element in the extracted first relationship triple, and the relationship edge between the subject element and the object element is established through the "relation" in the first relationship triple, i.e., the bidirectional edge of subject to object (subject->object) and object to subject (object->subject), so as to establish a bidirectional semantic link between the associated entities. According to the established entity node and bidirectional semantic link, an initial knowledge graph can be obtained, and the target knowledge graph can be obtained by further topologically optimizing the initial knowledge graph.

[0086] In some embodiments, step S240 can include but is not limited to steps S241-S246:

[0087] Step S241, performing Embedding vectorization representation on all the subject elements and all the object elements;

[0088] Step S242, performing Embedding vectorization representation on the relationship elements in the first relationship triplets with the same subject elements and the same object elements;

[0089] Step S243, obtaining the first cosine similarity between the Embedding vectors corresponding to the relationship edges;

[0090] Step S244, merging the relationship edges corresponding to the first cosine similarity greater than a first threshold value;

[0091] Step S245, obtaining the second cosine similarity between the Embedding vectors corresponding to the entity nodes;

[0092] Step S246, merging the entity nodes corresponding to the second cosine similarity greater than a second threshold value.

[0093] In steps S241-S242 of some embodiments, the extracted first relationship triplets are traversed, and the names of all "subject" elements and "object" elements, and the "relationship" of triplets with the same "subject" and "object" are performed Embedding vectorization representation, which can optionally use semantic representation models such as Bert for Embedding vectorization representation.

[0094] In steps S243-S246 of some embodiments, the first cosine similarity between the Embedding vectors of the relationship edges is calculated, and redundant or similar relationships with a first cosine similarity greater than a 90% threshold value are merged. The second cosine similarity between the Embedding vectors of the entity nodes is calculated, and entity nodes with a second cosine similarity greater than 90% are merged. Through Embedding vectorization representation, similarity calculation, merging of redundant or similar relationships, and merging of similar entity nodes, the graph structure can be simplified, redundant data can be removed, and the topological information density of the knowledge graph can be enhanced.

[0095] In some embodiments, after constructing the target knowledge graph, the target knowledge graph can be stored, the complete topological structure can be persisted using a graph native database (Neo4j), and new entity nodes and connections between nodes can be dynamically and real-time added.

[0096] In step S300 of some embodiments, in response to the user input query sentence, the input sentence is extracted for triple information. Optionally, through a special field NER entity recognition small model, the "entity-relation-object" triple extraction can be performed to obtain a second relationship triple containing the entity name and the relationship name in the user query sentence.

[0097] In step S400 of some embodiments, according to the names of the "subject" element and the "object" element and the name of the "relationship" element in the second relationship triple, a similarity matching is performed in the target knowledge graph to find the related entity nodes and the associated relationships in the graph, and a first recall node with similarity matching is obtained.

[0098] In some embodiments, step S500 can include but is not limited to steps S510 to S550:

[0099] Step S510, setting the first node probability of the entity node in the target knowledge graph that does not belong to the first recall node to 0;

[0100] Step S520, setting the sum of each second node probability corresponding to each first recall node to 1, and each second node probability is equal;

[0101] Step S530, obtaining an initial probability distribution according to the first node probability and the second node probability;

[0102] Step S540, obtaining a transition matrix according to the initial probability distribution;

[0103] Step S550, performing a random walk search on the target knowledge graph according to the initial probability distribution and the transition matrix to obtain the second recall node.

[0104] In steps S510 to S530 of some embodiments, in the topological graph structure of the target knowledge graph, the importance weight (i.e., node probability) of the node in the topological structure is initialized according to the first recall node searched by similarity. The sum of the node probabilities of the first recall nodes is set to 1, and the node probabilities of each first recall node are equal. The importance weight of the entity node in the target knowledge graph that does not belong to the first recall node, i.e., the node that has not been recalled, is set to 0. According to the node probability set for each entity node, an initial probability distribution can be obtained. Exemplarily, as shown in Figure 2 the topological structure graph includes five entity nodes of "product, weight, volume, process, and color". If only three entity nodes of "product, weight, and volume" are recalled, the initial probability distribution V = [product: 1 / 3, volume: 1 / 3, weight: 1 / 3, process: 0, color: 0].

[0105] In step S540 of some embodiments, the adjacency matrix A and the transition matrix M are calculated according to the obtained initial probability distribution V. Exemplarily, the adjacency matrix is defined as if there is a relationship edge from entity node i to entity node j, then the element value in the corresponding position in the adjacency matrix is 1, otherwise 0. The transition matrix M is calculated according to the following formula:

[0106]

[0107] In the formula, M ij is the value in the transition matrix; A ij is the value in the adjacency matrix; K is the total number of entity nodes; is the total number of outgoing edges of entity node i.

[0108] In step S550 of some embodiments, the obtained initial probability distribution V and the transition matrix M are used to perform a topology search, i.e., a random walk search on the target knowledge graph. Exemplarily, the iteration formula of the random walk search is as follows:

[0109] r k+1 = (1 - a)V + aM T r k

[0110] In the formula, r k represents the probability score of each entity node after the kth iteration, where r 0 = V; r k+1 represents the probability score of each entity node after the (k+1)th iteration; (·) T represents the transpose operation; a represents the random walk probability, i.e., there is a probability of a to continue walking along the topological structure in each iteration, and a probability of (1-a) to randomly transfer to a node in the initial distribution. Optionally, a takes a value of 0.5.

[0111] In some embodiments, the probability score of each entity node is increased every time the entity node is randomly walked to. When the random walk probability score tends to be stable, i.e., the node probability distribution changes less than a set threshold value e in two iterations, the random walk process is terminated. If the termination condition is not met, the topology search on the target knowledge graph is continued. Optionally, e takes a value of 10 -6 . The set threshold value e is calculated according to the following formula:

[0112] ||r k+1 -r k || < e

[0113] In step S600 of some embodiments, entity node information extraction and missing node recall are performed. Optionally, the probability scores of the entity nodes are sorted in descending order, with higher scores being ranked higher. The topk node extraction hyperparameters are pre-set to extract the topk relevant node information. The entity node object that extracts the relevant node information contains both the first recalled nodes searched by similarity and the second recalled nodes searched by topology, achieving supplementary recall of missing nodes. Illustratively, after terminating the random walk on the target knowledge graph, the probability scores of the entity nodes in the target knowledge graph are obtained, and the entity nodes are sorted in descending order according to the probability scores, with higher scores being ranked higher. Then the relevant node information of the top several entity nodes is extracted. The extracted entity node object includes the first recalled nodes and the second recalled nodes.

[0114] In step S700 of some embodiments, the user input question sentence and the relevant node information extracted from the target knowledge graph are input into the large model for reasoning and analysis, and the large model reasons and returns the answer to the input question.

[0115] As shown in Figure 3 The question and answer process of the document based on the topology graph structure provided by the embodiment of the application can include the following steps:

[0116] First, the NER small model of the professional field is used to extract the “subject-relation-object” triple relationship of the document transmitted by the user. The entities appearing in the document and their corresponding relationships are identified, the topology structure graph is generated according to the entity nodes and the association relationship between the nodes, and the nodes and edges with high similarity are merged through topology optimization on the graph, and then the graph is stored.

[0117] Secondly, the most similar nodes are recalled through similarity search for the question transmitted by the user, and then the missing nodes are recalled through topology search on the graph according to the recalled nodes and edges.

[0118] Finally, the user's question and all the node information recalled by the topology search are summarized, and the answer is given through the summarization and reasoning ability of the large model, and the depth understanding and question and answer of the document are completed.

[0119] The embodiment of the application also provides a document question and answer device based on a topology graph structure, which can realize the above-mentioned document question and answer method based on a topology graph structure. The device comprises:

[0120] A first module is configured to perform a triple information extraction operation on a target document to obtain a first relationship triple.

[0121] A second module is configured to construct a target knowledge graph according to the first relationship triple.

[0122] The third module is configured to perform a triple information extraction operation on the input sentence to obtain a second relation triple;

[0123] The fourth module is configured to perform a similarity matching on the target knowledge graph according to the second relation triple to obtain a first recall node;

[0124] The fifth module is configured to perform a topological search on the target knowledge graph according to the first recall node to obtain a second recall node;

[0125] The sixth module is configured to perform an information extraction operation on the first recall node and the second recall node to obtain related node information;

[0126] The seventh module is configured to input the input sentence and the related node information into a large model to obtain a target answer.

[0127] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically implement the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0128] The embodiment of the application further provides an electronic device, which comprises a processor and a memory, the memory stores a computer program, and the processor implements the above-mentioned document question and answer method based on a topological graph structure when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0129] It can be understood that the content in the above method embodiments is applicable to the device embodiments, the device embodiments specifically implement the functions of the above method embodiments, and achieve the same beneficial effects as the above method embodiments.

[0130] Reference Figure 4 , Figure 4 The electronic device of another embodiment is illustrated, which comprises:

[0131] The processor 801 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., and is used to execute a related program to implement the technical solutions provided by the embodiments of the application.

[0132] The memory 802 can be implemented in the form of read only memory (ROM), static storage device, dynamic storage device or random access memory (RAM), etc. The memory 802 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the related program codes are stored in the memory 802 and are called and executed by the processor 801 to implement the topological graph structure-based document question answering method of the embodiments of the present application;

[0133] The input / output interface 803 is used to realize information input and output;

[0134] The communication interface 804 is used to realize the communication interaction between the device and other devices, and the communication can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0135] The bus 805 transmits information between various components (such as the processor 801, the memory 802, the input / output interface 803 and the communication interface 804) of the device;

[0136] The processor 801, the memory 802, the input / output interface 803 and the communication interface 804 are connected to each other through the bus 805 to realize the communication connection between the device.

[0137] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the topological graph structure-based document question answering method.

[0138] It can be understood that the contents in the above method embodiments are all applicable to the present storage medium embodiment, the function specifically realized by the present storage medium embodiment is the same as that of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0139] The embodiment of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer readable storage medium. The processor of the computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the topological graph structure-based document question answering method.

[0140] In summary, the topological graph structure-based document question answering method and device of the embodiment of the present application has the following advantages:

[0141] 1. The embodiment of the present invention combines the structuring and recall capabilities of topological graphs with the reasoning and analysis capabilities of large models to comprehensively connect and recall information related to user questions, achieve a deep and comprehensive understanding of complex documents, and provide comprehensive, rapid, and accurate answers to questions in the documents.

[0142] 2. The data retrieval method of the topological graph structure of the embodiment of the present invention can make the retrieval results more accurate, comprehensive and controllable. This method has significant advantages in complex relationship modeling and dynamic scene adaptation.

[0143] 3. The embodiment of the present invention also integrates the topological structure and graph database storage method. Unlike traditional keyword retrieval and vectorized retrieval methods after full-text segmentation, the embodiment of the present invention uses the topological structure in the graph database to retrieve entities, and optimizes and expands the data through the relationship edges between entities, thereby performing comprehensive retrieval and recall of data and achieving accurate answers to document questions.

[0144] 4. The embodiments of the present invention optimize and complete knowledge through a dedicated entity recognition small model and graph topology, making search results more accurate, comprehensive, and controllable. This also reduces the computing and time resources consumed by large models during the knowledge comprehension phase, improving search efficiency. This avoids the problem of lost recall due to improper keyword settings during traditional database extraction. Furthermore, the embodiments of the present invention avoid the confusion and poor interpretability of large model matching searches through topological optimization of the graph structure.

[0145] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.

[0146] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the described functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It will also be appreciated that detailed discussion of the actual implementation of each module is not necessary to an understanding of the application. Rather, the actual implementation of the modules, in combination with their attributes, functions, and internal relationships, are to be understood within the context of the devices disclosed herein. Thus, those skilled in the art with access to patents, scientific journals, and other public sources known by those skilled in the art will be able, using ordinary skill, to practice the application as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and that the scope of the present application is to be determined by the entire scope of the claims, along with all equivalents of the claims and their equivalents.

[0147] If the functions are implemented in software, the functions can be stored in or implemented as one or more computer program products, which can be incorporated into a computer- readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a "computer-readable medium" can be any means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

[0148] The logic and / or steps represented in the flowcharts and / or otherwise described herein, for example, can be embodied in non-transitory computer-readable media, which can be executed by an instruction execution system, apparatus, or device such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this document, a "computer-readable medium" can be any means that can store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

[0149] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0150] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques can be used to implement the hardware used in the described embodiments: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and so forth.

[0151] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means that the specific feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In the specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments or examples.

[0152] Although embodiments of the application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, substitutions, and alterations can be made hereto without departing from the spirit and scope of the application. The scope of the application is limited only by the claims and the equivalents thereof.

[0153] The above is a specific description of the preferred embodiment of the present application, but the present application is not limited to the described embodiment, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A document question-answering method based on a topological graph structure, characterized in that: The following steps are involved: Perform triple information extraction on the target document to obtain the first relation triple; Constructing a target knowledge graph based on the first relationship triples; Perform triple information extraction on the input sentence to obtain the second relation triple; Perform similarity matching on the target knowledge graph according to the second relationship triplet to obtain a first recall node; Performing a topological search on the target knowledge graph based on the first recall node to obtain a second recall node; Performing an information extraction operation on the first recall node and the second recall node to obtain relevant node information; The input sentence and the related node information are input into the big model to obtain the target answer.

2. The document question-answering method based on topological graph structure according to claim 1, characterized in that: The step of performing a triple information extraction operation on the target document to obtain a first relation triple comprises the following steps: Parsing the target document to obtain a text portion, an image portion, and a table portion; Extracting triple information from the text portion using a named entity recognition model to obtain a third relation triple; Obtaining the picture number, caption text information, and picture link of the picture portion to obtain a fourth relation triplet; Obtaining the table number, table name, and table content of the table portion to obtain a fifth relation triple; The first relation triplet is obtained according to the third relation triplet, the fourth relation triplet and the fifth relation triplet.

3. The document question-answering method based on topological graph structure according to claim 1, characterized in that: The step of constructing a target knowledge graph according to the first relationship triples includes the following steps: Establishing an entity node according to the subject element and the object element in the first relationship triple; Establishing a relationship edge between the subject element and the object element according to the relationship element in the first relationship triplet; Obtaining an initial knowledge graph based on the entity nodes and the relationship edges; Topological optimization is performed on the initial knowledge graph to obtain the target knowledge graph.

4. The document question-answering method based on topological graph structure according to claim 3, characterized in that: The topological optimization of the initial knowledge graph to obtain the target knowledge graph includes the following steps: Performing Embedding vectorization representation on all the subject elements and all the object elements; Performing Embedding vectorization representation on the relationship elements in the first relationship triples having the same subject element and the same object element; Obtain the first cosine similarity between the embedding vectors corresponding to the relationship edges; Merging the relationship edges corresponding to the first cosine similarity being greater than a first threshold; Obtain the second cosine similarity between the embedding vectors corresponding to the entity nodes; The entity nodes corresponding to the second cosine similarity being greater than a second threshold are merged.

5. The document question-answering method based on topological graph structure according to claim 1, characterized in that: The step of performing a triple information extraction operation on the input sentence to obtain a second relation triple comprises the following steps: The input sentence is subjected to triple information extraction through a named entity recognition model to obtain the second relation triple.

6. The document question-answering method based on topological graph structure according to claim 1, characterized in that: The method of performing similarity matching on the target knowledge graph according to the second relationship triple to obtain a first recall node includes the following steps: Based on the subject element, object element and relationship element in the second relationship triplet, similarity matching is performed on the subject element, object element and relationship element in the target knowledge graph to obtain the first recall node.

7. The document question-answering method based on topological graph structure according to claim 1, characterized in that: The step of performing a topological search on the target knowledge graph according to the first recall node to obtain a second recall node includes the following steps: Setting the first node probability of the entity node in the target knowledge graph that does not belong to the first recalled node to 0; The sum of the probabilities of the second nodes corresponding to the first recall nodes is set to 1, and the probabilities of the second nodes are equal; Obtaining an initial probability distribution according to the first node probability and the second node probability; According to the initial probability distribution, a transfer matrix is ​​obtained; According to the initial probability distribution and the transfer matrix, a random walk search is performed on the target knowledge graph to obtain the second recall node.

8. A document question-answering device based on a topological graph structure, characterized in that: include: The first module is used to perform a triple information extraction operation on the target document to obtain a first relation triple; The second module is used to construct a target knowledge graph based on the first relationship triples; The third module is used to perform a triple information extraction operation on the input sentence to obtain a second relation triple; A fourth module is configured to perform similarity matching on the target knowledge graph based on the second relationship triple to obtain a first recall node; A fifth module is configured to perform a topological search on the target knowledge graph based on the first recall node to obtain a second recall node; A sixth module is configured to perform an information extraction operation on the first recall node and the second recall node to obtain relevant node information; The seventh module is used to input the input sentence and the relevant node information into the large model to obtain the target answer.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Inference question-answering method, device and equipment

    CN111597314A

  • Intelligent question-answering method, system and device for traffic optimization strategy, and medium

    CN111914099A

  • Intelligent question answering method and device based on medical knowledge graph

    CN113505243A

  • Question and answer knowledge retrieval method, device and equipment based on graph embedding

    CN113947084A

  • Large model document question answering method and system based on graph structure

    CN119377361A