A graph-based document retrieval method, system and related components

By building a knowledge graph and using graph convolution neural networks, graph-based document search methods solve the problems of excessive search results and high cost in the existing technology, and achieve efficient and accurate document retrieval.

CN112836029BActive Publication Date: 2025-02-18华润数字科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110110581.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-27
Publication Date
2025-02-18
Estimated Expiration
2041-01-27

AI Technical Summary

Technical Problem

In the prior art, there are too many document search results, which consumes time and is expensive.

Method used

Using graph-based document search method, by constructing the target knowledge graph, obtaining the embedded vectors of entity nodes and edge nodes, calculating semantic distances, filtering the minimum semantic subgraph, using graph convolutional neural network to extract feature vectors, and using document subject words The average vector is calculated by cosine similarity and determines whether it is greater than the similarity threshold to retrieve the target document.

Benefits of technology

It effectively reduces the number of irrelevant documents in the collection of documents to be retrieved, reduces the search cost, improves the search efficiency, and directly retrieves the target documents from the candidate documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112836029B_ABST
    Figure CN112836029B_ABST
Patent Text Reader

Abstract

The present invention discloses a document retrieval method, system and related components based on a graph, wherein the method comprises: obtaining documents to be retrieved to construct a target knowledge graph and obtaining embedding vectors corresponding to entity nodes and edge nodes therein, calculating the semantic distance between every two entity nodes; obtaining a minimum semantic subgraph containing all retrieval keywords input by a user; obtaining a subject word set of each document in a document set and calculating an average vector; obtaining a feature vector of the minimum semantic subgraph, performing cosine similarity calculation on the feature vector and the average vector, taking documents whose calculation results are greater than a similarity threshold as candidate retrieved documents, and retrieving a target retrieved document. The present invention calculates feature vectors and the average vector of documents using a cosine similarity calculation method, selects candidate retrieved documents according to the calculation results, and retrieves a target retrieved document from the candidate retrieved documents. The entire calculation process is simple and effective, with clear objectives, and reduces the retrieval cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of document retrieval technology, and in particular to a graph-based document retrieval method, system and related components thereof. Background Art

[0002] People often need to retrieve information, and the current mainstream method is to perform keyword-based retrieval on the document collection to be retrieved. There are two prominent phenomena when users use keywords: "lack" and "error". "Lack" means that users do not know much about things and do not know more detailed keywords. "Error" means that the search keywords used by users are not real keywords that reflect the characteristics of things. The current mainstream information retrieval ideas are roughly the following:

[0003] 1. Traditional full-text search engines such as ElasticSearch and Slor use retrieval schemes such as TF-IDF (termfrequency–inverse document frequency, a commonly used weighting technology for information retrieval and data mining) and BM25 (an algorithm used to evaluate the relevance between search terms and documents);

[0004] 2. By training a large amount of labeled data, deep neural networks are used to establish semantic associations between questions and answers, thereby locating the starting position of the answer in the document.

[0005] The first method often produces too many answers, and it still takes a lot of effort to filter them out to get the desired information. The second method requires a lot of resources to collect and organize training data, which is costly. Summary of the invention

[0006] The embodiments of the present invention provide a graph-based document retrieval method, system and related components thereof, aiming to solve the problems of excessive retrieval results, time-consuming and high cost in the prior art.

[0007] In a first aspect, an embodiment of the present invention provides a graph-based document retrieval method, which includes:

[0008] Obtain the documents to be retrieved and construct a document collection, use natural language processing technology to identify entities in the document collection and the relationships between entities, and construct a target knowledge graph;

[0009] Obtain the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculate the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculate the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors;

[0010] Obtaining a search keyword set input by a user, and filtering out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph;

[0011] Obtain a set of subject words for each document in the document set, obtain a corresponding embedding vector for each subject word, and calculate an average vector of the subject word based on the embedding vector of the subject word;

[0012] A graph convolutional neural network is used to extract a feature vector of the minimum semantic subgraph, and a cosine similarity calculation is performed on the feature vector and the average vector to determine whether the calculation result is greater than a similarity threshold;

[0013] If the calculation result is greater than the similarity threshold, the document corresponding to the subject word set is taken as a candidate retrieval document, and the target retrieval document is retrieved.

[0014] In a second aspect, an embodiment of the present invention provides a graph-based document retrieval system, which includes:

