Entity relationship prediction, knowledge graph construction method and device, equipment and medium
By generating semantic representations of textual descriptions of geospatial entities and calculating geographic distance vectors, geospatial relationships are predicted. This solves the problem that existing technologies cannot construct comprehensive and accurate geospatial knowledge graphs, and achieves accurate prediction of geospatial entity relationships and construction of knowledge graphs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-11-03
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies cannot comprehensively and accurately predict the geospatial relationships between different geospatial entities, making it impossible to construct a comprehensive and accurate geospatial knowledge graph.
By generating semantic representations of textual descriptions of geospatial entities in context, calculating representation vectors of geographic distances, and combining semantic representations and distance vectors, geospatial relationships are predicted, and a geospatial knowledge graph is constructed.
It enables the analysis and mining of unstructured text data and structured geographic data, allowing for a more comprehensive and accurate prediction of relationships between geospatial entities, and the construction of a comprehensive and accurate geospatial knowledge graph.
Smart Images

Figure CN116028635B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information technology, and in particular to a method, apparatus, device and medium for entity relationship prediction and knowledge graph construction. Background Technology
[0002] A geospatial knowledge graph is a network system of knowledge graphs related to geospatial information. This knowledge graph can be represented as a set of triples, where each triple includes a pair of geospatial entities and the geospatial location relationship between the pair of geospatial entities.
[0003] However, existing technologies cannot fully and accurately predict the geospatial relationships between different geospatial entities, and therefore cannot construct a comprehensive and accurate geospatial knowledge graph. Summary of the Invention
[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides an entity relationship prediction, knowledge graph construction method, apparatus, device, and medium to more comprehensively and accurately predict the geospatial relationship between the first geospatial entity and the second geospatial entity.
[0005] In a first aspect, embodiments of this disclosure provide an entity relationship prediction method, wherein each geospatial entity includes textual description information and geospatial information; the method includes:
[0006] Based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, semantic representations of the first text description information and the second text description information in the context are generated respectively, and the context includes the first text description information and the second text description information;
[0007] Based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity, calculate the representation vector of the geographical distance between the first geospatial entity and the second geospatial entity;
[0008] Based on 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 context, the semantic representation of the context of the geographic distance perception is obtained.
[0009] Based on the semantic representation of the context perceived by the geographic distance and the representation vector of the geographic distance, the geospatial relationship between the first geospatial entity and the second geospatial entity is predicted.
[0010] Secondly, embodiments of this disclosure provide a method for constructing a geospatial knowledge graph, the method comprising:
[0011] Retrieve one or more geospatial entities;
[0012] For each of the one or more geospatial entities, extract the candidate entity corresponding to the geospatial entity, and construct a geospatial entity pair based on the geospatial entity and the candidate entity;
[0013] Using the method described in the first aspect, predict the geospatial relationship between two geospatial entities in any pair of geospatial entities;
[0014] A geospatial knowledge graph is constructed based on multiple geospatial entity pairs and the geospatial relationships between the two geospatial entities in each geospatial entity pair.
[0015] Thirdly, embodiments of this disclosure provide an entity relationship prediction device, wherein each geospatial entity includes textual description information and geospatial information; the device includes:
[0016] The generation module is configured to generate semantic representations of the first text description information and the second text description information in a context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, wherein the context includes the first text description information and the second text description information.
[0017] The calculation module is used to calculate the representation vector of the geographic distance between the first geospatial entity and the second geospatial entity based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity.
[0018] A semantic representation module is used to obtain the semantic representation of the context of the geographic distance perception based on 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 context, respectively.
[0019] The prediction module is used to predict the geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance.
[0020] Fourthly, embodiments of this disclosure provide an electronic device, including:
[0021] Memory;
[0022] Processor; and
[0023] Computer programs;
[0024] The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect.
[0025] Fifthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method described in the first aspect.
[0026] The entity relationship prediction and knowledge graph construction method, apparatus, device, and medium provided in this disclosure generate semantic representations of the first and second text descriptions of a first geospatial entity and a second geospatial entity in their respective contexts, thereby enabling the analysis and mining of unstructured text data. Based on the first and second geospatial information of the first and second geospatial entities, a representation vector of the geographical distance between the first and second geospatial entities is calculated, enabling the analysis and mining of structured geographical data. Based on the geographical distance representation vector and the semantic representations of the first and second text descriptions in their respective contexts, a semantic representation of the geographically distance-aware context is obtained, enabling the analysis and mining of the interactive relationships between unstructured text data and structured geographical data. Therefore, based on the semantic representation of the geographically distance-aware context and the geographical distance representation vector, the geospatial relationship between the first and second geospatial entities can be predicted more comprehensively and accurately. This allows for the construction of a comprehensive and accurate geospatial knowledge graph. Attached Figure Description
[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0028] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart of the entity relationship prediction method provided in the embodiments of this disclosure;
[0030] Figure 2 A schematic diagram illustrating an application scenario provided by an embodiment of this disclosure;
[0031] Figure 3 A schematic diagram of an end-to-end knowledge graph system automatic construction architecture provided in this disclosure embodiment;
[0032] Figure 4 A flowchart illustrating the internal processing of the geospatial relationship prediction module 32 provided in this embodiment of the disclosure;
[0033] Figure 5 A flowchart of an entity relationship prediction method provided in another embodiment of this disclosure;
[0034] Figure 6 This is a schematic diagram of the entity relationship prediction device provided in the embodiments of this disclosure;
[0035] Figure 7 A schematic diagram of the structure of an electronic device embodiment provided in this disclosure. Detailed Implementation
[0036] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0037] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0038] It should be noted that the geospatial entities (including but not limited to regions of interest, points of interest, etc.) and geospatial knowledge graphs (including but not limited to geospatial entities and geospatial relationships used for analysis) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0039] In addition, the entity relationship prediction method or geospatial knowledge graph construction method provided in this application involves the following explanations of terms, detailed below:
[0040] A geospatial entity is a geographic target or object of interest located in a geographic space, such as an area of interest (AOI) or a point of interest (POI).
[0041] Geospatial relation prediction is an important task in knowledge graph completion. Specifically, given a pair of geospatial entities (such as buildings) and their attribute information, it analyzes and predicts the geographical location relationship between them.
[0042] A geospatial knowledge graph is a network system of knowledge graphs related to geospatial information. This knowledge graph can be represented as a set of triples, where each triple includes a pair of geospatial entities and the geospatial location relationship between these entities.
[0043] However, existing technologies cannot comprehensively and accurately predict the geospatial relationships between different geospatial entities, thus failing to construct a comprehensive and accurate geospatial knowledge graph. To address this problem, this disclosure provides an entity relationship prediction method, which is described below with reference to specific embodiments.
[0044] Figure 1 This is a flowchart of an entity relationship prediction method provided in an embodiment of this disclosure. Specifically, this method can predict the relationship between any two geospatial entities. The method can be executed by an entity relationship prediction device, which can be implemented in software and / or hardware. This device can be configured in an electronic device, such as a server or terminal, where the terminal specifically includes a mobile phone, computer, or tablet computer. Furthermore, the entity relationship prediction method described in this embodiment is applicable to... Figure 2 The application scenarios shown are as follows. Figure 2As shown, this application scenario includes a database 21 and a server 22. Specifically, the database 21 can be a geographic information database, for example, containing multiple geospatial entities. Each geospatial entity includes textual description information and geospatial information. A geospatial entity refers to a geographic target or object of interest located in geographic space, such as an area of interest (AOI) or a point of interest (POI). The textual description information can be the address information of the AOI or POI in text form, for example, address information consisting of province, city, district, and house number. The geospatial information can be the latitude and longitude information of the AOI or POI. In some embodiments, the database 21 can be integrated into the server 22. In this embodiment, it is assumed that the database 21 and the server 22 are set up separately. The server 22 can construct a geospatial knowledge graph based on the geographic information database. During the construction process, server 22 can use the method described in this embodiment to predict the geospatial relationship between any two geospatial entities in the geographic information database. Geospatial relation prediction is an important task in knowledge graph completion. Specifically, given a pair of geospatial entities (e.g., buildings) and their attribute information, the system analyzes and predicts the geographical location relationship between them. The following section combines... Figure 2 This method will be described in detail, such as Figure 1 As shown, the specific steps of this method are as follows:
[0045] S101. Based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, generate semantic representations of the first text description information and the second text description information in the context, respectively, wherein the context includes the first text description information and the second text description information.
[0046] For example, a first geospatial entity and a second geospatial entity are two entities in a pair of geospatial entities. Specifically, the first geospatial entity includes first textual description information and first geospatial information, wherein the first textual description information is the address information of the first geospatial entity in text form, and the first geospatial information is the latitude and longitude information of the first geospatial entity. The second geospatial entity includes second textual description information and second geospatial information, wherein the second textual description information is the address information of the second geospatial entity in text form, and the second geospatial information is the latitude and longitude information of the second geospatial entity.
[0047] In this embodiment, the first text description information and the second text description information can constitute a context. Therefore, based on the representation vectors of each text unit in the first text description information and the representation vectors of each text unit in the second text description information, a semantic representation of the first text description information in the context and a semantic representation of the second text description information in the context are generated. The semantic representation of the first text description information in the context can be the semantic representation of each text unit in the first text description information in that context, or it can be a semantic representation obtained by fusing the semantic representations of each text unit in the first text description information in that context. Similarly, the semantic representation of the second text description information in the context can be the semantic representation of each text unit in the second text description information in that context, or it can be a semantic representation obtained by fusing the semantic representations of each text unit in the second text description information in that context. In this embodiment, a text unit can be a character; in other embodiments, a text unit can also be a word segment, a phrase, a character, a letter, a word, etc. In this embodiment, a text unit can be represented as a token.
[0048] S102. Based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity, calculate the representation vector of the geographical distance between the first geospatial entity and the second geospatial entity.
[0049] For example, based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity, the geographical distance between the first geospatial entity and the second geospatial entity is calculated. Further, a representation vector for this geographical distance is determined.
[0050] S103. Based on 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 context, the semantic representation of the context of the geographic distance perception is obtained.
[0051] For example, based on the representation vector of the geographic distance and the semantic representation of the first text description information in the context, the correlation between the geographic distance and the first text description information, such as semantic correlation, can be calculated. Similarly, based on the representation vector of the geographic distance and the semantic representation of the second text description information in the context, the correlation between the geographic distance and the second text description information can be calculated. Further, based on 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, the semantic representations of the first text description information and the second text description information in the context are fused to obtain the semantic representation of the geographic distance-aware context.
[0052] S104. Based on the semantic representation of the context perceived by the geographic distance and the representation vector of the geographic distance, predict the geographic spatial relationship between the first geographic spatial entity and the second geographic spatial entity.
[0053] Optionally, predicting the geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance includes: concatenating the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance to obtain a concatenation result; and predicting the geospatial relationship between the first geospatial entity and the second geospatial entity based on the concatenation result, wherein the geospatial relationship includes inclusion relationship, same relationship, auxiliary relationship, and other relationships.
[0054] For example, the semantic representation of the context of the geographic distance perception and the representation vector of the geographic distance are concatenated to obtain a concatenated result. This concatenated result is input into a Multilayer Perceptron (MLP) model, which predicts the geographic spatial relationship between the first and second geographic spatial entities. Optionally, the geographic spatial relationship includes inclusion, sameness, auxiliary, and other relationships. Inclusion means that the first geographic spatial entity is located within the second geographic spatial entity, or the second geographic spatial entity is located within the first geographic spatial entity. Sameness means that the first and second geographic spatial entities are the same entity. Auxiliary relationship means that the first geographic spatial entity is located around or near the second geographic spatial entity, or the second geographic spatial entity is located around or near the first geographic spatial entity.
[0055] This embodiment generates semantic representations of the first and second text descriptions of a first geospatial entity and a second geospatial entity in their respective contexts, enabling the analysis and mining of unstructured text data. Based on the first and second geospatial information of the first and second geospatial entities, a representation vector of the geographical distance between them is calculated, enabling the analysis and mining of structured geographical data. Based on the geographical distance representation vector and the semantic representations of the first and second text descriptions in their respective contexts, a semantic representation of the geographically distance-aware context is obtained, enabling the analysis and mining of the interactive relationships between unstructured text data and structured geographical data. Therefore, based on the semantic representation of the geographically distance-aware context and the geographical distance representation vector, the geographical spatial relationship between the first and second geospatial entities can be predicted more comprehensively and accurately. This allows for the construction of a comprehensive and accurate geospatial knowledge graph.
[0056] For example, in existing technologies, the textual descriptions of given geospatial entities, such as address information, are often incomplete or lack key detailed location information (e.g., road names or building names). This results in existing technologies relying on text mining being unable to accurately predict the geospatial relationships between different geospatial entities in real-world business scenarios. This embodiment, however, can analyze and mine not only unstructured text data (e.g., textual descriptions) but also structured geographic data (e.g., geospatial information), and can further analyze and mine the interactive relationships between unstructured text data and structured geographic data. Therefore, by fusing and processing unstructured text data and structured geographic data, this embodiment can accurately predict the geospatial relationships between different geospatial entities. For example, it can more accurately predict the geospatial relationships between isolated, unconnected, or weakly related geospatial entities.
[0057] Figure 3 This diagram illustrates an end-to-end knowledge graph system architecture for automatic construction, as provided in this embodiment. The architecture takes a geographic information database as input and outputs a completed geospatial knowledge graph. Overall, the architecture comprises three core modules: a candidate geospatial entity extraction module 31, a geospatial relationship prediction module 32, and a geospatial knowledge graph optimization processing module 33.
[0058] The input of the candidate geospatial entity extraction module 31 is a geographic information database, and the output is a pair of candidate geospatial entities. Each pair of geospatial entities includes two geospatial entities, and each geospatial entity includes text description information and geospatial information.
[0059] The geospatial relationship prediction module 32 can also be referred to as the knowledge graph completion module. The main function of this geospatial relationship prediction module is to predict the geospatial relationship between the two geospatial entities in each geospatial entity pair. Specifically, the input of this geospatial relationship prediction module is one or more geospatial entity pairs, and the output is a set of triples. Each triple in this set includes a pair of geospatial entities and the geospatial location relationship between these two geospatial entities.
[0060] The geospatial knowledge graph optimization and processing module 33 is mainly used to solve the problems of coverage and accuracy of the geospatial knowledge graph.
[0061] The following describes specific embodiments. Figure 3 The various modules within will be described in detail.
[0062] Optionally, each geospatial entity is a region of interest or a point of interest. Before generating semantic representations of the first and second textual descriptions in the context based on the first textual description information of the first geospatial entity and the second textual description information of the second geospatial entity, the method further includes: obtaining one or more candidate entities from within or near a preset region of interest, wherein the candidate entities are regions of interest or points of interest; forming an entity pair between each of the one or more candidate entities and the preset region of interest; wherein the first geospatial entity and the second geospatial entity are two entities in any entity pair.
[0063] like Figure 3 As shown, the candidate geospatial entity extraction module 31 includes an AOI search unit and a candidate entity extraction unit. The AOI search (Area of Interest Search) unit can be a binary classification model that can identify AOIs from a geographic information database. The identified AOIs form an AOI list, for example, the AOI list includes... Geospatial entities, etc. Further, for each AOI in the AOI list, each AOI is treated as a preset AOI, and the candidate entity extraction unit extracts candidate entities within or near that AOI. These candidate entities can be AOIs or POIs. For example, the candidate entity extraction unit extracts from... Candidate entities extracted from within or near the site include e 1 and e 8In this embodiment, AOI refers to a small area of interest in geospatial space (e.g., a shopping mall, university campus, or corporate campus). An AOI typically contains at least one other geospatial entity; for example, an AOI contains at least one POI. A POI refers to a geographic entity of interest (e.g., a specific building or store) located within or around a given AOI area. Further, e 1 and To form a geospatial entity pair, e 8 and This constitutes a geospatial entity pair. And so on, targeting... One or more geospatial entity pairs can also be obtained. These geospatial entity pairs can then be structured as follows: Figure 3 The list of entity pairs shown. The first geospatial entity and the second geospatial entity described in the above embodiments can be two entities from any entity pair in this list.
[0064] like Figure 3 The geospatial relationship prediction module 32 shown is as follows: Figure 3 The core module in the automatic construction architecture of the entire end-to-end knowledge graph system is shown. The input of the geospatial relationship prediction module 32 is as follows: Figure 3 The entity pair sequence shown is further illustrated by the geospatial relationship prediction module 32, which can predict the geospatial relationship between the two geospatial entities in each entity pair sequence. Specifically, the geospatial relationship prediction module 32 includes an entity text encoding unit, an entity geographic information encoding unit, a cross-modal information interaction unit, and a prediction unit.
[0065] like Figure 4 The diagram shows the processing flowchart inside the geospatial relationship prediction module 32. Optionally, based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, semantic representations of the first text description information and the second text description information in the context are generated, including: determining 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, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context, based on 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.
[0066] Specifically, the geospatial relationship prediction module 32 includes an entity text encoding unit 41, an entity geographic information encoding unit 42, a cross-modal information interaction unit 43, and a prediction unit 44. For example, e h Represents the first geospatial entity, e t This represents the second geospatial entity. Entity text encoding unit 41 can be processed using a pre-trained language model based on the Bidirectional Encoder Representations from Transformers (BERT) algorithm. h The first text description information and e t The second text description information is used to obtain the semantic representations of the first and second text description information in the context. It is understood that this BERT pre-trained language model can also be replaced by other models such as a Bi-directional Long Short-Term Memory Network (Bi-LSTM). The following uses the BERT pre-trained language model as an example.
[0067] For example, in this embodiment, each character in the first text description information is recorded as a token, and each character in the second text description information is recorded as a token. A preset character [CLS] is added before the first text description information, and a preset character [SEP] is added between the first and second text description information. [CLS] and [SEP] can be recorded as tokens respectively. Further, [CLS], the first text description information, [SEP], and the second text description information are input into the BERT pre-trained language model. Internally, the BERT pre-trained language model first performs an embedding layer representation, i.e., serialization, on each input token, thereby obtaining the representation vector of [CLS], the representation vector of each token in the first text description information, the representation vector of [SEP], and the representation vector of each token in the second text description information. For example... Figure 4 The figure shows 45. Among them, Figure 4In Figure 45, 'h' represents the representation vector of the first text description information, or 'h' represents the representation vector of each token in the first text description information. The representation vector of the first text description information can be calculated from the representation vector of each token in the first text description information. Similarly, 't' in Figure 45 represents the representation vector of the second text description information, or 't' represents the representation vector of each token in the second text description information. The representation vector of the second text description information can be calculated from the representation vector of each token in the second text description information. Further, the representation vectors of [CLS], [SEP], and [CLS] are passed through multiple stacked Transformer layers. The implementation mechanism within the Transformer layers is a self-attention mechanism. Through this self-attention mechanism, the semantic representations of [CLS], each token in the first text description information, [SEP], and each token in the second text description information are finally obtained in the context, for example... Figure 4 The 46 shown, of which, Figure 4 In diagram 46, 'h' represents the semantic representation of the first text description information in the context, or 'h' represents the semantic representation of each token in the first text description information in the context. The semantic representation of the first text description information in the context can be calculated from the semantic representation of each token in the first text description information in the context, or the semantic representation of the first text description information in the context includes the semantic representation of each token in the first text description information in the context. Similarly, 't' in diagram 46 represents the semantic representation of the second text description information in the context, or 't' represents the semantic representation of each token in the second text description information in the context. The semantic representation of the second text description information in the context can be calculated from the semantic representation of each token in the second text description information in the context, or the semantic representation of the second text description information in the context includes the semantic representation of each token in the second text description information in the context. This context can be composed of [CLS], the first text description information, [SEP], and the second text description information.
[0068] In addition, such as Figure 4 As shown, the entity geographic information coding unit 42 can be based on e h First geospatial information and e t Using the second geospatial information, calculate the geographic distance between the first and second geospatial entities, denoted as f. dist Furthermore, regarding f distAfter standardization and embedding layer representation, f is obtained. dist The representation vector h g Furthermore, according to f dist The representation vector h g The semantic representations of the first and second text description information in the context are used to obtain the semantic representation h of the geographic distance-aware context. gt .
[0069] Figure 5 A flowchart of an entity relationship prediction method provided in another embodiment of this disclosure is shown. In this embodiment, the semantic representation of the geographic distance-aware context is obtained based on 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 context, respectively. The process includes the following steps:
[0070] S501. Determine the correlation between the geographical distance and the first text description information based on the representation vector of the geographical distance and the semantic representation of the first text description information in the context.
[0071] For example, Figure 4 The cross-modal information interaction unit 43 shown can be based on the geographical distance, i.e., f dist The representation vector h g and the semantic representation of the first text description information in the context (e.g.) Figure 4 As shown in 46 (h), the relevance between the geographical distance and the first text description information is determined. The greater the relevance, the greater the corresponding weight coefficient. The weight coefficient can be determined by methods such as... Figure 4 The height of the rectangle in the cross-modal information interaction unit 43 shown is used to represent this.
[0072] Optionally, determining the relevance between the geographic distance and the first text description information based on the representation vector of the geographic distance and the semantic representation of the first text description information in the context includes: determining the relevance between the geographic distance and each text unit in the first text description information based on the representation vector of the geographic distance and the semantic representation of each text unit in the first text description information in the context.
[0073] For example, based on this geographical distance, i.e., f dist The representation vector h g The semantic representation of each token in the first text description information within the context is used to determine the relevance of the geographical distance to each token in the first text description information.
[0074] S502. Determine the correlation between the geographical distance and the second text description information based on the representation vector of the geographical distance and the semantic representation of the second text description information in the context.
[0075] For example, the cross-modal information interaction unit 43 can adjust the geographic distance, i.e., f. dist The representation vector h g and the semantic representation of the second textual description information in the context (e.g.) Figure 4 As shown in 46, t), the relevance of the geographic distance to the second text description information is determined.
[0076] Optionally, determining the relevance between the geographic distance and 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 includes: determining the relevance between the geographic distance and each text unit in the second text description information based on the representation vector of the geographic distance and the semantic representation of each text unit in the second text description information in the context.
[0077] For example, based on this geographical distance, i.e., f dist The representation vector h g The semantic representation of each token in the second text description information within the context is used to determine the relevance of the geographical distance to each token in the second text description information.
[0078] S503. Based on the correlation between the geographical distance and the first text description information, and the correlation between the geographical distance and the second text description information, the semantic representations of the first text description information and the second text description information in the context are fused to obtain the semantic representation of the context of the geographical distance perception.
[0079] For example, the cross-modal information interaction unit 43 is a core unit in the geospatial relationship prediction module 32. After determining e... h The first text description information and e t The second textual description information is semantically represented in the context, and e h and e tIn the case of a representation vector of geographical distance, a cross-modal attention mechanism can be used to analyze and evaluate the semantic relevance between the geographical distance and the first and second textual description information, respectively, or the relevance between the representation vector of the geographical distance and the semantic representation of each token in the first and second textual description information in the context. Further, based on the relevance between the geographical distance and the first textual description information, and the relevance between the geographical distance and the second textual description information, the semantic representations of the first and second textual description information in the context are fused to obtain the semantic representation h of the context perceived by the geographical distance. gt .
[0080] Optionally, based on the correlation between the geographical distance and the first text description information, and the correlation between the geographical distance and the second text description information, the semantic representations of the first text description information and the second text description information in the context are fused to obtain the semantic representation of the geographical distance-aware context. This includes: based on the correlation between the geographical distance and each text unit in the first text description information, and the correlation between the geographical distance and each text unit in the second text description information, the semantic representations of each text unit in the first text description information and the second text description information in the context are fused to obtain the semantic representation of the geographical distance-aware context.
[0081] For example, based on the representation vector of the geographic distance and the semantic representation of each token in the first text description information within the context, the semantic relevance of the geographic distance to each token in the first text description information is determined. Based on the representation vector of the geographic distance and the semantic representation of each token in the second text description information within the context, the semantic relevance of the geographic distance to each token in the second text description information is also determined. Further, based on the semantic relevance of the geographic distance to each token in the first text description information and the semantic relevance of the geographic distance to each token in the second text description information, the semantic representations of each token in the first text description information and the semantic representations of each token in the second text description information within the context are fused to obtain the semantic representation h of the geographic distance-aware context. gtIn one feasible implementation, a weight coefficient can be obtained based on each semantic relevance. Further, based on each weight coefficient, a weighted sum is performed on the semantic representations of each token in the first text description information and each token in the second text description information within the same context to obtain the semantic representation h of the geographic distance-aware context. gt In the weighted summation process, the semantic representation of each token in the context is multiplied by the weight coefficient corresponding to that token. The weight coefficient is obtained based on the semantic relevance between the geographical distance and the token. The context may include first textual description information and second textual description information.
[0082] Optionally, the context further includes a first preset character and a second preset character, wherein the first preset character precedes the first text description information, and the second preset character is located between the first text description information and the second text description information. For example Figure 4 As shown, the context may also include a first preset character [CLS] and a second preset character [SEP].
[0083] The method further includes: determining the correlation between the geographical distance and the first preset character based on the representation vector of the geographical distance and the semantic representation of the first preset character in the context; and determining the correlation between the geographical distance and the second preset character based on the representation vector of the geographical distance and the semantic representation of the second preset character in the context.
[0084] For example Figure 4 As shown, the cross-modal information interaction unit 43 can also be based on the geographic distance representation vector h g The relevance between the geographic distance and [CLS] is determined based on the semantic representation of [CLS] in this context. This is done according to the geographic distance representation vector h. g The semantic representation of [SEP] in this context is used to determine the correlation between the geographic distance and [SEP].
[0085] In another feasible implementation, Figure 4 The heights of the four rectangles shown represent, in order, the correlation between the geographic distance and [CLS], the correlation between the geographic distance and the first text description information, the correlation between the geographic distance and [SEP], and the correlation between the geographic distance and the second text description information. Each correlation corresponds to a weight coefficient, resulting in four weight coefficients. Furthermore, based on these four weight coefficients, [the following is a separate section:] Figure 4 The four vectors shown in 46 are weighted and summed to obtain the semantic representation h of the geographic distance-aware context.gt .
[0086] In another feasible implementation, correspondingly, based on the correlation between the geographical distance and each text unit in the first text description information, and the correlation between the geographical distance and each text unit in the second text description information, the semantic representations of each text unit in the first text description information and the semantic representations of each text unit in the second text description information in the context are fused to obtain the semantic representation of the geographical distance-aware context. This includes: based on the correlation between the geographical distance and the first preset character, the correlation between the geographical distance and each text unit in the first text description information, the correlation between the geographical distance and the second preset character, and the correlation between the geographical distance and each text unit in the second text description information, the semantic representations of the first preset character, each text unit in the first text description information, the semantic representations of the second preset character, and the semantic representations of each text unit in the second text description information in the context are fused to obtain the semantic representation of the geographical distance-aware context.
[0087] For example, based on the correlation between the geographic distance and [CLS], the correlation between the geographic distance and each token in the first text description information, the correlation between the geographic distance and [SEP], and the correlation between the geographic distance and each token in the second text description information, the semantic representations of [CLS] in the context, the semantic representations of each token in the first text description information, the semantic representations of [SEP] in the context, and the semantic representations of each token in the second text description information in the context are fused to obtain the semantic representation of the geographic distance-aware context. This fusion process can be a weighted summation process as described above, with the same specific principle, and will not be repeated here.
[0088] Furthermore, such as Figure 4 As shown, the prediction unit 44 can generate the semantic representation h of the geographic distance-aware context. gt The representation vector h of the geographical distance g The data is concatenated to obtain the concatenated result. This concatenated result is then input into the MLP model, causing the MLP model to output a prediction result, which is e. h and e t The geospatial relationship between them, for example, the prediction result can be one of the following: inclusion relationship, same relationship, auxiliary relationship, other relationship.
[0089] Understandably, through methods such as Figure 4 The processing shown can yield the relationship between the two entities in any entity pair. Different entity pairs, and the relationship between the two entities in each entity pair, can be structured as follows: Figure 3 The sequence of triples shown is the set of triples.
[0090] Understandably, obtaining the set of triples means that the geospatial knowledge graph has been preliminarily and automatically constructed. Furthermore, as... Figure 3 As shown, the geospatial knowledge graph optimization module 33 can further optimize the initially constructed geospatial knowledge graph. The optimization described in this embodiment mainly includes two aspects: graph relationship expansion and relationship repair processing. For example... Figure 3 As shown, the geospatial knowledge graph optimization processing module 33 includes a relationship expansion unit and a relationship repair unit. The relationship expansion unit is mainly used to further expand the coverage of the geospatial knowledge graph. For example, according to the method described above, e is determined... 1 and The relationship between them is Including e 1 e 8 and If the relationship between the pairs is one of similarity, then a new triplet, e, can be added to the set of triplets. 1 and e 8 , and e 8 Including e 1 This expands the coverage of the geospatial knowledge graph. The relation repair unit is mainly used to repair or remove unreasonable or inconsistent geospatial relations in the triple set, thereby further improving the accuracy of the geospatial knowledge graph. The final result is as follows: Figure 3 The geospatial knowledge graph shown includes multiple nodes and edges between every two nodes. Each node represents a geospatial entity, and the edges between two nodes represent the geospatial relationships between the two entities. For example, Figure 3 The black dots represent AOIs and the white dots represent POIs. Alternatively, black dots represent POIs and white dots represent AOIs. Furthermore, it is understood that in other embodiments, the geospatial relationship between two different AOIs and the geospatial relationship between two different POIs can also be predicted. The prediction process is similar to that described in the above embodiments and will not be repeated here.
[0091] This embodiment effectively integrates the geographical distances between different geospatial entities and their textual descriptions, enabling accurate prediction of geospatial relationships and automating the construction of geospatial knowledge graphs. Therefore, the method provided in this embodiment offers theoretical and technical support for developing practical geospatial knowledge graphs and their intelligent applications in the logistics industry.
[0092] In addition, this embodiment also provides a method for constructing a geospatial knowledge graph, the method including the following steps:
[0093] Step 1: Obtain one or more geospatial entities.
[0094] Step 2: For each of the one or more geospatial entities, extract the candidate entity corresponding to the geospatial entity, and construct a geospatial entity pair based on the geospatial entity and the candidate entity.
[0095] Step 3: Using the entity relationship prediction method described above, predict the geospatial relationship between two geospatial entities in any geospatial entity pair.
[0096] Step 4: Construct a geospatial knowledge graph based on multiple geospatial entity pairs and the geospatial relationships between the two geospatial entities in each geospatial entity pair.
[0097] For details and the specific principles behind steps 1-4, please refer to the relevant documentation. Figure 3 The content shown, and the content on Figure 3 The details will not be elaborated here.
[0098] Figure 6 This is a schematic diagram of the entity relationship prediction device provided in an embodiment of the present disclosure. The entity relationship prediction device provided in this embodiment of the present disclosure can execute the processing flow provided in the entity relationship prediction method embodiment, such as... Figure 6 As shown, each geospatial entity includes textual description information and geospatial information; the entity relationship prediction device 60 includes:
[0099] The generation module 61 is configured to generate semantic representations of the first text description information and the second text description information in a context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, wherein the context includes the first text description information and the second text description information.
[0100] The calculation module 62 is used to calculate the representation vector of the geographic distance between the first geospatial entity and the second geospatial entity based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity.
[0101] The semantic representation module 63 is used to obtain the semantic representation of the context of the geographic distance perception based on 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 context respectively;
[0102] The prediction module 64 is used to predict the geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance.
[0103] Optionally, the semantic representation module 63 includes: a determining unit 631 and a fusing unit 632, wherein the determining unit 631 is configured to determine the relevance between the geographic distance and the first text description information in the context based on the representation vector of the geographic distance and the semantic representation of the first text description information in the context; and to determine the relevance between the geographic distance and the second text description information in the context based on the representation vector of the geographic distance and the semantic representation of the second text description information in the context; the fusing unit 632 is configured to fuse the semantic representations of the first text description information and the second text description information in the context based on the relevance between the geographic distance and the first text description information and the relevance between the geographic distance and the second text description information, respectively, to obtain the semantic representation of the context of the geographic distance perception.
[0104] Optionally, when determining the relevance between the geographical distance and the first text description information based on the representation vector of the geographical distance and the semantic representation of the first text description information in the context, the determining unit 631 is specifically used for:
[0105] Based on the representation vector of the geographic distance and the semantic representation of each text unit in the first text description information in the context, the relevance of the geographic distance to each text unit in the first text description information is determined.
[0106] When determining the relevance between the geographic distance and 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, the determining unit 631 is specifically used for:
[0107] Based on the representation vector of the geographic distance and the semantic representation of each text unit in the second text description information in the context, the relevance of the geographic distance to each text unit in the second text description information is determined.
[0108] When the fusion unit 632 fuses the semantic representations of the first text description information and the second text description information in the context according to the correlation between the geographical distance and the first text description information, and the correlation between the geographical distance and the second text description information, to obtain the semantic representation of the context perceived by the geographical distance, it is specifically used for:
[0109] Based on the correlation between the geographic distance and each text unit in the first text description information, and the correlation between the geographic distance and each text unit in the second text description information, the semantic representation of each text unit in the first text description information 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 of the geographic distance perception.
[0110] Optionally, the context further includes a first preset character and a second preset character, 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.
[0111] Optionally, the determining unit 631 is also used for:
[0112] The correlation between the geographical distance and the first preset character is determined based on the representation vector of the geographical distance and the semantic representation of the first preset character in the context.
[0113] The correlation between the geographical distance and the second preset character is determined based on the representation vector of the geographical distance and the semantic representation of the second preset character in the context.
[0114] Accordingly, when the fusion unit 632 fuses the semantic representations of each text unit in the first text description information and the second text description information in the context based on the relevance of the geographical distance to each text unit in the first text description information and the relevance of the geographical distance to each text unit in the second text description information, to obtain the semantic representation of the geographical distance-aware context, it is specifically used for:
[0115] Based on 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, the semantic representation of the second preset character 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 geographic distance-aware context.
[0116] Optionally, when the generation module 61 generates semantic representations of the first and second text descriptions in the context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, it is specifically used for:
[0117] Based on 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, 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, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context are determined.
[0118] Optionally, when the prediction module 64 predicts the geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance, it is specifically used for:
[0119] The semantic representation of the geographic distance-aware context and the representation vector of the geographic distance are concatenated to obtain the concatenation result;
[0120] Based on the stitching result, the geospatial relationship between the first geospatial entity and the second geospatial entity is predicted. The geospatial relationship includes inclusion relationship, same relationship, auxiliary relationship, and other relationships.
[0121] Optionally, each geospatial entity can be a region of interest or a point of interest.
[0122] The entity relationship prediction device 60 further includes: an acquisition module 65 and a composition module 66, wherein the acquisition module 65 is used to acquire one or more candidate entities from the interior or vicinity of a preset region of interest before the generation module 61 generates semantic representations of the first text description information and the second text description information in the context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity; the candidate entities are regions of interest or points of interest; the composition module 66 is used to form an entity pair with each of the one or more candidate entities and the preset region of interest; the first geospatial entity and the second geospatial entity are two entities in any entity pair.
[0123] Figure 6 The entity relationship prediction device of the illustrated embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.
[0124] The above describes the internal functions and structure of the entity relationship prediction device, which can be implemented as an electronic device. Figure 7 A schematic diagram illustrating the structure of an electronic device embodiment provided in this disclosure. For example... Figure 7 As shown, the electronic device includes a memory 71 and a processor 72.
[0125] Memory 71 is used to store programs. In addition to the programs described above, memory 71 can also be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, contact data, phone book data, messages, pictures, videos, etc.
[0126] The memory 71 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0127] The processor 72 is coupled to the memory 71 and executes the program stored in the memory 71 for:
[0128] Based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, semantic representations of the first text description information and the second text description information in the context are generated respectively, and the context includes the first text description information and the second text description information;
[0129] Based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity, calculate the representation vector of the geographical distance between the first geospatial entity and the second geospatial entity;
[0130] Based on 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 context, the semantic representation of the context of the geographic distance perception is obtained.
[0131] Based on the semantic representation of the context perceived by the geographic distance and the representation vector of the geographic distance, the geospatial relationship between the first geospatial entity and the second geospatial entity is predicted.
[0132] Alternatively, processor 72 can also be used for:
[0133] Retrieve one or more geospatial entities;
[0134] For each of the one or more geospatial entities, extract the candidate entity corresponding to the geospatial entity, and construct a geospatial entity pair based on the geospatial entity and the candidate entity;
[0135] Using the entity relationship prediction method described above, the geospatial relationship between two geospatial entities in any geospatial entity pair is predicted.
[0136] A geospatial knowledge graph is constructed based on multiple geospatial entity pairs and the geospatial relationships between the two geospatial entities in each geospatial entity pair.
[0137] Furthermore, such as Figure 7 As shown, the electronic device may also include other components such as a communication component 73, a power supply component 74, an audio component 75, and a display 76. Figure 7 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 7 The components shown.
[0138] Communication component 73 is configured to facilitate wired or wireless communication between electronic devices and other devices. The electronic devices can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 73 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 73 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0139] Power supply component 74 provides power to various components of the electronic device. Power supply component 74 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.
[0140] Audio component 75 is configured to output and / or input audio signals. For example, audio component 75 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 71 or transmitted via communication component 73. In some embodiments, audio component 75 also includes a speaker for outputting audio signals.
[0141] Display 76 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation.
[0142] In addition, this disclosure also provides a computer-readable storage medium storing a computer program thereon, which is executed by a processor to implement the entity relationship prediction method or geospatial knowledge graph construction method described in the above embodiments.
[0143] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0144] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for predicting entity relationships, wherein, Each geospatial entity includes textual description information and geospatial information; the method includes: Based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, semantic representations of the first text description information and the second text description information in the context are generated respectively, and the context includes the first text description information and the second text description information; Based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity, calculate the representation vector of the geographical distance between the first geospatial entity and the second geospatial entity; Based on 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 context, the semantic representation of the context of the geographic distance perception is obtained. Based on the semantic representation of the context perceived by the geographic distance and the representation vector of the geographic distance, predict the geographic spatial relationship between the first geographic spatial entity and the second geographic spatial entity; The method further includes: determining the semantic representation of the first preset character in the context, the semantic representation of each text unit in the first text description information, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context, based on 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, 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 according to claim 1, wherein, Based on the representation vector of the geographic distance and the semantic representations of the first and second text description information in the context, the semantic representation of the context for geographic distance perception is obtained, including: The relevance between the geographical distance and the first text description information is determined based on the representation vector of the geographical distance and the semantic representation of the first text description information in the context. The relevance between the geographical distance and the second text description information is determined based on the representation vector of the geographical distance and the semantic representation of the second text description information in the context. Based on the correlation between the geographical distance and the first text description information, and the correlation between the geographical distance and the second text description information, the semantic representations of the first text description information and the second text description information in the context are fused to obtain the semantic representation of the context of the geographical distance perception.
3. The method according to claim 2, wherein, Determining the relevance between the geographical distance and the first text description information based on the representation vector of the geographical distance and the semantic representation of the first text description information in the context includes: Based on the representation vector of the geographic distance and the semantic representation of each text unit in the first text description information in the context, the relevance of the geographic distance to each text unit in the first text description information is determined. Determining the relevance between the geographical distance and the second textual description information in the context, based on the representation vector of the geographical distance and the semantic representation of the second textual description information, includes: Based on the representation vector of the geographic distance and the semantic representation of each text unit in the second text description information in the context, the relevance of the geographic distance to each text unit in the second text description information is determined. Based on the correlation between the geographical distance and the first text description information, and the correlation between the geographical distance and the second text description information, the semantic representations of the first text description information and the second text description information in the context are fused to obtain the semantic representation of the geographical distance-aware context, including: Based on the correlation between the geographic distance and each text unit in the first text description information, and the correlation between the geographic distance and each text unit in the second text description information, the semantic representation of each text unit in the first text description information 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 of the geographic distance perception.
4. The method according to claim 1, wherein, The method further includes: The correlation between the geographical distance and the first preset character is determined based on the representation vector of the geographical distance and the semantic representation of the first preset character in the context. The correlation between the geographical distance and the second preset character is determined based on the representation vector of the geographical distance and the semantic representation of the second preset character in the context. Based on the correlation between the geographic distance and each text unit in the first text description information, and the correlation between the geographic distance and each text unit in the second text description information, the semantic representation of each text unit in the first text description information 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 geographic distance-aware context, including: Based on 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, the semantic representation of the second preset character 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 geographic distance-aware context.
5. The method according to claim 1, wherein, Based on a first preset character, the first text description information, a second preset character, and the second text description information, determine 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, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context, including: The first preset character, the first text description information, the second preset character, and the second text description information are serialized respectively to obtain 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. Based on 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, 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, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context are determined.
6. The method according to claim 1, wherein, Based on the semantic representation of the context perceived by the geographic distance and the representation vector of the geographic distance, predict the geospatial relationship between the first geospatial entity and the second geospatial entity, including: The semantic representation of the geographic distance-aware context and the representation vector of the geographic distance are concatenated to obtain the concatenation result; Based on the stitching result, the geospatial relationship between the first geospatial entity and the second geospatial entity is predicted. The geospatial relationship includes inclusion relationship, same relationship, auxiliary relationship, and other relationships.
7. The method according to claim 1, wherein, Each geospatial entity is a region of interest or a point of interest; Before generating semantic representations of the first and second text descriptions in the context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, the method further includes: One or more candidate entities are obtained from the interior or vicinity of a preset region of interest, wherein the candidate entities are the region of interest or the point of interest; Each candidate entity in the one or more candidate entities is paired with the preset region of interest to form an entity pair; The first geospatial entity and the second geospatial entity are two entities in any entity pair.
8. A method for constructing a geospatial knowledge graph, wherein, The method includes: Retrieve one or more geospatial entities; For each of the one or more geospatial entities, extract the candidate entity corresponding to the geospatial entity, and construct a geospatial entity pair based on the geospatial entity and the candidate entity; Using the method described in any one of claims 1-7, predict the geospatial relationship between two geospatial entities in any geospatial entity pair; A geospatial knowledge graph is constructed based on multiple geospatial entity pairs and the geospatial relationships between the two geospatial entities in each geospatial entity pair.
9. An entity relationship prediction device, wherein, Each geospatial entity includes textual description information and geospatial information; The device includes: The generation module is configured to generate semantic representations of the first text description information and the second text description information in a context based on the first text description information of the first geospatial entity and the second text description information of the second geospatial entity, wherein the context includes the first text description information and the second text description information. The calculation module is used to calculate the representation vector of the geographic distance between the first geospatial entity and the second geospatial entity based on the first geospatial information of the first geospatial entity and the second geospatial information of the second geospatial entity. A semantic representation module is used to obtain the semantic representation of the context of the geographic distance perception based on 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 context, respectively. The prediction module is used to predict the geospatial relationship between the first geospatial entity and the second geospatial entity based on the semantic representation of the context perceived by the geospatial distance and the representation vector of the geospatial distance. The device is further configured to determine 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, the semantic representation of the second preset character in the context, and the semantic representation of each text unit in the second text description information in the context, based on 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, 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, wherein, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1-7.
11. A computer-readable storage medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-7.