A remote sensing knowledge graph model construction method

Through the intelligent judgment and automatic annotation of the knowledge graph model, the problem of low efficiency and accuracy of manual annotation in the existing technology is solved, and efficient and accurate knowledge graph construction and continuous updating are achieved.

CN117875414BActive Publication Date: 2024-09-06ZHONGXIN JINQIAO DIGITAL TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311661972.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2024-09-06
Estimated Expiration
2043-12-06

AI Technical Summary

Technical Problem

The construction process of knowledge graphs in the existing technology requires a large amount of manual annotation, resulting in low work efficiency and accuracy.

Method used

Use the knowledge graph model to build the Transformer model through PyTorch, combine it with WordPiece word segmentation and the BERT model, use the cross-entropy loss function training to generate the knowledge graph model, and automatically determine the location and relationship of knowledge points through k-nearest neighbor algorithm and Euclidean distance calculation, reducing Manual annotation requirements.

Benefits of technology

It improves the construction efficiency and annotation accuracy of the knowledge graph, avoids subjective errors and inconsistencies in manual annotation, and enables the knowledge graph to continuously learn and update and keep pace with the times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117875414B
    Figure CN117875414B
Patent Text Reader

Abstract

The present invention relates to the technical field of knowledge graphs, and provides a method for constructing a knowledge graph model, comprising the following steps: constructing a knowledge graph model through transformer technology; encoding training knowledge, such as encoding in a BERT manner; training existing knowledge relationship instructions into the model; obtaining a knowledge graph model; automatically identifying and mounting knowledge through intelligent judgment of the knowledge graph model, thereby reducing the need for manual annotation and improving the efficiency of knowledge graph construction; intelligently judging knowledge through the model and mounting it on the knowledge graph representation space can improve the accuracy of knowledge annotation and avoid subjective errors and inconsistencies that may exist in manual annotation; the knowledge graph model can continuously learn and update, and as new data and knowledge are continuously accumulated, new knowledge can be automatically mounted on the knowledge graph representation space, so that the knowledge graph can keep pace with the times and reflect the latest information and associations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and specifically to a method for constructing a knowledge graph model. Background Art

[0002] Knowledge graph is a structured way of representing knowledge. It organizes and expresses knowledge by describing the relationships between entities. Entities and relationships are presented in the form of graphs and have a certain structure at the semantic level.

[0003] The Chinese patent announcement number is: CN116662577A, a large-scale language model training method and device based on knowledge graph, the method includes constructing a financial knowledge graph, deriving event-related events, obtaining an event set, converting the event set into an event vector, determining the inference target event and related entities, events and relationships, constructing a logical connection subgraph, simplifying the logical connection subgraph, obtaining a simplified logical subgraph, sorting all events in the simplified logical subgraph, forming an event chain, and obtaining a logical chain; processing sample data according to the inference target event and the logical chain to obtain a training sample, fine-tuning the pre-trained large-scale language model, and obtaining a financial event prediction model; the above invention generates training samples with logical relationships through the knowledge graph, trains the large-scale language model, and enables it to have the thinking and reasoning ability in the vertical direction of finance. In addition, it can also greatly save the cost of manually arranging training samples; but the above invention still requires a lot of manual annotation, and the work efficiency and accuracy are low.

[0004] In summary, the present invention provides a method for constructing a knowledge graph model to solve the above problems. Summary of the invention

[0005] The present invention provides a method for constructing a knowledge graph model, which uses the knowledge graph model to intelligently judge knowledge and mount it to the knowledge graph representation space to solve the problems of low efficiency and accuracy of manual labeling in the prior art.

[0006] The specific technical solutions of the present invention are as follows:

[0007] A method for constructing a knowledge graph model includes the following steps:

[0008] S1, collects knowledge point data, including facts, definitions, principles, rules, examples, and relationships with other knowledge points;

[0009] S2, based on the collected knowledge point data, uses PyTorch to build a Transformer model, which performs sequence modeling based on the self-attention mechanism;