[0015] A target knowledge graph acquisition unit is used to acquire documents to be retrieved and construct a document collection, identify entities in the document collection and the relationships between entities using natural language processing technology, and construct a target knowledge graph;

[0016] A semantic distance calculation unit, used to obtain the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculate the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculate the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors;

[0017] A minimum semantic subgraph acquisition unit, used to acquire a search keyword set input by a user, and filter out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph;

[0018] An average vector calculation unit, used to obtain a set of subject words for each document in the document set, obtain a corresponding embedding vector for each subject word, and calculate an average vector of the subject word based on the embedding vector of the subject word;

[0019] A similarity judgment unit is used to extract a feature vector of the minimum semantic subgraph by using a graph convolutional neural network, and perform cosine similarity calculation on the feature vector and the average vector to determine whether the calculation result is greater than a similarity threshold;

[0020] The target retrieval document acquisition unit is used to take the document corresponding to the subject word set as a candidate retrieval document and retrieve the target retrieval document if the calculation result is greater than the similarity threshold.

[0021] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the graph-based document retrieval method described in the first aspect is implemented.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the graph-based document retrieval method described in the first aspect above.

[0023] The embodiment of the present invention provides a document retrieval method, system and related components based on a graph. The method includes obtaining documents to be retrieved, constructing a document collection, using natural language processing technology to identify entities in the document collection and the relationship between entities, and constructing a target knowledge graph; obtaining the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculating the cosine similarity of the embedding vectors corresponding to each two entity nodes in a predetermined reference knowledge graph, and calculating the semantic distance between each two entity nodes according to the cosine similarity of the embedding vectors; obtaining a search keyword set input by a user, and filtering out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph; obtaining a subject word set of each document in the document collection, and obtaining the corresponding embedding vector of each subject word, and calculating the average vector of the subject word according to the embedding vector of the subject word; extracting the feature vector of the minimum semantic subgraph by using a graph convolutional neural network, and performing cosine similarity calculation on the feature vector and the average vector, and judging whether the calculation result is greater than a similarity threshold; if the calculation result is greater than the similarity threshold, taking the document corresponding to the subject word set as a candidate to be retrieved document, and retrieving the target retrieval document. The embodiment of the present invention uses the cosine similarity calculation method to calculate the feature vector of the smallest semantic subgraph in the target knowledge graph and the average vector of the document, screens out candidate retrieved documents according to the calculation results, and directly retrieves the target retrieval document from the candidate retrieved documents. The entire calculation process is simple and effective, with clear goals, and reduces the retrieval cost. The present invention reduces the number of irrelevant documents in the document set to be retrieved, thereby reducing the workload of subsequent retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0025] Figure 1 A schematic diagram of a flow chart of a graph-based document retrieval method provided by an embodiment of the present invention;

[0026] Figure 2 A schematic diagram of minimum semantic subgraph screening for a graph-based document retrieval method provided by an embodiment of the present invention;

[0027] Figure 3 A schematic block diagram of a graph-based document retrieval system provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0030] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0031] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0032] See also Figure 1 , Figure 1 A flowchart of a graph-based document retrieval method provided by an embodiment of the present invention includes steps S101 to S106.

[0033] S101, obtaining documents to be retrieved, and constructing a document collection, using natural language processing technology to identify entities in the document collection and relationships between entities, and constructing a target knowledge graph;

[0034] In this step, all documents that need to be retrieved are obtained to construct a document collection, and then the entities in the document collection and the relationships between entities are identified through natural language technology such as word segmentation, named entity recognition, and relationship extraction, so as to construct a target knowledge graph. The words in the document are segmented from the sentence using word segmentation technology, and then the entities with specific meanings in the segmented words are identified using named entity recognition technology, and finally the relationship between the entities is obtained using the relationship extraction technology, so as to construct a target knowledge graph based on the entities and the relationships between entities.

[0035] In one embodiment, the identifying entities in the document collection and the relationships between entities by using natural language processing technology includes:

[0036] Constructing an entity-document mapping table according to the relationship between the entity and the document;

[0037] Obtain the number of accesses to the document within a period of time, and determine whether the number of accesses is less than a threshold value;

[0038] If the access times are less than the times threshold, the corresponding document is deleted from the entity-document mapping table.

