CN-116028635-B - Entity relationship prediction and knowledge graph construction method, device, equipment and medium
Abstract
The disclosure relates to a method, a device, equipment and a medium for predicting entity relation and constructing a knowledge graph. The present disclosure generates semantic representations of respective text description information in context from a first text description information of a first geospatial entity and a second text description information of a second geospatial entity, respectively. A representation vector of a geographic distance between the first geospatial entity and the second geospatial entity is calculated from the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity. And according to the expression vector of the geographic distance and the semantic expression of each text description information in the context, obtaining the semantic expression of the geographic distance perceived context. Further, according to the semantic representation of the context of the geographic distance perception and the representation vector of the geographic distance, the geographic space relationship between the first geographic space entity and the second geographic space entity can be predicted more comprehensively and accurately.
Inventors
- Hai Zhen
- CONG GAO
- Balsabri Pasquale
Assignees
- 阿里巴巴(中国)有限公司
- 南洋理工大学
Dates
- Publication Date
- 20260512
- Application Date
- 20221103
Claims (11)
- 1. A method for predicting entity relationship, wherein each geospatial entity comprises text description information and geospatial information respectively, comprises the following steps: Generating semantic representations of first text description information and second text description information of a first geographic space entity according to the first text description information and the second text description information of a second geographic space entity respectively in a context, wherein the context comprises the first text description information and the second text description information; Calculating a representation vector of a geographic distance between the first geospatial entity and the second geospatial entity according to first geospatial information of the first geospatial entity and second geospatial information of the second geospatial entity; obtaining semantic representations of the contexts perceived by the geographic distance according to the representation vector of the geographic distance and the semantic representations of the first text description information and the second text description information in the contexts respectively; Predicting a geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geographic distance and a representation vector of the geographic distance; The method further comprises determining a semantic representation of a first preset character in the context, a semantic representation of each text unit in the first text description information in the context, a semantic representation of a second preset character in the context and a semantic representation of each text unit in the second text description information in the context according to a representation vector of the first preset character, a representation vector of each text unit in the first text description information, a representation vector of a second preset character, a representation vector of each text unit in the second text description information, wherein the first preset character is located before the first text description information, and the second preset character is located between the first text description information and the second text description information.
- 2. The method of claim 1, wherein deriving the semantic representation of the context of the geographic distance perception from the representation vector of the geographic distance and the semantic representations of the first and second text description information, respectively, in the context comprises: determining a relevance of the geographic distance to the first text description information according to the representation vector of the geographic distance and the semantic representation of the first text description information in the context; determining a relevance of the geographic distance to the second text description information according to the representation vector of the geographic distance and the semantic representation of the second text description information in the context; And according to the correlation between the geographic distance and the first text description information and the correlation between the geographic distance and the second text description information, respectively fusing semantic representations of the first text description information and the second text description information in the context to obtain the semantic representation of the context perceived by the geographic distance.
- 3. The method of claim 2, wherein determining a relevance of the geographic distance to the first text description information from the representation vector of the geographic distance and the semantic representation of the first text description information in the context comprises: Determining the relevance of the geographic distance to each text unit in the first text description information according to the representation vector of the geographic distance and the semantic representation of each text unit in the context of the first text description information; Determining a relevance of the geographic distance to the second text description information based on the representation vector of the geographic distance and the semantic representation of the second text description information in the context, comprising: Determining the relevance of the geographic distance to each text unit in the second text description information according to the representation vector of the geographic distance and the semantic representation of each text unit in the context of the second text description information; According to the relativity of the geographic distance and the first text description information and the relativity of the geographic distance and the second text description information, respectively fusing semantic representations of the first text description information and the second text description information in the context to obtain semantic representations of the context perceived by the geographic distance, wherein the method comprises the following steps: According to the relevance of the geographic distance to each text unit in the first text description information and the relevance of the geographic distance to each text unit in the second text description information, the semantic representation of each text unit in the first text description information in the context and the semantic representation of each text unit in the second text description information in the context are fused, and the semantic representation of the context perceived by the geographic distance is obtained.
- 4. The method of claim 1, wherein the method further comprises: Determining the correlation between the geographic distance and the first preset character according to the expression vector of the geographic distance and the semantic expression of the first preset character in the context; Determining the correlation between the geographic distance and the second preset character according to the expression vector of the geographic distance and the semantic expression of the second preset character in the context; According to the relevance of the geographic distance to each text unit in the first text description information and the relevance of the geographic distance to each text unit in the second text description information, the semantic representation of each text unit in the first text description information in the context and the semantic representation of each text unit in the second text description information in the context are fused to obtain the semantic representation of the context perceived by the geographic distance, and the method comprises the following steps: And according to the correlation between the geographic distance and the first preset character, the correlation between the geographic distance and each text unit in the first text description information, the correlation between the geographic distance and the second preset character and the correlation between the geographic distance and each text unit in the second text description information, the semantic representation of the first preset character in the context, the semantic representation of each text unit in the first text description information in the context and the semantic representation of the second preset character in the context are fused, so that the semantic representation of the context perceived by the geographic distance is obtained.
- 5. The method of claim 1, wherein determining a semantic representation of the first preset character in the context, a semantic representation of each text unit in the first text description information in the context, a semantic representation of the second preset character in the context, a semantic representation of each text unit in the second text description information in the context, based on a first preset character, the first text description information, a second preset character, the second text description information, comprises: Respectively serializing the first preset character, the first text description information, the second preset character and the second text description information to obtain a representation vector of the first preset character, a representation vector of each text unit in the first text description information, a representation vector of the second preset character and a representation vector of each text unit in the second text description information; Determining semantic representation of the first preset character in the context, semantic representation of each text unit in the first text description information in the context, semantic representation of the second preset character in the context and semantic representation of each text unit in the second text description information according to the representation vector of the first preset character, the representation vector of each text unit in the first text description information, the representation vector of the second preset character and the representation vector of each text unit in the second text description information.
- 6. The method of claim 1, wherein predicting a geospatial relationship between the first geospatial entity and the second geospatial entity from the semantic representation of the context perceived by the geographic distance and a representation vector of the geographic distance comprises: Splicing the semantic representation of the context perceived by the geographic distance with the representation vector of the geographic distance to obtain a splicing result; And predicting the geospatial relationship between the first geospatial entity and the second geospatial entity according to the splicing result, wherein the geospatial relationship comprises a containing relationship, a same relationship, an auxiliary relationship and other relationships.
- 7. The method of claim 1, wherein each geospatial entity is a region of interest or a point of interest; Before generating the semantic representations of the first text description information and the second text description information in the context respectively according to the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, the method further comprises: Acquiring one or more candidate entities from the inside or the vicinity of a preset region of interest, wherein the candidate entities are the region of interest or the interest point; Forming an entity pair by each candidate entity in the one or more candidate entities and the preset region of interest respectively; the first geospatial entity and the second geospatial entity are two entities in either entity pair.
- 8. A geospatial knowledge graph construction method, wherein the method comprises: Acquiring one or more geospatial entities; extracting candidate entities corresponding to the geospatial entities for each of the one or more geospatial entities, and constructing a geospatial entity pair according to the geospatial entities and the candidate entities; predicting a geospatial relationship between two geospatial entities in any pair of geospatial entities using the method of any of claims 1-7; A geospatial knowledge graph is constructed from a plurality of geospatial entity pairs and a geospatial relationship between two geospatial entities in each geospatial entity pair.
- 9. An entity relationship prediction apparatus, wherein each geospatial entity includes text description information and geospatial information, respectively, comprises: the generation module is used for generating semantic representations of the first text description information and the second text description information in a context according to the first text description information of the first geographic space entity and the second text description information of the second geographic space entity, wherein the context comprises the first text description information and the second text description information; a calculation module for calculating a representation vector of a geographic distance between the first geospatial entity and the second geospatial entity based on first geospatial information of the first geospatial entity and second geospatial information of the second geospatial entity; The semantic representation module is used for obtaining semantic representation of the context perceived by the geographic distance according to the representation vector of the geographic distance and the semantic representation of the first text description information and the second text description information in the context respectively; A prediction module for predicting a geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geographic distance and a representation vector of the geographic distance; The device is further used for determining semantic representation of a first preset character in the context, semantic representation of each text unit in the first text description information in the context, semantic representation of a second preset character in the context and semantic representation of each text unit in the second text description information in the context according to the representation vector of the first preset character, the representation vector of each text unit in the first text description information, the representation vector of a second preset character and the representation vector of each text unit in the second text description information, wherein the first preset character is located before the first text description information, and the second preset character is located between the first text description information and the second text description information.
- 10. An electronic device, comprising: a memory; Processor, and A computer program; wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-7.
- 11. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method of any of claims 1-7.
Description
Entity relationship prediction and knowledge graph construction method, device, equipment and medium Technical Field The disclosure relates to the field of information technology, and in particular relates to a method, a device, equipment and a medium for predicting entity relationship and constructing a knowledge graph. Background Geospatial knowledge graph (Geospatial knowledge graph) refers to a geospatially related knowledge graph network system that may be represented as a set of triples, where each triplet includes a pair of geospatial entities and a geospatial positional relationship between the pair of geospatial entities. However, the prior art cannot comprehensively and accurately predict the geospatial position relationship between different geospatial entities, so that a comprehensive and accurate geospatial knowledge graph cannot be constructed. Disclosure of Invention In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, a device, and a medium for predicting an entity relationship, and constructing a knowledge graph, so as to more comprehensively and accurately predict a geospatial relationship between the first geospatial entity and the second geospatial entity. In a first aspect, an embodiment of the present disclosure provides a method for predicting entity relationships, where each geospatial entity includes text description information and geospatial information, respectively, and the method includes: Generating semantic representations of first text description information and second text description information of a first geographic space entity according to the first text description information and the second text description information of a second geographic space entity respectively in a context, wherein the context comprises the first text description information and the second text description information; Calculating a representation vector of a geographic distance between the first geospatial entity and the second geospatial entity according to first geospatial information of the first geospatial entity and second geospatial information of the second geospatial entity; obtaining semantic representations of the contexts perceived by the geographic distance according to the representation vector of the geographic distance and the semantic representations of the first text description information and the second text description information in the contexts respectively; Predicting a geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context and the representation vector of the geospatial distance perceived. In a second aspect, an embodiment of the present disclosure provides a geospatial knowledge graph construction method, the method including: Acquiring one or more geospatial entities; extracting candidate entities corresponding to the geospatial entities for each of the one or more geospatial entities, and constructing a geospatial entity pair according to the geospatial entities and the candidate entities; predicting a geospatial relationship between two geospatial entities in any pair of geospatial entities using a method as described in the first aspect; A geospatial knowledge graph is constructed from a plurality of geospatial entity pairs and a geospatial relationship between two geospatial entities in each geospatial entity pair. In a third aspect, an embodiment of the present disclosure provides an entity relationship prediction apparatus, where each geospatial entity includes text description information and geospatial information, respectively, and the apparatus includes: the generation module is used for generating semantic representations of the first text description information and the second text description information in a context according to the first text description information of the first geographic space entity and the second text description information of the second geographic space entity, wherein the context comprises the first text description information and the second text description information; a calculation module for calculating a representation vector of a geographic distance between the first geospatial entity and the second geospatial entity based on first geospatial information of the first geospatial entity and second geospatial information of the second geospatial entity; The semantic representation module is used for obtaining semantic representation of the context perceived by the geographic distance according to the representation vector of the geographic distance and the semantic representation of the first text description information and the second text description information in the context respectively; a prediction module for predicting a geospatial relationship between the first geospatial entity and the second geospatial entity based on t