Remote sensing text similarity calculation method based on knowledge graph and comparative learning
By applying knowledge graphs and comparison learning methods in the field of remote sensing, the knowledge graphs in the field of remote sensing and training the word embedding model, the problems of small word vector distinction and insufficient accuracy of calculation results in the existing technology are solved, and a higher similarity calculation accuracy and scope of application are achieved.
Patent Information
- Application Number
- CN202411678241.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-22
Smart Images

Figure CN119538903A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of remote sensing science and natural language processing technology, and in particular to a remote sensing text similarity calculation method based on knowledge graph and contrastive learning. Background Art
[0002] At present, the calculation method of text similarity in the remote sensing field mainly obtains the word vector of the text through models such as word2vec and BERT, and then measures the similarity of the text by calculating the cosine distance and Euclidean distance between the word vectors. However, these methods have obvious shortcomings. Specifically, the word2vec-based method cannot cover the words that do not exist in the corpus when calculating the similarity, which limits the calculation scope; and the BERT-based method is not limited by the corpus, but the embedding vector obtained by it has a low degree of differentiation, which leads to insufficient accuracy of the similarity calculation results.
[0003] Therefore, how to learn the semantic relationship between words and generate discriminative word vectors, improve the accuracy and scope of text similarity calculation, and enhance the generalization ability of the model has become an urgent problem to be solved in the field of remote sensing science and natural language processing technology. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a remote sensing text similarity calculation method based on knowledge graph and contrastive learning, which can solve the problems that the existing methods have low discrimination of word vectors when calculating text similarity in the remote sensing field, poor accuracy of similarity calculation results, and a small scope of application of the calculation method.
[0005] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0006] The present invention is a remote sensing text similarity calculation method based on knowledge graph and contrastive learning, comprising the following operations:
[0007] Use crawler tools to collect remote sensing text data from data websites and journal articles related to the remote sensing field, build a remote sensing field knowledge graph based on the remote sensing text data, and train a simple comparative learning word embedding model;
[0008] Acquire remote sensing words for which similarity is to be calculated, determine corresponding word vectors based on the knowledge graph based on the remote sensing field knowledge graph, and determine corresponding word vectors based on the simple contrastive learning word embedding model based on the simple contrastive learning word embedding model;
[0009] The cosine similarity calculation method is used to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and the similarity based on the simple contrastive learning word embedding model is calculated according to the word vector based on the simple contrastive learning word embedding model;
[0010] The similarity result is obtained by weighted summing the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model.
[0011] A further improvement of the present invention is that the remote sensing field knowledge graph includes professional vocabulary in the remote sensing field and the relationships between the professional vocabulary.
[0012] A further improvement of the present invention is that the step of obtaining the remote sensing words for which similarity is to be calculated and determining the corresponding word vector based on the knowledge graph based on the remote sensing field knowledge graph specifically includes:
[0013] Based on the remote sensing words whose similarity is to be calculated, the word vector based on the knowledge graph is obtained through an embedding model based on a translation mechanism, including the following steps:
[0014] For any triple, i.e., a combination of a head entity, a relationship, and a tail entity, the head entity and the relationship are mapped to a space of preset dimensions to obtain the head entity vector and the relationship vector in the same space, and the following formula is used to determine whether the mapped vector is correct:
[0015] h+r≈t
[0016] In the formula, h represents the head entity vector obtained by mapping; r represents the relationship vector obtained by mapping; t represents the tail entity vector obtained by mapping, that is, the sum of the head entity vector and the relationship vector obtained by mapping is approximately equal to the tail entity vector.
[0017] A further improvement of the present invention is that: the cosine similarity calculation method is used to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and the similarity based on the simple contrastive learning word embedding model is calculated according to the word vector based on the simple contrastive learning word embedding model. The corresponding calculation formula is as follows:
[0018]
[0019] In the formula, A and B represent the two word vectors corresponding to the two remote sensing words whose similarity is to be calculated; ||A|| and ||B|| represent the lengths of word vectors A and B respectively.
[0020] A further improvement of the present invention is that: the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model are weighted and summed to obtain a similarity result, and the corresponding calculation formula is as follows:
[0021] Similarity=α×SimGraph+β×SimCSE
[0022] In the formula, Similarity represents the similarity result obtained by weighted summation; SimGraph represents the similarity based on the knowledge graph; SimCSE represents the similarity based on the simple contrastive learning word embedding model; α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
[0023] A further improvement of the present invention is that the weight coefficient α corresponding to the similarity based on the knowledge graph and the weight coefficient β corresponding to the similarity based on the simple contrastive learning word embedding model are determined as follows:
[0024]
[0025] In the formula, α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
[0026] The beneficial effects of the present invention are as follows: the present invention proposes a remote sensing text similarity calculation method based on knowledge graph and contrastive learning, collects remote sensing text data from data websites and journal articles related to the remote sensing field by using a crawler tool, constructs a remote sensing field knowledge graph based on the remote sensing text data, and trains a simple contrastive learning word embedding model; obtains remote sensing words whose similarity is to be calculated, determines the corresponding word vector based on the knowledge graph based on the remote sensing field knowledge graph, and determines the corresponding word vector based on the simple contrastive learning word embedding model based on the simple contrastive learning word embedding model; uses a cosine similarity calculation method to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and calculates the corresponding similarity based on the simple contrastive learning word embedding model according to the word vector based on the simple contrastive learning word embedding model; and performs weighted summation on the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model to obtain a similarity result. By combining the remote sensing field knowledge graph and the simple contrastive learning word embedding model, the present invention can accurately capture the semantic information of the remote sensing field text, improve the accuracy of similarity calculation, and the calculation method has a wide range of applications, and can be used to calculate the vocabulary similarity in the remote sensing field, as well as data recommendation services; and by training the contrastive learning word embedding model, the present invention can learn the semantic relationship between words and generate word vectors with discriminability, thereby enhancing the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1A schematic diagram of a flow chart of a remote sensing text similarity calculation method based on knowledge graph and contrastive learning provided in an embodiment of the present invention;
[0028] Figure 2 A calculation flow chart of a method for calculating text similarity in the remote sensing field based on a knowledge graph and a simple contrastive learning word embedding model provided in an embodiment of the present invention;
[0029] Figure 3 A schematic diagram of the basic concept of obtaining word vectors using an embedding model based on a translation mechanism provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0031] See also Figure 1 The remote sensing text similarity calculation method based on knowledge graph and contrastive learning in this embodiment includes the following steps:
[0032] S1, using crawler tools to collect remote sensing text data from data websites and journal articles related to the remote sensing field, building a remote sensing field knowledge graph based on the remote sensing text data, and training a simple comparative learning word embedding model;
[0033] S2, obtaining remote sensing words for which similarity is to be calculated, determining corresponding word vectors based on the knowledge graph based on the remote sensing field knowledge graph, and determining corresponding word vectors based on the simple contrastive learning word embedding model based on the simple contrastive learning word embedding model;
[0034] S3, using a cosine similarity calculation method to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and calculating the corresponding similarity based on the simple contrastive learning word embedding model according to the word vector based on the simple contrastive learning word embedding model;
[0035] S4, performing weighted summation on the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model to obtain a similarity result.
[0036] The remote sensing field knowledge graph includes professional vocabulary in the remote sensing field and the relationships between various professional vocabulary.
[0037] See also Figure 2, obtain data websites and journal articles related to the remote sensing field, including remote sensing data websites, journal literature, Baidu Encyclopedia, remote sensing public accounts, industry information and national standards, use professional crawler tools to collect remote sensing text data, build the corresponding remote sensing field knowledge graph and train a simple comparative learning word embedding model, where the remote sensing field knowledge graph includes professional vocabulary in the remote sensing field and the relationship between various professional vocabulary.
[0038] The step of obtaining remote sensing words for which similarity is to be calculated and determining corresponding word vectors based on the knowledge graph based on the remote sensing field knowledge graph specifically includes:
[0039] Based on the remote sensing words whose similarity is to be calculated, the word vector based on the knowledge graph is obtained through an embedding model based on a translation mechanism, including the following steps:
[0040] For any triple, i.e., a combination of a head entity, a relationship, and a tail entity, the head entity and the relationship are mapped to a space of preset dimensions to obtain the head entity vector and the relationship vector in the same space, and the following formula is used to determine whether the mapped vector is correct:
[0041] h+r≈t
[0042] In the formula, h represents the head entity vector obtained by mapping; r represents the relationship vector obtained by mapping; t represents the tail entity vector obtained by mapping, that is, the sum of the head entity vector and the relationship vector obtained by mapping is approximately equal to the tail entity vector.
[0043] It can be understood that the remote sensing words to be calculated for similarity are input into the trained simple contrastive learning word embedding model to obtain the word vector based on the simple contrastive learning word embedding model; the word vector based on the knowledge graph is obtained through the embedding model based on the translation mechanism (TransE model), refer to Figure 3 The basic idea of the TransE model to obtain word vectors based on the knowledge graph is as follows: for any triple, that is, the combination of head entity, relationship and tail entity, first map the head entity and relationship to a space of a certain dimension to obtain the head entity vector and relationship vector in the same space, and then use the formula h+r≈t to determine whether the mapped vector is correct, where h represents the mapped head entity vector; r represents the mapped relationship vector; t represents the mapped tail entity vector, that is, the sum of the mapped head entity vector and the relationship vector should be as equal to the tail entity vector as possible.
[0044] The cosine similarity calculation method is used to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and the similarity based on the simple contrastive learning word embedding model is calculated according to the word vector based on the simple contrastive learning word embedding model. The corresponding calculation formula is as follows:
[0045]
[0046] In the formula, A and B represent the two word vectors corresponding to the two remote sensing words whose similarity is to be calculated; ||A|| and ||B|| represent the lengths of word vectors A and B respectively.
[0047] The similarity result is obtained by weighted summing the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model. The corresponding calculation formula is as follows:
[0048] Similarity=α×SimGraph+β×SimCSE
[0049] In the formula, Similarity represents the similarity result obtained by weighted summation; SimGraph represents the similarity based on the knowledge graph; SimCSE represents the similarity based on the simple contrastive learning word embedding model; α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
[0050] The weight coefficient α corresponding to the similarity based on the knowledge graph and the weight coefficient β corresponding to the similarity based on the simple contrastive learning word embedding model are determined as follows:
[0051]
[0052] In the formula, α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
[0053] It should be noted that the obtained word one and word two can be input into the remote sensing field knowledge graph to obtain the knowledge graph graph word vector one and the knowledge graph graph word vector two, and the similarity of these word vectors is calculated to obtain the knowledge graph similarity; the obtained word one and word two are input into the simple contrastive learning embedding model to obtain the simple contrastive learning word embedding model word vector one and the simple contrastive learning word embedding model word vector two, and the similarity of these word vectors is calculated to obtain the simple contrastive learning word embedding model similarity, and the knowledge graph similarity and the simple contrastive learning word embedding model similarity are weighted and summed to obtain the final similarity.
[0054] Through the introduction of the above embodiments, the present invention uses a remote sensing text similarity calculation method based on knowledge graph and contrastive learning, collects remote sensing text data from data websites and journal articles related to the remote sensing field by using a crawler tool, constructs a remote sensing field knowledge graph based on the remote sensing text data, and trains a simple contrastive learning word embedding model; obtains remote sensing words whose similarity is to be calculated, determines the corresponding word vector based on the knowledge graph based on the remote sensing field knowledge graph, and determines the corresponding word vector based on the simple contrastive learning word embedding model based on the simple contrastive learning word embedding model; uses a cosine similarity calculation method to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and calculates the corresponding similarity based on the simple contrastive learning word embedding model according to the word vector based on the simple contrastive learning word embedding model; and performs weighted summation on the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model to obtain a similarity result. The present invention can accurately capture the semantic information of remote sensing field texts by combining the remote sensing field knowledge graph and the simple contrastive learning word embedding model, thereby improving the accuracy of similarity calculation. The calculation method has a wide range of applications and can be used to calculate vocabulary similarity in the remote sensing field and provide data recommendation services. The present invention can learn the semantic relationship between words and generate word vectors with discriminability by training the contrastive learning word embedding model, thereby enhancing the generalization ability of the model.
[0055] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have the same meaning as in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless defined similarly here.
[0056] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A remote sensing text similarity calculation method based on knowledge graph and contrastive learning, characterized in that: The steps include: Use crawler tools to collect remote sensing text data from data websites and journal articles related to the remote sensing field, build a remote sensing field knowledge graph based on the remote sensing text data, and train a simple comparative learning word embedding model; Acquire remote sensing words for which similarity is to be calculated, determine corresponding word vectors based on the knowledge graph based on the remote sensing field knowledge graph, and determine corresponding word vectors based on the simple contrastive learning word embedding model based on the simple contrastive learning word embedding model; The cosine similarity calculation method is used to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and the similarity based on the simple contrastive learning word embedding model is calculated according to the word vector based on the simple contrastive learning word embedding model; The similarity result is obtained by weighted summing the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model.
2. The remote sensing text similarity calculation method based on knowledge graph and contrastive learning according to claim 1 is characterized in that: The remote sensing field knowledge graph includes professional vocabulary in the remote sensing field and the relationships between various professional vocabulary.
3. The remote sensing text similarity calculation method based on knowledge graph and contrastive learning according to claim 1 is characterized in that: The step of obtaining remote sensing words for which similarity is to be calculated and determining corresponding word vectors based on the knowledge graph based on the remote sensing field knowledge graph specifically includes: Based on the remote sensing words whose similarity is to be calculated, the word vector based on the knowledge graph is obtained through an embedding model based on a translation mechanism, including the following steps: For any triple, i.e., a combination of a head entity, a relationship, and a tail entity, the head entity and the relationship are mapped to a space of preset dimensions to obtain the head entity vector and the relationship vector in the same space, and the following formula is used to determine whether the mapped vector is correct: h+r≈t In the formula, h represents the head entity vector obtained by mapping; r represents the relationship vector obtained by mapping; t represents the tail entity vector obtained by mapping, that is, the sum of the head entity vector and the relationship vector obtained by mapping is approximately equal to the tail entity vector.
4. The remote sensing text similarity calculation method based on knowledge graph and contrastive learning according to claim 1 is characterized in that: The cosine similarity calculation method is used to calculate the corresponding similarity based on the knowledge graph according to the word vector based on the knowledge graph, and the similarity based on the simple contrastive learning word embedding model is calculated according to the word vector based on the simple contrastive learning word embedding model. The corresponding calculation formula is as follows: In the formula, A and B represent the two word vectors corresponding to the two remote sensing words whose similarity is to be calculated; ||A|| and ||B|| represent the lengths of word vectors A and B respectively.
5. The remote sensing text similarity calculation method based on knowledge graph and contrastive learning according to claim 1 is characterized in that: The similarity result is obtained by weighted summing the similarity based on the knowledge graph and the similarity based on the simple contrastive learning word embedding model. The corresponding calculation formula is as follows: Similarity=α×SimGraph+β×SimCSE In the formula, Similarity represents the similarity result obtained by weighted summation; SimGraph represents the similarity based on the knowledge graph; SimCSE represents the similarity based on the simple contrastive learning word embedding model; α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
6. The remote sensing text similarity calculation method based on knowledge graph and contrastive learning according to claim 5 is characterized in that: The weight coefficient α corresponding to the similarity based on the knowledge graph and the weight coefficient β corresponding to the similarity based on the simple contrastive learning word embedding model are determined as follows: In the formula, α represents the weight coefficient corresponding to the similarity based on the knowledge graph; β represents the weight coefficient corresponding to the similarity based on the simple contrastive learning word embedding model.
Citation Information
Patent Citations
Method and device for acquiring knowledge graph vectoring expression
CN105824802A
Method, device and equipment for obtaining supervision recognition result in multiple modes and storage medium
CN111428044A
Entity similarity calculation method for knowledge graph fusion
CN111813962A
Graph-based document retrieval method and system and related components thereof
CN112836029A
Knowledge graph data fusion method based on entity attribute similarity
CN113722509A