[0039] In this embodiment, the entity is matched with the document, an entity-document mapping table is constructed, and then the document with the number of accesses less than the number threshold is found in the document collection and deleted, and the entity-document mapping table is updated. When the entity in the target knowledge graph appears in a document, the entity and the document are considered to be in a corresponding relationship, wherein one entity may correspond to one document or multiple documents, so it is necessary to screen this. The number of accesses to all documents in a period of time is obtained, and the LRU algorithm (i.e., the least recently used method, the core idea of ​​which is that the most recently used page data will still be used in the future, and the page that has not been used for a long time is likely to remain unused for a long time in the future. Based on this idea, there will be a cache elimination mechanism, each time the longest unused data is found from the memory and then replaced, so as to store new data!) is used to obtain the document with the number of accesses less than the number threshold, and the document is replaced from the entity-document mapping table. In this way, when the relationship between the entity and the document is searched again, the relationship between the deleted document and the entity will not be displayed.

[0040] S102, obtaining the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculating the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculating the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors;

[0041] In this step, in the target knowledge graph, all entities are set as corresponding entity nodes, and the relationship between entities is used as edge nodes. The embedding vectors corresponding to the entity nodes and edge nodes are obtained by the translation embedding algorithm (i.e., TransE algorithm). In a predetermined reference knowledge graph (such as large knowledge graphs with rich entities such as HowNet, Freebase, Wikipedia, etc.), the cosine similarity of the embedding vectors corresponding to the two entity nodes is calculated to obtain the semantic distance between the two entity nodes. In one embodiment, the semantic distance between two entity nodes is calculated by the following formula: Among them, sim(E i ,E j ) is the cosine similarity of the embedding vectors of two entity nodes, is the sum of the embedding vectors of all connected edges of entity Ei, It is the sum of the embedding vectors of all connected edges of entity Ej.

[0042] S103, obtaining a search keyword set input by a user, and filtering out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph;

[0043] In this step, according to the search keyword set input by the user, the node positions of all search keywords are found in the target knowledge graph and extracted to obtain the semantic subgraph containing all search keywords, and the minimum semantic subgraph with the smallest radius is selected therefrom.

[0044] In one embodiment, the step S103 includes:

[0045] Taking all search keywords in the search keyword set as nodes;

[0046] First, select any node as the central node and enter the semantic subgraph selection step;

[0047] Semantic subgraph selection step: taking the semantic distance between another node farthest from the central node as the radius, forming a semantic subgraph including all nodes, adjusting the radius of the semantic subgraph, increasing or decreasing the predetermined value in sequence, and obtaining a semantic subgraph with the smallest radius and including all search keywords;

[0048] Continue to select another node as the central node and enter the semantic subgraph selection step;

[0049] The semantic subgraphs corresponding to all nodes are obtained, and the minimum semantic subgraph of the semantic subgraph group with the smallest radius is selected from them.

[0050] In this embodiment, any one of the search keywords input by the user is selected as the central node, and the semantic subgraph selection step is performed to obtain the semantic subgraph, and then this process is repeated until all the search keywords form corresponding semantic subgraphs, and then the semantic subgraph with the smallest radius is selected from all the semantic subgraphs as the smallest semantic subgraph. After obtaining a semantic subgraph, the radius of the next semantic subgraph is the radius of the previous semantic subgraph plus or minus a predefined Δr, so that the radius of the next semantic subgraph includes all the search keywords.

[0051] like Figure 2 As shown in the figure, the search keywords input by the user are kw1, kw2 and kw3, the search keyword kw1 is taken as the central node, the node farthest from the search keyword kw1 is kw3, and the semantic distance between kw1 and kw3 is taken as the radius, so as to obtain the sub-nodes. Figure 1 Similarly, with kw2 as the central node, the semantic distance radius between kw2 and kw1 is obtained. Figure 2 ; Taking kw3 as the central node, the semantic distance radius between kw3 and kw1 is obtained Figure 3 ; from the son Figure 1 ,son Figure 2 ,son Figure 3 Filter out the child with the smallest radius Figure 2 , as the minimum semantic subgraph.

[0052] In a specific embodiment, obtaining a search keyword set input by a user includes:

[0053] Obtaining a search keyword input by a user, and searching for a corresponding position of the search keyword in the knowledge graph;

[0054] If the search keyword is not found in the knowledge graph, an embedding vector of the search keyword is obtained by a word embedding method, and a synonym set of the search keyword is obtained by a cosine similarity calculation method;

[0055] The search keyword is replaced by a word in the synonym set that is most semantically similar to the search keyword.