[0010] S3, based on the Transformer model, uses the WordPiece word segmentation algorithm to segment knowledge points into words;

[0011] S4, based on the Transformer model, train the BERT model. The BERT model is based on the Transformer model's deep bidirectional encoding, models words, and generates a fixed-length representation vector;

[0012] S5, write knowledge relationship instructions according to the relationship between knowledge points and other knowledge points, use the knowledge relationship instructions to train the Transformer model, and define the loss function to measure the error of the model output. Finally, train and generate a knowledge graph model, and then generate a space containing nodes and vectors based on the knowledge graph model, that is, the knowledge graph representation space;

[0013] S6, input a new knowledge point into the knowledge graph model, the new knowledge point is marked as Ax, and the k-nearest neighbor algorithm is used to find the position of the knowledge point related to the new knowledge point Ax in the knowledge graph model, and determine the position of the new knowledge point Ax in the knowledge graph representation space according to the search result;

[0014] S7, according to the position of the new knowledge point Ax in the knowledge graph, calculate the Euclidean distance between the new knowledge point Ax and other knowledge points, determine the positional relationship between the new knowledge point Ax and other knowledge points, and use the positional relationship as the relationship instruction between the new knowledge point Ax and other knowledge points, add the relationship instruction to the training set of the knowledge graph model, and update the model parameters.

[0015] A preferred technical solution is that in step S1, the relationship between the knowledge point and other knowledge points is described using text, including: use, include, and consist of.

[0016] A preferred technical solution is that in step S3, the knowledge points are segmented into words, and the semantic information of the knowledge points is screened and retained during the word segmentation process.

[0017] A preferred technical solution, in step S5, the loss function is a cross entropy loss function, and the calculation formula of the cross entropy loss function is as follows:

[0018] L = -∑i = ln[yi*ln(pi)+(1-yi)*ln(1-pi)]

[0019] In the formula, yi represents the real data, pi represents the probability predicted by the model, n represents the number of training samples, and L represents the loss value. The advantage of using the cross entropy loss function is that when updating the parameters of the knowledge graph model, the weight parameters can converge faster, reducing the possibility of overfitting and improving the accuracy of the model.

[0020] A preferred technical solution is that in step S5, the knowledge graph representation space uses a graph database to construct a graph structure, in which knowledge points are used as nodes and the relationships between knowledge points are used as edges.

[0021] A preferred technical solution, in step S6, the k-nearest neighbor algorithm first calculates the similarity between the new knowledge point Ax and other knowledge points, selects k knowledge points similar to the new knowledge point based on the calculated similarity, then calculates the distance between the k knowledge points and the new knowledge point Ax, and selects the knowledge point with the shortest distance as the position of the new knowledge point Ax.

[0022] A preferred technical solution is that in step S7, the position and relationship instructions of the new knowledge point Ax are manually corrected before being added to the training set of the knowledge graph model.

[0023] A preferred technical solution is that in step S7, the relationship instructions use a back-propagation algorithm to propagate the relationship instructions back to the training set of the knowledge graph model through the chain rule.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] 1. The present invention can automatically identify and mount knowledge through the intelligent judgment of the knowledge graph model, thereby reducing the need for manual labeling and improving the efficiency of knowledge graph construction.

[0026] 2. The present invention uses a model to intelligently judge knowledge and mount it on the knowledge graph representation space, which can improve the accuracy of knowledge annotation and avoid subjective errors and inconsistencies that may exist in manual annotation.

[0027] 3. The knowledge graph model in the present invention can continuously learn and update. As new data and knowledge continue to accumulate, it can automatically mount new knowledge to the knowledge graph representation space, so that the knowledge graph can keep pace with the times and reflect the latest information and associations. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a schematic diagram of the overall structure of the present invention.

[0029] Figure 2 It is a schematic diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following embodiments of the present invention are described in further detail in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0031] like Figure 1-2 As shown, the present invention provides a method for constructing a knowledge graph model, comprising the following steps:

[0032] S1, collects knowledge point data, including facts, definitions, principles, rules, examples, and relationships with other knowledge points;

