A positioning method and device based on an address knowledge graph
By using an address knowledge graph-based location method, which leverages the hierarchical relationships of address elements and entity association information, the problem of inaccurate address location in existing technologies is solved, achieving higher location accuracy.
Patent Information
- Application Number
- CN202310188127.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-03-01
AI Technical Summary
The existing address location service has a location error problem.
A localization method based on address knowledge graphs is adopted. By obtaining the target address text and address knowledge graph, the target address entity is extracted, and the target location information is determined according to the address knowledge graph. The location is then determined by utilizing the hierarchical relationship between address elements.
It improves the accuracy of address location by effectively utilizing address hierarchy and prior information related to entities, thereby reducing location errors.
Smart Images

Figure CN116303854B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of address location technology, and in particular to a location method and apparatus based on address knowledge graph. Background Technology
[0002] Address location services refer to services that return the location information corresponding to the address text entered by the user, such as the latitude and longitude of the address text. Address location services have wide applications in logistics and transportation, order delivery, fire rescue, and location query.
[0003] Existing address location services use natural language processing technology. Through deep learning methods, they model the semantic information of the input text, perform text matching between the input text and the address text in the address database, and find the latitude and longitude information of the matching point in the address database as the output.
[0004] However, practical experience has shown that address location occasionally yields errors. Therefore, the accuracy of address location needs further improvement. Summary of the Invention
[0005] The technical problem this invention aims to solve is that address location occasionally fails. Therefore, this invention provides a location method and apparatus based on an address knowledge graph, which can improve the accuracy of address location.
[0006] To address the aforementioned technical problems, the first aspect of this invention discloses a localization method based on an address knowledge graph, the method comprising:
[0007] Obtain the target address text and address knowledge graph, wherein the address knowledge graph is established based on the address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements, and the address attribute information includes location information and address entities;
[0008] Extract at least two target address entities from the target address text;
[0009] Based on at least two of the target address entities and the address knowledge graph, determine the target location information corresponding to the target address text.
[0010] As an optional implementation, in the first aspect of the present invention, the address knowledge graph is used to indicate the connection relationship between address elements and the address attribute information corresponding to each address element, wherein the two connected address elements have an N-level hierarchical relationship, where N is a natural number greater than 1.
[0011] The step of determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes:
[0012] Based on the address attribute information, search the address knowledge graph for matching address elements that match each target address entity;
[0013] Filter out matching address elements that have a connection relationship from the matching address elements;
[0014] Determine the last level of matching address elements among those with a connection relationship;
[0015] The location information corresponding to the last-level matching address element is used as the target location information.
[0016] As an optional implementation, in the first aspect of the present invention, the address attribute information includes at least two address entities;
[0017] The step of searching for matching address elements that match each target address entity in the address knowledge graph includes:
[0018] The address element whose address entity is consistent with the target address entity among at least two corresponding address entities is taken as the matching address element.
[0019] As an optional implementation, in the first aspect of the present invention, extracting at least two target address entities from the target address text includes:
[0020] Extract at least two target address entities from the target address text using the API interface of the location application; and / or,
[0021] At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
[0022] As an optional implementation, in the first aspect of the present invention, the method for establishing the address knowledge graph includes:
[0023] Get the address text data;
[0024] Extract multiple address elements and their corresponding address attribute information from the address text data.
[0025] The hierarchical relationship between the multiple address elements received as input;
[0026] The address element, the address attribute information corresponding to the multiple address entities, and the hierarchical relationship between the multiple address elements are constructed into tuple information in the form of tuples;
[0027] The tuple information is entered into a knowledge graph database to obtain the address knowledge graph.
[0028] As an optional implementation, in the first aspect of the present invention, the address text data comes from at least two sources;
[0029] Before extracting multiple address elements and their corresponding address attribute information from the address text data, the method further includes:
[0030] The address text data is cleaned to obtain cleaned address text data. The cleaning process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation removal, and data deduplication.
[0031] The step of extracting multiple address elements and their corresponding address attribute information from the address text data includes:
[0032] Extract multiple address elements and their corresponding address attribute information from the cleaned address text data.
[0033] As an optional implementation, in the first aspect of the present invention, determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes:
[0034] Construct SQL statements based on at least two of the target address entities;
[0035] Based on the SQL statement, search the knowledge graph database for matching address elements that match each of the target address entities;
[0036] Filter out matching address elements that have a connection relationship from the matching address elements;
[0037] Determine the last level of matching address elements among those with a connection relationship;
[0038] The location information corresponding to the last-level matching address element is used as the target location information.
[0039] A second aspect of the present invention discloses a positioning device based on an address knowledge graph, the device comprising:
[0040] The acquisition module is used to acquire target address text and address knowledge graph, wherein the address knowledge graph is established based on the location information corresponding to multiple address elements and the parent-child relationship between the multiple address elements;
[0041] The extraction module is used to extract the target address entity from the target address text;
[0042] The positioning module is used to determine the target location information corresponding to the target address text based on the target address entity and the address knowledge graph.
[0043] As an optional implementation, in a second aspect of the present invention, the address knowledge graph is used to indicate the connection relationships between address elements and the address attribute information corresponding to each address element. The two connected address elements have an N-level hierarchical relationship, where N is a natural number greater than or equal to 1. The positioning module is used to search for matching address elements that match each target address entity in the address knowledge graph based on the address attribute information; filter out matching address elements with connection relationships from the matching address elements; determine the last-level matching address element among the matching address elements with connection relationships; and use the location information corresponding to the last-level matching address element as the target location information.
[0044] As an optional implementation, in a second aspect of the present invention, the address attribute information includes at least two address entities; the positioning module is used to take the address element that is consistent with the target address entity among the corresponding at least two address entities as the matching address element.
[0045] As an optional implementation, in a second aspect of the invention, the extraction module is configured to extract at least two target address entities from the target address text via the API interface of the locating application; and / or,
[0046] At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
[0047] As an optional implementation, in a second aspect of the invention, the device further includes:
[0048] A construction module is used to acquire address text data; extract multiple address elements and address attribute information corresponding to the multiple address elements from the address text data; receive the hierarchical relationship between the multiple address elements; construct tuple information by combining the address elements, the address attribute information corresponding to the multiple address entities, and the hierarchical relationship between the multiple address elements in the form of tuples; and input the tuple information into a knowledge graph database to obtain the address knowledge graph.
[0049] As an optional implementation, in the second aspect of the present invention, the address text data comes from at least two sources;
[0050] The device also includes:
[0051] The cleaning module is used to clean the address text data to obtain the cleaned address text data. The cleaning process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation mark removal, and data deduplication.
[0052] This module is used to extract multiple address elements and their corresponding address attribute information from the cleaned address text data.
[0053] As an optional implementation, in a second aspect of the present invention, the positioning module is configured to construct an SQL statement based on at least two target address entities; search for matching address elements that match each target address entity from the knowledge graph database based on the SQL statement; filter out matching address elements with connection relationships from the matching address elements; determine the last-level matching address element among the matching address elements with connection relationships; and use the location information corresponding to the last-level matching address element as the target location information.
[0054] A third aspect of the present invention discloses another location device based on an address knowledge graph, the device comprising:
[0055] Memory containing executable program code;
[0056] A processor coupled to the memory;
[0057] The processor calls the executable program code stored in the memory to execute the location method based on address knowledge graph disclosed in the first aspect of the present invention.
[0058] The fourth aspect of the present invention discloses a computer-storable medium storing computer instructions, which, when invoked, are used to execute the address knowledge graph-based location method disclosed in the first aspect of the present invention.
[0059] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0060] In this embodiment of the invention, by acquiring target address text and an address knowledge graph, the address knowledge graph is established based on address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements. The address attribute information includes location information and address entities. At least two target address entities are extracted from the target address text. Based on the at least two target address entities and the address knowledge graph, the target location information corresponding to the target address text is determined. Since the address knowledge graph is established based on address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements, determining the target location information corresponding to the target address text based on the at least two target address entities and the address knowledge graph is equivalent to using the hierarchical relationship between multiple address elements for address positioning. In other words, this embodiment effectively utilizes prior information associated with address hierarchy or address entities, solving the problem that the prior art failed to effectively utilize prior information associated with address hierarchy or address entities, resulting in incorrect latitude and longitude positioning, and further improving the accuracy of address positioning. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0062] Figure 1 This is a flowchart illustrating a localization method based on an address knowledge graph disclosed in an embodiment of the present invention;
[0063] Figure 2 This is a schematic diagram of the structure of an address indication map disclosed in an embodiment of the present invention;
[0064] Figure 3 This is a schematic diagram of the structure of a positioning device based on an address knowledge graph disclosed in an embodiment of the present invention;
[0065] Figure 4 This is a schematic diagram of another positioning device based on address knowledge graph disclosed in an embodiment of the present invention. Detailed Implementation
[0066] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0067] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0068] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0069] This invention discloses a location method and apparatus based on an address knowledge graph, which can improve the accuracy of address location. These will be described in detail below.
[0070] It should be noted that the location method and device based on address knowledge graph in this embodiment can be applied to, but is not limited to, logistics transportation, order delivery, fire rescue and location query.
[0071] Example 1
[0072] Please see Figure 1 , Figure 1 This is a flowchart illustrating a localization method based on an address knowledge graph, as disclosed in an embodiment of the present invention. Figure 1 The described address knowledge graph-based localization method can be applied to address knowledge graph-based localization devices. The address knowledge graph-based localization device in this embodiment can be a terminal, a server, or a processor with data processing capabilities. Optionally, the terminal includes, but is not limited to, mobile phones and computer devices. The server can be a single server or a server cluster. The processor can be a chip, etc., and this embodiment of the invention is not limited thereto. Figure 1As shown, the localization method based on address knowledge graphs may include:
[0073] 110. Obtain the target address text and the address knowledge graph, wherein the address knowledge graph is established based on the address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements, and the address attribute information includes location information and address entities.
[0074] In this context, the target address text refers to the address text to be queried and located. In this embodiment, the target address text can be directly input by the user or obtained through voice parsing of the user's input; no limitation is made here. The address knowledge graph is a graph-based data structure composed of nodes (Points) and edges (Edges). A node is an entity, identified by a globally unique ID, and relations (also called attributes) connect two nodes. Simply put, a knowledge graph is a relational network that connects all different types of information (Heterogeneous Information). Knowledge graphs provide the ability to analyze problems from the perspective of "relationships." In this embodiment, the address knowledge graph refers to a graph-based data structure used to determine location information. Address elements can be used to indicate the identity of an address, such as its administrative status. Optionally, administrative status includes, but is not limited to, country, province, city, district, street, county, town, village, and specific location, etc., without limitation. The address entity refers to the specific address name. For example, address entities include, but are not limited to, Shanghai, Pudong New Area, Zhangjiang Town, and Juchuangxin R&D Building, etc., and are not limited here. Location information refers to information representing the location of the address element. Optionally, location information can be latitude and longitude information, and is not limited here.
[0075] 120. Extract at least two target address entities from the target address text.
[0076] In this embodiment, for example, if the target address text is Pudong New Area Juchuangxin R&D Building, then at least two target address entities include Pudong New Area and Juchuangxin R&D Building.
[0077] 130. Based on at least two of the target address entities and the address knowledge graph, determine the target location information corresponding to the target address text.
[0078] Specifically, existing address location services employ natural language processing (NLP) techniques and deep learning methods to model the semantic information of the input text, then match the input text with address text in an address database. However, existing address location services typically use a direct input of text sequences without hierarchically classifying or modeling the address elements (such as province, city, district, street / township, residential area, road, house number, etc.). This results in the ineffective utilization of address hierarchy or prior information related to address entities during address element parsing and text matching, leading to incorrect latitude and longitude coordinates.
[0079] The technical solution of this embodiment obtains target address text and an address knowledge graph. The address knowledge graph is established based on the address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements. The address attribute information includes location information and address entities. At least two target address entities are extracted from the target address text. Based on the at least two target address entities and the address knowledge graph, the target location information corresponding to the target address text is determined. Since the address knowledge graph is established based on the address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements, determining the target location information corresponding to the target address text based on the at least two target address entities and the address knowledge graph is equivalent to using the hierarchical relationship between multiple address elements for address positioning. In other words, this embodiment effectively utilizes prior information associated with address hierarchy or address entities, which can further improve the accuracy of address positioning.
[0080] In one possible implementation, the address knowledge graph is used to indicate the connection relationships between address elements and the address attribute information corresponding to each address element. There is an N-level hierarchical relationship between two connected address elements, where N is a natural number greater than or equal to 1.
[0081] In this embodiment, the connection relationship between address elements is determined based on the address entity corresponding to the address element. For example, assuming that the address elements include province, city, district, street, and specific location, then there is a level 1 hierarchical relationship between province and city, a level 2 hierarchical relationship between province and district, a level 1 hierarchical relationship between city and district, and a level 3 hierarchical relationship between city and specific location. For example, Shanghai and Guangzhou are cities, Pudong New Area and Panyu District are districts, Zhangjiang Town and Nancun Town are towns, and Juchuangxin R&D Building and Yuehai Plaza Office Building are specific locations. Then, the address elements corresponding to Shanghai and Pudong New Area are connected, the address elements corresponding to Shanghai and Zhangjiang Town are connected, the address elements corresponding to Shanghai and Juchuangxin R&D Building are connected, the address elements corresponding to Pudong New Area and Zhangjiang Town are connected, the address elements corresponding to Pudong New Area and Juchuangxin R&D Building are connected, and the address elements corresponding to Zhangjiang Town and Juchuangxin R&D Building are connected.
[0082] Similarly, there is a connection between the address elements corresponding to Guangzhou City and the address elements corresponding to Panyu District, between the address elements corresponding to Guangzhou City and the address elements corresponding to Nancun Town, between the address elements corresponding to Guangzhou City and the address elements corresponding to Yuehai Plaza office building, between the address elements corresponding to Panyu District and the address elements corresponding to Nancun Town, between the address elements corresponding to Panyu District and the address elements corresponding to Yuehai Plaza office building, and between the address elements corresponding to Nancun Town and the address elements corresponding to Yuehai Plaza office building.
[0083] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of an address indication map disclosed in an embodiment of the present invention. For example... Figure 2 As shown, in the address knowledge graph, there is an N-level hierarchical relationship between two connected address elements.
[0084] It is understood that the address knowledge graph in this embodiment is used to indicate the connection relationship between address elements and the address attribute information corresponding to each address element. There is an N-level hierarchical relationship between two connected address elements. Therefore, no matter what form the input target address text is, the target location information can be accurately determined, which can improve the compatibility of positioning.
[0085] For example, whether you input "Juchuangxin R&D Building, Zhangjiang Town, Pudong New Area, Shanghai" or "Chuangxin R&D Building, Pudong New Area", the address knowledge graph is used to indicate the connection relationship between address elements and the address attribute information corresponding to each address element. The two connected address elements have an N-level hierarchical relationship, so the Juchuangxin R&D Building can be accurately located.
[0086] In one possible implementation, determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes:
[0087] Based on the address attribute information, search the address knowledge graph for matching address elements that match each target address entity;
[0088] Filter out matching address elements that have a connection relationship from the matching address elements;
[0089] Determine the last level of matching address elements among those with a connection relationship;
[0090] The location information corresponding to the last-level matching address element is used as the target location information.
[0091] In this embodiment, since the address attribute information includes address entities, matching address elements that match each target address entity can be found from the address knowledge graph based on the address entities in the address attribute information. For example, if the target address entity is Shanghai, then the address element corresponding to Shanghai is used as the matching address element that matches the target address entity. In this embodiment, since different address elements may have the same address elements, it is necessary to filter out matching address elements with connection relationships from the matching address elements. For example, Chaoyang is a prefecture-level city under Liaoning Province and also a district of Beijing and Changchun with the same name. Therefore, when the target address text is Chaoyang, multiple matching address elements may be matched. However, if another target address text is Beijing, then the matching address elements corresponding to Chaoyang in Liaoning Province and the matching address elements corresponding to Chaoyang in Changchun do not have connected matching address elements. Therefore, the matching address elements corresponding to Chaoyang in Liaoning Province and the matching address elements corresponding to Chaoyang in Changchun can be excluded, thus retaining the matching address elements corresponding to Chaoyang in Beijing. Specifically, the location information corresponding to the last-level matched address element is the target location information corresponding to the target address text that needs to be determined.
[0092] Optionally, in this embodiment, starting from the first-level matching address element, the search continues until the last-level matching address element is reached, thereby outputting the location information corresponding to the last-level matching address element. The location information corresponding to the last-level matching address element is used as the target location information corresponding to the target address text.
[0093] The technical solution of this embodiment finds matching address elements that match each target address entity in the address knowledge graph based on the address attribute information; filters out matching address elements with connection relationships from the matching address elements; determines the last-level matching address element among the matching address elements with connection relationships; and uses the location information corresponding to the last-level matching address element as the target location information. Since impossible matching address elements are excluded in advance, the accuracy of address positioning can be further improved.
[0094] In one possible implementation, if there are two or more last-level matching address elements, the location information corresponding to the last-level matching address elements is used as the target location information, including:
[0095] Obtain auxiliary matching information, which includes the target distance between the current location and each matching address element or the location popularity corresponding to each matching address element;
[0096] Based on the auxiliary matching information, one of the last-level matching address elements is selected from two or more last-level matching address elements.
[0097] The current location can be the location of the user who entered the target address text. Specifically, when the auxiliary matching information includes the target distance between the current location and each matching address element, the last-level matching address element with the closest target distance to the current location can be used as the final determined last-level matching address element. Alternatively, it can be the distance difference between the target distance and a preset distance, with the last-level matching address element corresponding to the smallest distance difference being used as the final determined last-level matching address element. The preset distance can be obtained by comparing the user's historical current location with historical target location information; for example, the preset distance can be the average of the distances between the user's historical current location and historical target location information. When the auxiliary matching information includes the location popularity corresponding to each matching address element, the last-level matching address element with the highest location popularity can be used as the final determined last-level matching address element.
[0098] The technical solution of this embodiment can further improve the accuracy of address positioning by obtaining auxiliary matching information when there are two or more last-level matching address elements, and selecting one of the last-level matching address elements from the two or more last-level matching address elements according to the auxiliary matching information.
[0099] It should be noted that the address attribute information includes one address entity, or it may include at least two address entities; this is not limited here.
[0100] In some situations, different users have different habits regarding the target address text they input. For example, for Shanghai, some users are used to calling it "Shanghai," some "Hu," and others "XX." Similarly, for Jing'an District, some users are used to calling it "Jing'an District," while others are used to calling it "Zhabei District." Therefore, if the address attribute information includes an address entity, it's easy for matching address elements to miss matches. For instance, if an address element corresponds to Jing'an District, but the user inputs "Zhabei District," then that address element will be identified as not matching the target address text, resulting in a low success rate and accuracy of address element matching. Therefore, it is necessary to further improve the success rate and accuracy of address element matching.
[0101] In one possible implementation, the address attribute information includes at least two of the address entities;
[0102] The step of searching for matching address elements that match each target address entity in the address knowledge graph includes:
[0103] The address element whose address entity is consistent with the target address entity among at least two corresponding address entities is taken as the matching address element.
[0104] The at least two address entities include, but are not limited to, aliases, types, and pinyin. In this embodiment, the at least two address entities corresponding to the same address element represent the same administrative identity, only with different names. For example, the at least two address entities corresponding to the same address element include Shanghai, Hu, and XX, etc. Specifically, if one of the at least two address entities corresponding to an address element is consistent with the target address entity, then that address element is used as the matching address element for matching the target address entity.
[0105] The technical solution of this embodiment, by configuring at least two address entities corresponding to the same address element, where at least two entities corresponding to the same address element represent the same administrative identity, can further improve the matching success rate and accuracy of address elements by taking into account different names used by users for the same region. Furthermore, while configuring at least two address entities corresponding to an address element increases the number of matching address elements, potentially decreasing the accuracy of address location, this is mitigated by filtering out connected matching address elements, identifying the last-level matching address element among those connected, and using the location information corresponding to the last-level matching address element as the target location information. This approach ensures both the matching success rate and accuracy of address elements while maintaining the accuracy of address location.
[0106] In one possible implementation, at least two target address entities are extracted from the target address text, including:
[0107] Extract at least two target address entities from the target address text by locating the application's API (Application Programming Interface); and / or,
[0108] At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
[0109] The location application can be, for example, the API interface of location applications such as Amap, Baidu Maps, and Tencent Maps. The entity extraction model can be built using BERT (Bidirectional Encoder Representations from Transformer) + BILSTM (Bi-directional Long Short-Term Memory) + CRF (Conditional Random Field).
[0110] Optionally, when extracting at least two target address entities from the target address text, including:
[0111] Extract at least two target address entities from the target address text by locating the application's API (Application Programming Interface);
[0112] At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
[0113] In this embodiment, at least two target address entities can be extracted from the target address text through the API interface of the location application. If the extraction of the target address entities through the API interface is successful, the target address extracted through the API interface is directly output. If the extraction of the target address entities through the API interface fails, at least two target address entities can be extracted from the target address text through a pre-trained entity extraction model.
[0114] The technical solution of this embodiment extracts target address entities through multiple methods, including locating the API interface of the application and using an entity extraction model, which can improve the success rate of target address entity extraction. Furthermore, at least two target address entities are first extracted from the target address text via the API interface of the application. If the extraction is successful, the target address extracted via the API interface is directly output. If extraction fails, at least two target address entities can be extracted using a pre-trained entity extraction model. Since the computational power required to extract at least two target address entities via the API interface is lower than that required using the pre-trained model, and the time required is also less, this embodiment can reduce computational power and shorten extraction time while ensuring accurate identification of target address entities.
[0115] The following examples illustrate how to build an address knowledge graph, based on any of the above examples.
[0116] In one possible implementation, the address knowledge graph is established in the following ways:
[0117] Get the address text data;
[0118] Extract multiple address elements and their corresponding address attribute information from the address text data.
[0119] The hierarchical relationship between the multiple address elements received as input;
[0120] The address element, the address attribute information corresponding to the multiple address entities, and the hierarchical relationship between the multiple address elements are constructed into tuple information in the form of tuples;
[0121] The tuple information is entered into a knowledge graph database to obtain the address knowledge graph.
[0122] The address text data is based on a large volume of address text accumulated from historical projects. The address text data consists of "address name," "address description," "address type," "update time," and "change time." The address name identifies the address entity, while the address description identifies location and distance information. The address type identifies the address element. The hierarchical relationships between multiple address elements can be manually entered. Examples include: "Shanghai" (address element, "city") - "contains" (relationship, "is-a") - "Pudong New Area" (address element, "district"), "Shanghai" (address element, "city") - "contains" (relationship, "is-a") - "Zhangjiang Town" (address element, "township"), "Pudong New Area" (address element, "district") - "contains" (relationship, "is-a") - "Zhangjiang Town" (address element, "township"), etc.
[0123] In this embodiment, the establishment of the address knowledge graph can be broadly divided into information extraction, knowledge representation, knowledge processing, and graph construction. Information extraction: Address entities are extracted from unstructured address text data and transformed into structured address elements. These address elements are then associated according to manually defined relationships, and attributes such as aliases, types, and pinyin are defined for each element.
[0124] (1) Address Element Parsing: Extract address element entities from the address text and predict the entity type. For example, inputting "Shanghai Pudong New Area Zhangjiang Town Juchuangxin R&D Building", the output is "Shanghai": "city", "Pudong New Area": "district", "Zhangjiang Town": "township", "Juchuangxin R&D Building": "poi". To implement the address element parsing function, you can use the API provided by Amap or build your own BERT+BILSTM+CRF named entity model structure for prediction.
[0125] (2) Definition of address relationship: Through the address element parsing function, address elements of corresponding types are extracted from the input address text. By manually setting relationships, hierarchical associations are made between address elements. For example, "Shanghai" (address element, "city") - "contains" (relationship, "is-a") - "Pudong New Area" (address element, "district"), "Shanghai" (address element, "city") - "contains" (relationship, "is-a") - "Zhangjiang Town" (address element, "township"), "Pudong New Area" (address element, "district") – "contains" (relationship, "is-a") - "Zhangjiang Town" (address element, "township"), etc.
[0126] (3) Definition of address attributes: According to each type of address entity, corresponding entity attributes are designed, including entity name, entity type, entity alias, etc. For example, for the address element "Shanghai": ("name": "Shanghai", "entity type": "city", "entity alias": ["Hu", "XX", "Shanghai"]); for the address element "Jing'an District": ("name": "Jing'an District", "entity type": "district", "entity alias": ["Jing'an", "Zhabei District", "Zhabei"]).
[0127] Knowledge representation: It refers to forming unified structured data by presenting address elements, address relationships, and address attributes in the form of triples. Among them, SPO: S refers to the subject, P refers to the predicate, and O refers to the object. In the address knowledge graph, both S and O refer to address elements, P refers to the relationship defined between address elements, and the attribute values are attached to the address element entities.
[0128] Knowledge processing: It refers to the integration and governance of geographical element entities, relationships, and attributes. It includes ontology construction, entity linking, and knowledge merging, etc. Ontology construction:梳理 the address knowledge graph of address element types, attributes, and relationships.
[0129] Please refer to Figure 2 . Figure 2 It shows the address knowledge graph structure among provinces, cities, districts, sub-districts / towns, and POIs. Among them, the circles in the figure represent address element entities, the edges represent the relationships between address element entities, and the information of entity attribute values is within the boxes.
[0130] It should be noted that there is an unclear expression "梳理" in the translation of item , which may need to be further clarified according to the specific context.Entity linking primarily addresses redundant and erroneous information in address entities, relations, and attributes. For example, given the triples "Shanghai"-"is-a"-"Pudong New Area" and "Shanghai"-"is-a"-"Pudong", they are merged into one triple based on their meanings. Similarly, for "FamilyMart", which exists on both Xicheng Road and Chengji Road, a suffix is added to distinguish them, resulting in two address entities: "FamilyMart (Xicheng Road)" and "FamilyMart (Chengji Road)".
[0131] Knowledge merging: After ontology construction and entity linking, the processed triples are deduplicated and merged as a whole to obtain a high-quality triple data set for address map construction.
[0132] Graph Construction: Using the Neo4j graph database, the processed triple information is entered into the graph database to construct an address knowledge graph.
[0133] Understandably, the main purpose of constructing the address map is to provide address location services. When a user enters an address text, the address element parsing function first extracts the corresponding address entities and types, and organizes them into a map search hierarchy path according to the ontology schema structure. For example, "Shanghai" (city) -> "Pudong New Area" (district) -> "Zhangjiang Town" (township) -> "Juchuangxin R&D Building" (POI). This search path is then searched in the address map using SQL statements. If the last level is found, the latitude and longitude attribute values of the last address entity are returned; otherwise, the location is not located.
[0134] In one possible implementation, the address text data comes from at least two sources;
[0135] Before extracting multiple address elements and their corresponding address attribute information from the address text data, the method further includes:
[0136] The address text data is cleaned to obtain cleaned address text data. The cleaning process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation removal, and data deduplication.
[0137] The step of extracting multiple address elements and their corresponding address attribute information from the address text data includes:
[0138] Extract multiple address elements and their corresponding address attribute information from the cleaned address text data.
[0139] The sources of address text data can include, but are not limited to, existing address databases, purchased data, and external data. Existing address databases are large volumes of address text accumulated from historical projects, comprising elements such as "address name," "address description," "address type," "update time," and "change time." Purchased data expands the database by acquiring data assets from the market; buyers include companies like Aurora and Gaode. External data refers to expanding the database through web scraping or data provided by business partners. External data sources include platforms like Qichacha and Baidu Encyclopedia. For the massive amounts of multi-source heterogeneous data, data cleaning is performed. This cleaning process mainly includes text conversion (traditional / simplified), English letter case conversion, punctuation removal, and data deduplication, ultimately obtaining address text data with a unified structure and high quality. The cleaned address data is then stored in a database.
[0140] The technical solution of this embodiment cleans the address text data to obtain cleaned address text data. The cleansing process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation removal, and data deduplication. Extracting multiple address elements and their corresponding address attribute information from the cleaned address text data can improve the accuracy of address knowledge graph construction and thus improve the accuracy of address location.
[0141] In one possible implementation, determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes:
[0142] Construct SQL statements (Structured Query Language) based on at least two of the target address entities.
[0143] Based on the SQL statement, search the knowledge graph database for matching address elements that match each of the target address entities;
[0144] Filter out matching address elements that have a connection relationship from the matching address elements;
[0145] Determine the last level of matching address elements among those with a connection relationship;
[0146] The location information corresponding to the last-level matching address element is used as the target location information.
[0147] The technical solution of this embodiment constructs an SQL statement (Structured Query Language) based on at least two target address entities; and searches for matching address elements that correspond to each target address entity in the knowledge graph database based on the SQL statement. In other words, the user only needs to input the target address text normally, and the SQL statement is automatically constructed based on at least two target address entities. This allows the search for matching address elements that correspond to each target address entity in the knowledge graph database using the SQL statement, eliminating the need for the user to construct the SQL statement manually, thus improving the convenience of address location. Furthermore, by searching for matching address elements that correspond to each target address entity in the address knowledge graph based on the address attribute information; filtering out matching address elements with connection relationships from the matching address elements; determining the last-level matching address element among the matching address elements with connection relationships; and using the location information corresponding to the last-level matching address element as the target location information, the accuracy of address location can be further improved by pre-excluding impossible matching address elements.
[0148] Example 2
[0149] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a positioning device based on an address knowledge graph, as disclosed in an embodiment of the present invention. Figure 3 As shown, the address knowledge graph-based positioning device includes an acquisition module 310, an extraction module 320, and a positioning module 330. Wherein:
[0150] The acquisition module 310 is used to acquire target address text and address knowledge graph, wherein the address knowledge graph is established based on the location information corresponding to multiple address elements and the parent-child relationship between the multiple address elements;
[0151] Extraction module 320 is used to extract the target address entity from the target address text;
[0152] The positioning module 330 is used to determine the target location information corresponding to the target address text based on the target address entity and the address knowledge graph.
[0153] In one possible implementation, the address knowledge graph is used to indicate the connection relationships between address elements and the address attribute information corresponding to each address element. There is an N-level hierarchical relationship between two connected address elements, where N is a natural number greater than or equal to 1. The positioning module 330 is used to search for matching address elements that match each target address entity in the address knowledge graph based on the address attribute information; filter out matching address elements with connection relationships from the matching address elements; determine the last-level matching address element among the matching address elements with connection relationships; and use the location information corresponding to the last-level matching address element as the target location information.
[0154] In one possible implementation, the address attribute information includes at least two address entities; the positioning module 330 is used to take the address element that is consistent with the target address entity among the corresponding at least two address entities as the matching address element.
[0155] In one possible implementation, the extraction module 320 is configured to extract at least two target address entities from the target address text via the API interface of the locating application; and / or,
[0156] At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
[0157] In one possible implementation, the device further includes:
[0158] A construction module is used to acquire address text data; extract multiple address elements and address attribute information corresponding to the multiple address elements from the address text data; receive the hierarchical relationship between the multiple address elements; construct tuple information by combining the address elements, the address attribute information corresponding to the multiple address entities, and the hierarchical relationship between the multiple address elements in the form of tuples; and input the tuple information into a knowledge graph database to obtain the address knowledge graph.
[0159] In one possible implementation, the address text data comes from at least two sources;
[0160] The device also includes:
[0161] The cleaning module is used to clean the address text data to obtain the cleaned address text data. The cleaning process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation mark removal, and data deduplication.
[0162] This module is used to extract multiple address elements and their corresponding address attribute information from the cleaned address text data.
[0163] In one possible implementation, the positioning module 330 is configured to construct an SQL statement based on at least two target address entities; search for matching address elements that match each target address entity from the knowledge graph database based on the SQL statement; filter out matching address elements with connection relationships from the matching address elements; determine the last-level matching address element among the matching address elements with connection relationships; and use the location information corresponding to the last-level matching address element as the target location information.
[0164] It is understood that the function of the device in this embodiment can be referred to the description of any of the above embodiments, and is not limited herein.
[0165] Example 3
[0166] Please see Figure 4 , Figure 4 This is a schematic diagram of another location device based on an address knowledge graph disclosed in an embodiment of the present invention. For example... Figure 4 As shown, the address knowledge graph-based positioning device may include:
[0167] Memory 401 storing executable program code;
[0168] Processor 402 coupled to memory 401;
[0169] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the location method based on address knowledge graph described in Embodiment 1 of the present invention.
[0170] Example 4
[0171] This invention discloses a computer-storable medium storing computer instructions. When these computer instructions are invoked, they are used to execute the steps in the address knowledge graph-based location method described in Embodiment 1 of this invention.
[0172] Example 5
[0173] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps in the address knowledge graph-based location method described in Embodiment 1.
[0174] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0175] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0176] Finally, it should be noted that the location method and apparatus based on address knowledge graph disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A localization method based on address knowledge graph, characterized in that, The method includes: Obtain the target address text and address knowledge graph, wherein the address knowledge graph is established based on the address attribute information corresponding to multiple address elements and the hierarchical relationship between the multiple address elements, and the address attribute information includes location information and address entities; Extract at least two target address entities from the target address text; Based on at least two of the target address entities and the address knowledge graph, determine the target location information corresponding to the target address text; The address knowledge graph is used to indicate the connection relationship between address elements and the address attribute information corresponding to each address element. There is an N-level hierarchical relationship between two connected address elements, where N is a natural number greater than 1. The step of determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes: Based on the address attribute information, search the address knowledge graph for matching address elements that match each target address entity; Filter out matching address elements that have a connection relationship from the matching address elements; Determine the last level of matching address elements among those with a connection relationship; The location information corresponding to the last-level matching address element is used as the target location information; The method further includes: If there are two or more matching address elements at the last level, the step of using the location information corresponding to the last matching address element as the target location information includes: Obtain auxiliary matching information, which includes the target distance between the current location and each matching address element or the location popularity corresponding to each matching address element; Based on the auxiliary matching information, one of the last-level matching address elements is selected from two or more last-level matching address elements.
2. The method according to claim 1, characterized in that, The address attribute information includes at least two address entities; The step of searching for matching address elements that match each target address entity in the address knowledge graph includes: The address element whose address entity is consistent with the target address entity among at least two corresponding address entities is taken as the matching address element.
3. The method according to claim 1, characterized in that, The extraction of at least two target address entities from the target address text includes: Extract at least two target address entities from the target address text using the API interface of the location application; and / or, At least two target address entities are extracted from the target address text using a pre-trained entity extraction model, which is trained by the address text and the address element labels corresponding to the address text.
4. The method according to any one of claims 1-3, characterized in that, The methods for establishing the address knowledge graph include: Get the address text data; Extract multiple address elements and their corresponding address attribute information from the address text data. The hierarchical relationship between the multiple address elements received as input; The address element, the address attribute information corresponding to the multiple address entities, and the hierarchical relationship between the multiple address elements are constructed into tuple information in the form of tuples; The tuple information is entered into a knowledge graph database to obtain the address knowledge graph.
5. The method according to claim 4, characterized in that, The address text data comes from at least two sources; Before extracting multiple address elements and their corresponding address attribute information from the address text data, the method further includes: The address text data is cleaned to obtain cleaned address text data. The cleaning process includes at least one of the following: simplified / traditional Chinese conversion, uppercase / lowercase conversion of English letters, punctuation removal, and data deduplication. The step of extracting multiple address elements and their corresponding address attribute information from the address text data includes: Extract multiple address elements and their corresponding address attribute information from the cleaned address text data.
6. The method according to claim 4, characterized in that, The step of determining the target location information corresponding to the target address text based on at least two target address entities and the address knowledge graph includes: Construct SQL statements based on at least two of the target address entities; Based on the SQL statement, search the knowledge graph database for matching address elements that match each of the target address entities; Filter out matching address elements that have a connection relationship from the matching address elements; Determine the last level of matching address elements among those with a connection relationship; The location information corresponding to the last-level matching address element is used as the target location information.
7. A positioning device based on an address knowledge graph, characterized in that, The apparatus is used to perform the location method based on address knowledge graph as described in any one of claims 1-6, and the apparatus comprises: The acquisition module is used to acquire target address text and address knowledge graph, wherein the address knowledge graph is established based on the location information corresponding to multiple address elements and the parent-child relationship between the multiple address elements; The extraction module is used to extract the target address entity from the target address text; The positioning module is used to determine the target location information corresponding to the target address text based on the target address entity and the address knowledge graph.
8. A positioning device based on an address knowledge graph, characterized in that, The device includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the location method based on address knowledge graph as described in any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which, when invoked, are used to execute the location method based on address knowledge graph as described in any one of claims 1-6.
Citation Information
Patent Citations
City address positioning method based on congestion index map
CN112445976A
Entity classification method and system based on knowledge graph, terminal and storage medium
CN115391568A