[0056] In this embodiment, since the user may input inaccurate search keywords when inputting search keywords, the embedding vector of the search keywords input by the user is obtained by the word embedding method, and then the cosine similarity calculation method is used to obtain a synonym set, and the word with the closest semantics to the search keyword is found from the synonym set to replace the search keyword. When performing cosine similarity calculation, the similarity of the calculation result is compared with the synonym threshold, and the words with similarity deviation less than the synonym threshold are regarded as synonyms.

[0057] S104, obtaining a subject word set of each document in the document set, obtaining a corresponding embedding vector of each subject word, and calculating an average vector of the subject word according to the embedding vector of the subject word;

[0058] In this step, the embedding vector of the subject word corresponding to each document in the document set is calculated, and the average vector of the subject word is calculated using the embedding vector. Specifically, the subject word set of the document is extracted using the LDA topic model or the probabilistic latent semantic indexing topic model, and then the embedding vector of each subject word is obtained according to the word2vec method. Among them, LDA, namely Latent Dirichlet Allocation, is a document topic generation model, also known as a three-layer Bayesian probability model, which includes a three-layer structure of words, topics and documents; Word2vec is a group of related models used to generate word vectors. These models are shallow and two-layer neural networks used to train to reconstruct linguistic word texts.

[0059] In one embodiment, calculating the average vector of the subject word according to the embedding vector of the subject word includes:

[0060] Obtain the word vector corresponding to the subject word in a preset word vector list, and calculate the average value of the word vector to obtain the average vector of the subject word.

[0061] In this embodiment, the word vector corresponding to the subject word is found in the preset word vector list, and the average value of all word vectors is calculated, which is the average vector of the subject word. The word vector is also the embedding vector.

[0062] S105, using a graph convolutional neural network to extract a feature vector of the minimum semantic subgraph, and performing cosine similarity calculation on the feature vector and the average vector, to determine whether the calculation result is greater than a similarity threshold;

[0063] In this step, the cosine similarity is calculated between the feature vector and the average vector, and the calculated result is compared with the similarity threshold, so as to determine whether the corresponding document is a candidate document to be retrieved.

[0064] The specific process of extracting the feature vector of the minimum semantic subgraph by using the graph convolutional neural network includes:

[0065] Defining the number of convolutional layers of the graph convolutional neural network according to the minimum semantic subgraph;

[0066] The eigenvector is calculated by the following formula: in A is the adjacency matrix of the nodes in the knowledge graph, D is the in-degree matrix of the nodes in the knowledge graph, W0 is the weight matrix, σ is the activation function, and D ii =∑ j A ij , X is the adjacency matrix of the minimum semantic subgraph.

[0067] S106: If the calculation result is greater than the similarity threshold, the document corresponding to the subject word set is used as a candidate retrieval document, and a target retrieval document is retrieved.

[0068] In this step, when the calculation result is greater than the similarity threshold, the document corresponding to the subject word set is taken as a candidate to be retrieved document and is put into the candidate to be retrieved document set; when the calculation result is less than the similarity threshold, the document corresponding to the subject word set is not put into the candidate to be retrieved document set. After all candidate to be retrieved documents are obtained, the corresponding target retrieval document is retrieved from the candidate to be retrieved document set.

[0069] See also Figure 3 , Figure 3 A schematic block diagram of a graph-based document retrieval system provided by an embodiment of the present invention, the graph-based document retrieval system 200 includes:

[0070] The target knowledge graph acquisition unit 201 is used to acquire documents to be retrieved and construct a document set, identify entities in the document set and the relationships between entities using natural language processing technology, and construct a target knowledge graph;

[0071] A semantic distance calculation unit 202 is used to obtain the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculate the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculate the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors;

[0072] The minimum semantic subgraph acquisition unit 203 is used to acquire the search keyword set input by the user, and filter out the minimum semantic subgraph containing all the search keywords in the search keyword set in the target knowledge graph;

[0073] The average vector calculation unit 204 is used to obtain a set of topic words for each document in the document set, obtain a corresponding embedding vector for each topic word, and calculate an average vector of the topic word according to the embedding vector of the topic word;

[0074] A similarity judgment unit 205 is used to extract a feature vector of the minimum semantic subgraph by using a graph convolutional neural network, and perform cosine similarity calculation on the feature vector and the average vector to determine whether the calculation result is greater than a similarity threshold;