[0033] S2, based on the collected knowledge point data, uses PyTorch to build a Transformer model, which performs sequence modeling based on the self-attention mechanism;

[0034] S3, based on the Transformer model, uses the WordPiece word segmentation algorithm to segment knowledge points into words;

[0035] S4, based on the Transformer model, train the BERT model. The BERT model is based on the Transformer model's deep bidirectional encoding, models words, and generates a fixed-length representation vector;

[0036] S5, write knowledge relationship instructions according to the relationship between knowledge points and other knowledge points, use the knowledge relationship instructions to train the Transformer model, and define the loss function to measure the error of the model output. Finally, train and generate a knowledge graph model, and then generate a space containing nodes and vectors based on the knowledge graph model, that is, the knowledge graph representation space;

[0037] S6, input a new knowledge point into the knowledge graph model, the new knowledge point is marked as Ax, and the k-nearest neighbor algorithm is used to find the position of the knowledge point related to the new knowledge point Ax in the knowledge graph model, and determine the position of the new knowledge point Ax in the knowledge graph representation space according to the search result;

[0038] S7, according to the position of the new knowledge point Ax in the knowledge graph, calculate the Euclidean distance between the new knowledge point Ax and other knowledge points, determine the positional relationship between the new knowledge point Ax and other knowledge points, and use the positional relationship as the relationship instruction between the new knowledge point Ax and other knowledge points, add the relationship instruction to the training set of the knowledge graph model, and update the model parameters.

[0039] As an implementation mode of the present invention, in step S1, the relationship between the knowledge point and other knowledge points is described using text, including: use, include, and consist of.

[0040] As an implementation mode of the present invention, in step S3, the knowledge points are segmented into words, and the semantic information of the knowledge points is screened and retained during the word segmentation process.

[0041] As an implementation mode of the present invention, in step S5, the loss function is a cross entropy loss function, and the calculation formula of the cross entropy loss function is as follows:

[0042] L = -∑i = ln[yi*ln(pi)+(1-yi)*ln(1-pi)]

[0043] In the formula, yi represents the real data, pi represents the probability predicted by the model, n represents the number of training samples, and L represents the loss value. The advantage of using the cross entropy loss function is that when updating the parameters of the knowledge graph model, the weight parameters can converge faster, reducing the possibility of overfitting and improving the accuracy of the model.

[0044] As an implementation mode of the present invention, in step S5, the knowledge graph representation space uses a graph database to construct a graph structure, in which knowledge points are used as nodes and the relationships between knowledge points are used as edges.

[0045] As an embodiment of the present invention, in step S6, the k-nearest neighbor algorithm first calculates the similarity between the new knowledge point Ax and other knowledge points, selects k knowledge points similar to the new knowledge point based on the calculated similarity, and then calculates the distance between the k knowledge points and the new knowledge point Ax, and selects the knowledge point with the shortest distance as the position of the new knowledge point Ax.

[0046] As an implementation mode of the present invention, in step S7, the position and relationship instructions of the new knowledge point Ax are manually corrected before being added to the training set of the knowledge graph model.

[0047] As an implementation mode of the present invention, in step S7, the relational instructions use a back-propagation algorithm to propagate the relational instructions back to the training set of the knowledge graph model through the chain rule.

[0048] Implementation example: This implementation example takes a remote sensing knowledge graph model as an example; first, relevant knowledge point data including remote sensing images, geographic information data, and feature classification are collected, and the relationships between knowledge points are sorted out; for example, remote sensing images, geographic information data, etc. are converted into vector representations as input for knowledge points.

[0049] Based on the collected knowledge point data, PyTorch is used to build the Transformer model. The Transformer model is a model for sequence modeling based on the self-attention mechanism, which consists of an encoder and a decoder.

[0050] Based on the Transformer model, the collected knowledge points are segmented. The WordPiece word segmentation algorithm can divide the knowledge points into finer-grained words and provide more semantic information.