[0075] The target retrieval document acquisition unit 206 is used to take the document corresponding to the subject word set as a candidate retrieval document and retrieve the target retrieval document if the calculation result is greater than the similarity threshold.

[0076] In one embodiment, the target knowledge graph acquisition unit 201 includes:

[0077] A mapping table construction unit, used to construct an entity-document mapping table according to the relationship between the entity and the document;

[0078] An access count acquisition unit, used to acquire the access count of the document within a period of time, and determine whether the access count is less than a threshold value;

[0079] The document deleting unit is used to delete the corresponding document from the entity-document mapping table if the access times are less than the times threshold.

[0080] In one embodiment, the semantic distance calculation unit 202 includes:

[0081] The formula calculation unit is used to calculate the semantic distance between two entity nodes using the following formula:

[0082]

[0083] Among them, sim(E i ,E j ) is the cosine similarity of the embedding vectors of two entity nodes, ∑R Ei For entity E i The sum of the embedding vectors of all connected edges, ∑R Ej For entity E j The sum of the embedding vectors of all connected edges.

[0084] In one embodiment, the minimum semantic subgraph acquisition unit 203 includes:

[0085] A node acquisition unit, used for taking all search keywords in the search keyword set as nodes;

[0086] A central node selection unit is used to first select any node as the central node and enter the semantic subgraph selection step;

[0087] A semantic subgraph selection unit, used in the semantic subgraph selection step: taking the semantic distance between another node farthest from the central node as the radius, forming a semantic subgraph including all nodes, adjusting the radius of the semantic subgraph, increasing or decreasing the predetermined value in sequence, and obtaining a semantic subgraph with the smallest radius and including all search keywords;

[0088] A central node reselection unit, used to continue selecting another node as the central node and enter the semantic subgraph selection step;

[0089] The minimum semantic subgraph screening unit is used to obtain the semantic subgraphs corresponding to all nodes, and select the minimum semantic subgraph of the semantic subgraph group with the smallest radius.

[0090] In one embodiment, the minimum semantic subgraph acquisition unit 203 includes:

[0091] A search keyword acquisition unit, used to acquire the search keyword input by the user and search for the corresponding position of the search keyword in the knowledge graph;

[0092] A synonym set acquisition unit, used for obtaining an embedding vector of the search keyword by a word embedding method if the search keyword corresponding to the search keyword is not found in the knowledge graph, and obtaining a synonym set of the search keyword by a cosine similarity calculation method;

[0093] The keyword replacement unit is used to replace the search keyword with a word in the synonym set that is most semantically similar to the search keyword.

[0094] In one embodiment, the similarity determination unit 205 includes:

[0095] A convolution layer number confirmation unit, used to define the number of convolution layers of the graph convolutional neural network according to the minimum semantic subgraph;

[0096] The feature vector calculation unit is used to calculate the feature vector using the following formula:

[0097]

[0098] in A is the adjacency matrix of the nodes in the knowledge graph, D is the in-degree matrix of the nodes in the knowledge graph, W0 is the weight matrix, σ is the activation function, and D ii =∑ j A ij , X is the adjacency matrix of the minimum semantic subgraph.

[0099] In one embodiment, the average vector calculation unit 204 includes:

[0100] The word vector average value calculation unit is used to obtain the word vector corresponding to the subject word in a preset word vector list, and calculate the average value of the word vector to obtain the average vector of the subject word.

[0101] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the graph-based document retrieval method as described above when executing the computer program.

[0102] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the graph-based document retrieval method as described above is implemented.

[0103] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0104] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A graph-based document retrieval method, characterized in that: include: Obtain the documents to be retrieved and construct a document collection, use natural language processing technology to identify entities in the document collection and the relationships between entities, and construct a target knowledge graph; Obtain the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculate the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculate the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors; Obtaining a search keyword set input by a user, and filtering out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph; Obtain a set of subject words for each document in the document set, obtain a corresponding embedding vector for each subject word, and calculate an average vector of the subject word based on the embedding vector of the subject word; A graph convolutional neural network is used to extract a feature vector of the minimum semantic subgraph, and a cosine similarity calculation is performed on the feature vector and the average vector to determine whether the calculation result is greater than a similarity threshold; If the calculation result is greater than the similarity threshold, the document corresponding to the subject word set is taken as a candidate retrieval document, and the target retrieval document is retrieved.