[0051] Based on the Transformer model, the BERT model is used to perform deep bidirectional encoding on the knowledge points after word segmentation to generate a representation vector of fixed length; the BERT model can model the relationship between words.

[0052] Then, based on the knowledge relationships in the field of geology (such as the spatial position relationships of different land objects in remote sensing images), knowledge relationship instructions are written and used to train the Transformer model. At the same time, a loss function is defined to measure the error of the model output. A knowledge graph model is generated through training, and a knowledge graph representation space is obtained, that is, a space containing nodes and vectors.

[0053] Take the new remote sensing knowledge point as input and mark it as Ax; use the k-nearest neighbor algorithm to find the location of the knowledge point related to Ax in the knowledge graph model, and determine the position of Ax in the knowledge graph representation space based on the search results.

[0054] Based on the position of Ax in the knowledge graph, the Euclidean distance between Ax and other knowledge points is calculated to determine the positional relationship between Ax and other knowledge points. The positional relationship is used as the relationship instruction between the new knowledge point Ax and other knowledge points, and is added to the training set of the knowledge graph model to update the model parameters.

[0055] Through the above steps, a remote sensing knowledge graph model can be constructed, and the knowledge graph can be updated and expanded according to new knowledge points, so as to realize the storage, retrieval and reasoning of knowledge, and help users better understand and apply knowledge in the field of remote sensing.

[0056] The embodiments of the present invention are provided for the purpose of illustration and description. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present invention. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A remote sensing knowledge graph model construction method, characterized in that: The following steps are involved: S1, collects knowledge point data including remote sensing images, geographic information data, and object classification, including facts, definitions, principles, rules, examples, and relationships with other knowledge points; S2, based on the collected knowledge point data, uses PyTorch to build a Transformer model, which performs sequence modeling based on the self-attention mechanism; S3, based on the Transformer model, uses the WordPiece word segmentation algorithm to segment knowledge points into words; S4, based on the Transformer model, train the BERT model. The BERT model is based on the Transformer model's deep bidirectional encoding, models words, and generates a fixed-length representation vector; S5, according to the spatial position relationship of different objects in remote sensing images, write knowledge relationship instructions, use knowledge relationship instructions to train the Transformer model, and define the loss function to measure the error of the model output. Finally, train and generate a knowledge graph model, and then generate a space containing nodes and vectors based on the knowledge graph model, that is, the knowledge graph representation space; S6, input a new knowledge point into the knowledge graph model, the new knowledge point is marked as Ax, and the k-nearest neighbor algorithm is used to find the position of the knowledge point related to the new knowledge point Ax in the knowledge graph model, and determine the position of the new knowledge point Ax in the knowledge graph representation space according to the search result; S7, according to the position of the new knowledge point Ax in the knowledge graph, calculate the Euclidean distance between the new knowledge point Ax and other knowledge points, determine the positional relationship between the new knowledge point Ax and other knowledge points, and use the positional relationship as a relationship instruction between the new knowledge point Ax and other knowledge points, add the relationship instruction to the training set of the knowledge graph model, and update the model parameters; In step S1, the relationship between the knowledge point and other knowledge points is described using words, including: use, include, and consist of; In step S3, the knowledge points are segmented into words, and the semantic information of the knowledge points is screened and retained during the word segmentation process; In step S5, the loss function is a cross entropy loss function, and the knowledge graph representation space uses a graph database to construct a graph structure, in which knowledge points are nodes and the relationships between knowledge points are edges; In step S6, the k-nearest neighbor algorithm first calculates the similarity between the new knowledge point Ax and other knowledge points, selects k knowledge points similar to the new knowledge point according to the calculated similarity, and then calculates the distance between the k knowledge points and the new knowledge point Ax, and selects the knowledge point with the shortest distance as the position of the new knowledge point Ax; In step S7, the position and relationship instructions of the new knowledge point Ax are manually corrected before being added to the training set of the knowledge graph model; the relationship instructions use a back-propagation algorithm to propagate the relationship instructions back to the training set of the knowledge graph model through the chain rule.