2. The graph-based document retrieval method according to claim 1, characterized in that: The using of natural language processing technology to identify entities in the document collection and relationships between entities includes: Constructing an entity-document mapping table according to the relationship between the entity and the document; Obtain the number of accesses to the document within a period of time, and determine whether the number of accesses is less than a threshold value; If the access times are less than the times threshold, the corresponding document is deleted from the entity-document mapping table.

3. The graph-based document retrieval method according to claim 1, characterized in that: The step of obtaining the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculating the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculating the semantic distance between every two entity nodes according to the cosine similarity of the embedding vectors includes: The semantic distance between two entity nodes is calculated by the following formula: Among them, sim(E i ,E j ) is the cosine similarity of the embedding vectors of two entity nodes, ∑R Ei is the sum of the embedding vectors of all connected edges of entity Ei, ∑R Ej It is the sum of the embedding vectors of all connected edges of entity Ej.

4. The graph-based document retrieval method according to claim 1, characterized in that: The step of obtaining a search keyword set input by a user and filtering out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph includes: Taking all search keywords in the search keyword set as nodes; First, select any node as the central node and enter the semantic subgraph selection step; Semantic subgraph selection step: taking the semantic distance between another node farthest from the central node as the radius, forming a semantic subgraph including all nodes, adjusting the radius of the semantic subgraph, increasing or decreasing the predetermined value in sequence, and obtaining a semantic subgraph with the smallest radius and including all search keywords; Continue to select another node as the central node and enter the semantic subgraph selection step; The semantic subgraphs corresponding to all nodes are obtained, and the minimum semantic subgraph of the semantic subgraph group with the smallest radius is selected from them.

5. The graph-based document retrieval method according to claim 1, characterized in that: The step of obtaining a search keyword set input by a user includes: Obtaining a search keyword input by a user, and searching for a corresponding position of the search keyword in the knowledge graph; If the search keyword is not found in the knowledge graph, an embedding vector of the search keyword is obtained by a word embedding method, and a synonym set of the search keyword is obtained by a cosine similarity calculation method; The search keyword is replaced by a word in the synonym set that is most semantically similar to the search keyword.

6. The graph-based document retrieval method according to claim 1, characterized in that: The step of extracting the feature vector of the minimum semantic subgraph by using a graph convolutional neural network includes: Defining the number of convolutional layers of the graph convolutional neural network according to the minimum semantic subgraph; The eigenvector is calculated by the following formula: in A is the adjacency matrix of the nodes in the knowledge graph, D is the in-degree matrix of the nodes in the knowledge graph, W0 is the weight matrix, σ is the activation function, and D ii =∑ j A ij , X is the adjacency matrix of the minimum semantic subgraph.

7. The graph-based document retrieval method according to claim 1, characterized in that: The step of calculating the average vector of the subject word according to the embedding vector of the subject word comprises: Obtain the word vector corresponding to the subject word in a preset word vector list, and calculate the average value of the word vector to obtain the average vector of the subject word.

8. A graph-based document retrieval system, characterized in that: include: A target knowledge graph acquisition unit is used to acquire documents to be retrieved and construct a document collection, identify entities in the document collection and the relationships between entities using natural language processing technology, and construct a target knowledge graph; A semantic distance calculation unit, used to obtain the embedding vectors corresponding to all entity nodes and edge nodes in the target knowledge graph, calculate the cosine similarity of the embedding vectors corresponding to every two entity nodes in the predetermined reference knowledge graph, and calculate the semantic distance between every two entity nodes based on the cosine similarity of the embedding vectors; A minimum semantic subgraph acquisition unit, used to acquire a search keyword set input by a user, and filter out a minimum semantic subgraph containing all search keywords in the search keyword set in the target knowledge graph; An average vector calculation unit, used to obtain a set of subject words for each document in the document set, obtain a corresponding embedding vector for each subject word, and calculate an average vector of the subject word based on the embedding vector of the subject word; A similarity judgment unit is used to extract a feature vector of the minimum semantic subgraph by using a graph convolutional neural network, and perform cosine similarity calculation on the feature vector and the average vector to determine whether the calculation result is greater than a similarity threshold; The target retrieval document acquisition unit is used to take the document corresponding to the subject word set as a candidate retrieval document and retrieve the target retrieval document if the calculation result is greater than the similarity threshold.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the graph-based document retrieval method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the graph-based document retrieval method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Semantic relation identification method and device

    CN110188168A

  • Knowledge graph retrieval method and retrieval system based on packaging field

    CN110516047A