Address recommendation method and electronic device combining spatial semantics and retrieval-enhanced generation
By combining spatial semantics and retrieval-enhanced address recommendation methods, and utilizing multi-objective fusion matching models and large language models, we solve the problems of high computational cost and difficult updating and maintenance of existing address matching methods in resource-constrained environments, and achieve efficient and accurate address recommendations.
Patent Information
- Application Number
- CN202510923331.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-04
AI Technical Summary
Existing address matching methods have high computational costs, limited semantic understanding capabilities, and are difficult to update and maintain in resource-constrained environments, making them difficult to effectively apply in rapidly changing geographic information systems.
The address recommendation method combines spatial semantics and retrieval enhancement generation. Through a multi-objective fusion matching model and a large language model (LLM) framework, it uses external geographic information libraries and vector libraries to vectorize and rank address information, reducing dependence on geographic text content and user historical behavior data.
It improves the efficiency and accuracy of address recommendation, reduces computing costs, solves the problems of high resource consumption and difficult updating and maintenance, and is suitable for various resource-constrained environments.
Smart Images

Figure CN120429333B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, in particular to the field of spatial positioning data analysis and application technology, and specifically to an address recommendation method and electronic device that combines spatial semantics and retrieval enhancement generation. Background Art
[0002] With the development of computers, users can use electronic devices to perform various functions. For example, users can input addresses through electronic devices to quickly locate geographic entities.
[0003] Computer systems implementing address matching methods also face various challenges. For example, content-based recommendation methods require a reasonable representation and extraction of the content of geographic texts. Recommendation methods based on collaborative filtering require querying historical user behavior data after calculating geographic text similarity. Deep learning-based recommendation methods require massive amounts of data for pre-training before they can be used, resulting in high computational costs, limiting their application in resource-constrained environments. For example, the semantic diversity and contextual uncertainty of geographic named entities make it difficult to accurately identify and generate specific information. These methods typically rely on large amounts of labeled data. In the absence of sufficient or low-quality data, model performance can significantly degrade, limiting their effectiveness in data-scarce regions. Furthermore, models need to be regularly updated to reflect the latest geographic information and changes in language usage. However, maintaining and updating these models can be time-consuming and costly, especially in rapidly changing fields such as geographic information systems. Summary of the Invention
[0004] This disclosure section is provided to briefly introduce concepts that will be described in detail in the detailed description section below. This disclosure section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] An embodiment of the present invention provides an address recommendation method that combines spatial semantics and retrieval enhancement generation, the method comprising: receiving a user query request, wherein the user query request includes target query address information; inputting the target query address information into a multi-target fusion matching model to determine N first candidate geographic named entities and corresponding geographic coordinates; vectorizing the target query address information to obtain a target query vector, and searching and determining M candidate vectors in a second vector library based on the target query vector, wherein the second vector library corresponds to a second geographic information library, and the second geographic information library includes address document blocks; obtaining M candidate address document blocks from the second geographic information library based on the determined M candidate vectors; and combining the target query address information and the corresponding geographic coordinates, the first candidate geographic named entity and the corresponding geographic coordinates with the target query address information and the corresponding geographic coordinates. and candidate address document blocks, filling them into a preset integrated prompt information template to obtain integrated prompt information; inputting the integrated prompt information into a generation model, and taking the recommended geographic named entity generated by the generation model as the geographic named entity matching the target query address information; wherein, the generation model performs a generation step based on the integrated prompt information, and outputs the recommended geographic named entity and the corresponding geographic coordinates; wherein, the generation step performed by the generation model includes: extracting a second candidate geographic named entity from the candidate address document block; calculating the geographic distance between the first candidate geographic named entity and the second candidate geographic named entity and the target query address information; sorting the first candidate geographic named entity and the second candidate geographic named entity based on the geographic distance; and outputting T geographic named entities and the corresponding geographic coordinates according to the sorting result.
[0006] In some embodiments, the second geographic information library includes a structured address document block, which includes one or more of the following: address, name, administrative area and geographic coordinates; the address document block in the geographic information library and the second vector in the second vector library are linked based on the index library.
[0007] In some embodiments, the vectorization method for vectorizing the target query address information is the same as the vectorization method for vectorizing the second geographic information database to obtain the second vector database.
[0008] In some embodiments, the generating step also includes: identifying key geographic elements from the target query address information; determining the candidate geographic named entity containing the key geographic element from the first candidate geographic named entity and the second candidate geographic named entity; and sorting the first candidate geographic named entity and the second candidate geographic named entity based on geographic distance, including: sorting the candidate geographic named entity containing the key geographic element according to the geographic distance from the target query address information and the degree of matching with the key geographic element.
[0009] In some embodiments, the sorting of the first candidate geographic named entity and the second candidate geographic named entity based on geographic distance includes: in response to the first candidate geographic named entity or the second candidate geographic named entity including the target query address information, the candidate geographic named entity including the target query address information is recommended as a geographic named entity.
[0010] In some embodiments, the step of determining the first candidate geographic named entity includes: obtaining target query address information; inputting the target query address information into a multi-target fusion matching model based on spatial semantics, wherein the multi-target fusion matching model is used to generate a similarity score between the target query address information and the candidate address information, and the candidate address information is the address information in the first geographic information database; and determining the first candidate geographic named entity based on the similarity score.
[0011] In some embodiments, the multi-target fusion matching model includes an encoder; wherein, the encoder is used to generate an address vector by generating address information of the first geographic information database; the encoder generates a corresponding address vector in response to receiving the target query address information.
[0012] In some embodiments, the training process of the encoder includes: setting multiple decoders corresponding to the encoder; adjusting the parameters of the encoder according to the outputs of the multiple decoders; wherein the multiple decoders include at least two of the following: a geographic named entity feature segmentation decoder, used to predict the boundaries of geographic named entity features; a geographic named entity matching decoder, used to predict whether the input geographic named entity pair matches; a geographic named entity spatial similarity score decoder realizes the prediction of spatial similarity score by adding a regression score predictor.
[0013] In some embodiments, the evaluation index of the multi-objective fusion matching model training process includes the distance mean error, wherein the distance mean error is calculated by:
[0014] ;
[0015] In this formula, It is an optional parameter, indicating that the model output Recommended results; Indicates the spatial closest match between the input query geographic named entity and the geographic named entity corpus. The spatial distance between geographic named entities; It means that the input query geographic named entity ranks first among the recommended results output by the model. The spatial distance between geographic named entities.
[0016] In a second aspect, an embodiment of the present invention provides an electronic device comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the address recommendation method combining spatial semantics and retrieval enhancement generation as described in the first aspect.
[0017] The address recommendation method, device and electronic device provided by the embodiments of the present invention that combine spatial semantics and retrieval enhancement generation can receive a user query request, wherein the user query request includes target query address information; input the target query address information into a multi-target fusion matching model to determine N first candidate geographic named entities and corresponding geographic coordinates; vectorize the target query address information to obtain a target query vector, and search and determine M candidate vectors in a second vector library based on the target query vector, wherein the second vector library corresponds to a second geographic information library, and the second geographic information library includes address document blocks; obtain M candidate address document blocks from the second geographic information library based on the determined M candidate vectors; and combine the target query address information and the corresponding geographic coordinates, the first candidate geographic named entity and the corresponding geographic coordinates. The method comprises the following steps: extracting a second candidate geo-named entity from the candidate address document block; calculating the geographic distance between the first and second candidate geo-named entities and the target query address information; ranking the first and second candidate geo-named entities based on the geographic distance; and outputting T geo-named entities and their corresponding geographic coordinates based on the ranking results. Thus, a novel address recommendation method combining spatial semantics and retrieval-augmented generation is provided. By introducing an advanced large language model (LLM) and RAG (retrieval-augmented generation) framework, the method improves the understanding of geo-named entities and performs address recommendation tasks. This method eliminates the need to extract geographic text content or access historical user behavior data, and addresses the problems of existing geo-named entity matching models, such as high resource consumption, limited semantic understanding capabilities, and difficulty in updating and maintaining. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 The flowchart of an embodiment of the address recommendation method combining spatial semantics and retrieval enhancement generation according to the present invention.
[0020] Figure 2 This is a schematic diagram of an application scenario of the address recommendation method combining spatial semantics and retrieval enhancement generation according to the present invention.
[0021] Figure 3 FIG. 1 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0023] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0025] It should be noted that the concepts of "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0028] Please refer to Figure 1 , which shows the process of an embodiment of the address recommendation method combining spatial semantics and retrieval enhancement generation according to the present invention. Figure 1 The address recommendation method combining spatial semantics and retrieval enhancement generation includes the following steps:
[0029] Step 101: Receive a user query request.
[0030] In this embodiment, the user query request includes target query address information, which may be address information to be queried input by the user.
[0031] Optionally, the address information may contain geographic named entities.
[0032] Geographical named entities (GNEs) can be considered domain-specific named entities, specifically named entities in text that describe geographic locations. Place names are an important component of GNEs. GNEs can indicate geographic entities. Geographic entities are fundamental data units that digitally represent indivisible real-world geographical phenomena in a structured manner, encompassing natural landforms, man-made structures, and other types.
[0033] In some scenarios, geographic named entities that match the target query address information can be recommended to the user to help the user quickly determine the geographic named entity they want to query and improve information query efficiency.
[0034] Step 102: Input the target query address information into a multi-target fusion matching model to determine N first candidate geographic named entities and corresponding geographic coordinates.
[0035] In this embodiment, the target query address information can be input into a multi-target fusion matching model. The multi-target fusion matching model is established based on a multi-target task and can be used to generate matching geographic named entities for the input target query address information. In this application, the geographic named entity output by the multi-target fusion matching model can be referred to as a first candidate geographic named entity to distinguish it from a second candidate geographic named entity.
[0036] Optionally, the multi-objective fusion matching model can be trained based on the geographic data of the first geographic database.
[0037] As an example, the above geographic coordinates may be expressed as longitude and latitude.
[0038] Optionally, the specific value of N can be set according to actual application scenarios and is not limited here. As an example, the value of N can be 5.
[0039] Step 103: vectorize the target query address information to obtain a target query vector, and search and determine M candidate vectors in a second vector library based on the target query vector.
[0040] In this embodiment, the second vector library corresponds to the second geographic information library, and the second geographic information library includes address document blocks.
[0041] In this embodiment, the second geographic information database may also be referred to as a second geographic database, which is different from the first geographic database. The first geographic database may be a geographic database used to train a multi-objective fusion model.
[0042] Optionally, the second geographic information database can be extracted from external data. The second geographic information database can include fields such as address, name, administrative area and coordinates to provide structured geographic information to support deep matching tasks.
[0043] In this embodiment, the vectorization method for vectorizing the target query address information may be a vectorization method used by a self-built or open-source large language model.
[0044] The target query address information is vectorized to obtain a target query vector. The target query vector can be matched with a second vector in the second vector library to obtain multiple candidate vectors. The candidate vectors can be used to search for address document blocks in the geographic information library.
[0045] Step 104: Obtain M candidate address document blocks from the geographic information database corresponding to the second vector database according to the determined M candidate vectors.
[0046] Here, there is an index relationship between the address document block and the vector in the second vector library. The address document block indicated by the second vector in the second vector library is used as a candidate address document block.
[0047] Optionally, the address document block may include the following information but is not limited to: address, name, administrative region, latitude, and longitude.
[0048] Optionally, the value of M can be 3.
[0049] Step 105 : Fill the target query address information and the corresponding longitude and latitude, the first candidate geographic named entity and the corresponding geographic coordinates, and the candidate address document block into a preset integrated prompt information template to obtain integrated prompt information.
[0050] That is, the target query address information and the corresponding longitude and latitude are added to the preset integrated prompt information template. The first candidate geographic named entity and the corresponding geographic coordinates are added to the preset integrated prompt information template. The candidate address document block is added to the preset integrated prompt information template.
[0051] In this embodiment, the above-mentioned integrated prompt information template can be pre-set. After obtaining the target query address information and the corresponding longitude and latitude, the first candidate geographic named entity and the corresponding geographic coordinates, and the candidate address document block, the execution entity automatically fills the target query address information and the corresponding longitude and latitude, the first candidate geographic named entity and the corresponding geographic coordinates, and the candidate address document block into the integrated prompt information template to obtain the integrated prompt information.
[0052] As an example, the above-mentioned integrated prompt information can be used to provide information guidance in the form of thought chains, enabling the generative model to optimize the model's response by simulating the human problem-solving process.
[0053] In this embodiment, the above-mentioned integrated prompt information may instruct the generation model to execute the generation process according to the steps in the integrated prompt information.
[0054] Step 106: input the integrated prompt information into the generation model, and use the recommended geographic named entity generated by the generation model as the geographic named entity matching the target query address information.
[0055] In this embodiment, the generation model performs a generation step based on the integrated prompt information, and outputs a recommended geographic named entity and a corresponding geographic coordinate.
[0056] In this embodiment, the generation steps performed by the generation model include: extracting the second candidate geographic named entity from the candidate address document block; calculating the geographic distance between the first candidate geographic named entity and the second candidate geographic named entity and the target query address information; sorting the first candidate geographic named entity and the second candidate geographic named entity based on the geographic distance; and outputting T geographic named entities and corresponding geographic coordinates based on the sorting results.
[0057] As an example, a generative model can be a model for generating information. The generative model can be established based on a large language model.
[0058] It should be noted that the method provided in this embodiment can receive a user query request, wherein the user query request includes target query address information; input the target query address information into a multi-target fusion matching model to determine N first candidate geographic named entities and corresponding geographic coordinates; vectorize the target query address information to obtain a target query vector, and search and determine M candidate vectors in a second vector library based on the target query vector, wherein the second vector library corresponds to a second geographic information library, and the second geographic information library includes an address document block; obtain M candidate address document blocks from the second geographic information library based on the determined M candidate vectors; fill in the target query address information and the corresponding geographic coordinates, the first candidate geographic named entity and the corresponding geographic coordinates, and the candidate address document block. The method comprises the following steps: first, adding a preset integrated prompt information template to obtain integrated prompt information; inputting the integrated prompt information into a generation model, and using the recommended geographic named entity generated by the generation model as the geographic named entity matching the target query address information; wherein the generation model performs a generation step based on the integrated prompt information, outputting the recommended geographic named entity and the corresponding geographic coordinates; wherein the generation step performed by the generation model includes: extracting a second candidate geographic named entity from the candidate address document block; calculating the geographic distance between the first candidate geographic named entity and the second candidate geographic named entity and the target query address information; ranking the first candidate geographic named entity and the second candidate geographic named entity based on the geographic distance; and outputting T geographic named entities and their corresponding geographic coordinates based on the ranking result. Thus, a new address recommendation method combining spatial semantics and retrieval-augmented generation is provided. By introducing an advanced large language model (LLM) and RAG (retrieval-augmented generation) framework, the method improves the understanding of geographic named entities and performs address recommendation tasks, without extracting geographic text content or accessing historical user behavior data. Furthermore, the method can address the problems of existing geographic named entity matching models, such as high resource consumption, limited semantic understanding capabilities, and difficulty in updating and maintaining.
[0059] In some scenarios, a geographic named entity recommendation model based on spatial semantic information fusion can be constructed. In this model, we innovatively created a multi-objective geographic named entity matching model and used the trained model in the address recommendation task. Secondly, the retrieval enhancement method is combined with the constructed model to optimize the geographic named entity recommendation process. Specifically, a new external address database (i.e., the second geographic information database) is added, and the vector database of the external address data set (i.e., the second vector database) is obtained after vectorization of the model. The matching external address information set (i.e., M candidate address information blocks) is retrieved, and then the model matching address (i.e., the first candidate geographic entity) is combined with the matching external address information to enhance the method. In this study, the thinking chain method is used for enhancement, and finally the input is input into a large language model (such as GPT-4) to output the recommended final address.
[0060] In some scenarios, the address recommendation process generated by retrieval enhancement is divided into three stages, such as Figure 2 shown. Figure 2 In the example, the external address database can be understood as the second geographic information database in this application. The vector stored in the vector database can be understood as the second vector database. GNEMM can be understood as a multi-target fusion matching model. The multi-target fusion matching model can output 2 addresses (i.e., the first candidate geographic named entity). Step 1 (retireval) retrieves from the vector database, which can be understood as retrieving the address information from the second vector database, i.e. Figure 2 The second step can be an enhancement step, combining the prompt and the output of GNEMM with the retrieved address information block and the overall prompt template to obtain the overall prompt information. The integrated prompt information is input into the generation model to generate the final recommended address (Finalrec).
[0061] The first phase, retrieval, aims to extract the most relevant address data from a large dataset. Initially, an external knowledge base is selected and vectorized to create a comprehensive and structured geographic information repository. This database is specifically built for the detailed requirements of the spatial-semantic matching task in this study. This knowledge base includes fields such as address, name, administrative region, and coordinates, specifically designed to provide structured geographic information to support deep matching tasks. Each address and its related information is vectorized into a document chunk. An index (such as the Faiss index) is used to link metadata to the vector chunk, and the external vector chunk is generated using OpenAI's embedding method. This setup not only allows for efficient retrieval of relevant information but also enables the integration of real-time geographic data, enhancing the model's ability to cope with challenges posed by non-standardized data. Upon user query, the input is vectorized in the same manner and searched against the vector chunk to return the most matching addresses and related information. As an example, the retrieval phase is configured to return the three address document chunks that are closest to the query address.
[0062] In some scenarios, the second phase is an enhancement phase aimed at integrating the retrieved information. The prompts in this invention are fine-tuned and employ a chain-of-thought enhancement strategy. Unlike traditional simple retrieval enhancement, our approach innovatively combines the geo-named entities matched by the multi-objective fusion matching model with additional geo-named entity information obtained during the retrieval phase. This strategic integration leverages insights into logical sequences similar to expert analysis to enhance the model's decision-making process. The adopted chain-of-thought strategy enables large models to optimize their responses by simulating the human problem-solving process. Specifically, the retrieval enhancement generation process not only answers the direct query but also generates explanations for its answers in intermediate steps, similar to the logical sequences considered by humans when solving problems. Compared to direct retrieval or simple prompting, this approach provides deeper semantic understanding, enabling the model to generate more accurate and reasonable predictions. Furthermore, while other prompting strategies were considered, the chain-of-thought approach was found to be particularly effective in leveraging the extensive information from an external knowledge base for complex tasks involving geo-named entities. This step mainly combines the first five matching geographic named entities of the multi-target fusion matching model with the three related geographic named entity information in the retrieval stage, and constructs complete prompt content in the form of a thinking chain as the input of the final generation stage.
[0063] As an example, the preset integrated prompt information targets are as follows:
[0064] Task Description: Recommend the three most relevant geographic named entities to a given query from a list of candidate geographic named entities based on their proximity and relevance to the query;
[0065] The user queries the place name entity: (query), and the longitude and latitude of the queried place name entity is: (query_lat_lon1);
[0066] The top 5 matching geographic named entities and their latitude and longitude provided by the multi-objective fusion matching model: ([GNEMM_lat_lon1]), and related information retrieved from the external address database using the RAG (retrieval-augmented generation) method: (content);
[0067] Please follow the steps below for a step-by-step analysis:
[0068] Step 1: Extract geographic named entity content related to the query address from the RAG output;
[0069] Step 2: Analyze the user query and identify key geographic or significant terms of the query geographic named entity;
[0070] Step 3: Filter out geographical named entities containing the identified keywords from the first five geographical named entities provided by the model and the geographical named entities extracted from the RAG content;
[0071] Step 4, using the latitude and longitude coordinates of each geographic named entity, calculate the geographic distance between them and the query geographic named entity;
[0072] Step 5: sort the filtered geographic named entities according to their proximity to the query geographic named entity and their matching degree with the identified keywords;
[0073] Step 6: Based on the ranking in the previous step, select the top three geographic named entities as recommendations;
[0074] Step 7: If the query geographic named entity appears in the candidate address list, ensure that it is included in the top three recommended geographic named entities;
[0075] In step 8, three recommended geographic named entities and their geographic coordinates are output as the final output.
[0076] In some scenarios, the third stage is the generation stage, in which we use current large-scale language models such as GPT-4-Turbo, GLM-3, and Claude3 to perform the generation task. The input is the integrated prompt content obtained in the enhancement stage. Given the strong semantic understanding ability of the generation model, we chose it as the generation model for the final geographic named entity recommendation task. This approach enables the model to utilize spatial and semantic information, reflecting an integration strategy aimed at maximizing recommendation accuracy and relevance. It is worth mentioning that the purpose of using LLM in this study is to explore its ability to conveniently understand geographic information in the presence of an external knowledge base, which is different from traditional geocoding.
[0077] In some embodiments, the geographic information library includes a structured address document block, which includes multiple items including an address, a name, an administrative region, and geographic coordinates. The address document block in the geographic information library is linked to the second vector in the second vector library based on an index library.
[0078] In some embodiments, the geographic information repository links metadata of the address document block with the second vector repository using an index repository.
[0079] Thus, the address document block in the geographic information database can be linked to the second vector in the second vector database based on the index in the index database. Based on the second vector, the corresponding address document block can be quickly found, thereby improving the speed of determining the second candidate geographic named entity based on the address document block.
[0080] In some embodiments, the above-mentioned vectorization method for vectorizing the target query address information is the same as the vectorization method for vectorizing the second geographic information database to obtain the second vector database.
[0081] As an example, the embedding method of OpenAI is used to convert the addresses in the geographic information library to generate a second vector library; and the embedding method of OpenAI is used to vectorize the target query address information.
[0082] In some embodiments, the generating step further includes: identifying key geographic elements from the target query address information; and determining a candidate geographic named entity containing the key geographic elements from the first candidate geographic named entity and the second candidate geographic named entity.
[0083] In some embodiments, the sorting of the first candidate geographic named entity and the second candidate geographic named entity based on geographic distance includes sorting the candidate geographic named entities containing the key geographic elements based on the geographic distance from the target query address information and the degree of matching with the key geographic elements.
[0084] Therefore, the candidate geographic named entities are sorted according to the matching degree of key geographic elements, which improves the richness of the sorting basis and the accuracy of the sorting results.
[0085] In some embodiments, the ranking of the first candidate geographic named entity or the second candidate geographic named entity based on geographic distance includes: in response to the first candidate geographic named entity or the second candidate geographic named entity including the target query address information, determining the candidate geographic named entity including the target query address information as a recommended geographic named entity.
[0086] If the first candidate geographic named entity or the second candidate geographic named entity includes the target query address information, the candidate geographic named entity including the target query address information may be placed in a ranking position that is guaranteed to be output.
[0087] As an example, if it is expected to output 3 recommended geographic named entities that match the target query address information, then the candidate geographic named entity including the target query address information can be placed in the top 3 in the ranking to ensure that the candidate geographic named entity containing the target query address information can be output as a recommended geographic named entity.
[0088] In this way, it can be ensured that the candidate geographic named entities directly hit by the target query address information can be output as recommended geographic named entities, thereby improving the accuracy of the output geographic named entities.
[0089] In some embodiments, the step of determining the first candidate geographic named entity includes: obtaining target query address information; inputting the target query address information into a multi-target fusion matching model based on spatial semantics, wherein the multi-target fusion matching model is used to generate a similarity score between the target query address information and the candidate address information, and the candidate address information is the address information in the first geographic information database; and determining the first candidate geographic named entity based on the similarity score.
[0090] It should be noted that in some related technologies, address matching methods are mostly single-task, and the spatial and semantic characteristics of geographic named entities are ignored in the address matching and recommendation process. Secondly, the retrieval and generation process of geographic named entities usually relies on a lot of computing resources and complex algorithms, especially when processing large-scale data sets. This makes the operation of the system require high computing costs, limiting its application in resource-constrained environments. For example, the semantic diversity and contextual uncertainty of geographic named entities make it difficult to accurately identify and generate specific information. These methods usually rely on a large amount of labeled data. In the case of insufficient or low-quality data, the performance of the model may drop significantly, which limits their effectiveness in data-scarce areas. In addition, the model needs to be updated regularly to reflect the latest geographic information and changes in language usage. However, maintaining and updating these models can be very time-consuming and costly, especially in rapidly changing fields such as geographic information systems.
[0091] In contrast, one or more embodiments of the present disclosure demonstrate a method for recommending geographic named entities based on the integration of spatial semantic information. The method involves first obtaining the geographic named entities to be recommended (i.e., an optional form of target query address information); then, inputting these geographic named entities into a multi-objective fusion matching model, which generates a series of similarity scores based on spatial semantic information. These scores are then sorted by similarity, and corresponding known geographic named entities are recommended accordingly.
[0092] Optionally, the encoder performs splitting, encoding, semantic feature extraction, rectification, and residual similarity calculation on geographic named entities to generate multiple similarity scores. This process does not require extracting geographic text content or accessing historical user behavior data.
[0093] It should be noted that by introducing the advanced large language model (LLM) and RAG (retrieval-augmented generation) framework, we can improve the understanding of geographic named entities and perform address recommendation tasks; it can solve the problems of existing geographic named entity matching models in terms of high resource consumption, limited semantic understanding capabilities, and difficulty in updating and maintenance.
[0094] In some embodiments, the multi-target fusion matching model includes an encoder; wherein the encoder is used to generate an address vector for geographic information of a first geographic information library; and the encoder generates a corresponding address vector in response to receiving target query address information.
[0095] Based on an example of a multi-objective fusion matching model that considers the spatial-semantic information of geographic named entities, we recommend geographic named entities. We designed a spatial-semantic similarity-based geographic named entity recommendation task based on the spatial-semantic similarity between geographic named entities. The process is as follows:
[0096] In the first step, the GNE corpus is used as the standard corpus for querying (i.e., the first geographic information database). A fine-tuned multi-objective fusion matching model that considers the spatial and semantic information of GNEs is then used to encode the GNE text in the corpus, generating corresponding vector representations. The same model is used to obtain the vector representation of the input GNE query text (i.e., the target query address information).
[0097] In the second step, the similarity scores between the geo-named entity texts are determined by calculating the cosine similarity between the vector representation of the query geo-named entity text and the vector representation of each geo-named entity text in the corpus.
[0098] Step 3: Sort the multiple similarity scores from high to low, and recommend multiple known geographical named entities corresponding to the top similarity scores.
[0099] Where K is an optional parameter. The formula for calculating the geographic named entity text similarity score based on cosine similarity is as follows:
[0100] In the above formula, represents the dot product of the vector representation of the query geographic named entity text and the vector representation of the geographic named entity text in the corpus, and and The similarity score ranges from [0, 1]. The closer the value is to 1, the more similar the two geographic named entities are, and the closer the value is to 0, the less similar they are.
[0101] Therefore, through a standard corpus, the user inputs a geographical named entity and obtains K recommended similar geographical named entities.
[0102] In some embodiments, the training process of the encoder includes: setting a plurality of decoders corresponding to the encoder; and adjusting parameters of the encoder according to outputs of the plurality of decoders.
[0103] In some embodiments, the multiple decoders include at least two of the following: a geographic named entity feature segmentation decoder, which is used to predict the boundaries of geographic named entity features; a geographic named entity matching decoder, which is used to predict whether the input geographic named entity pair matches; and a geographic named entity spatial similarity score decoder that achieves the prediction of spatial similarity scores by adding a regression score predictor.
[0104] An instance of the geographic named entity semantic model serves as the underlying network structure for the geographic named entity spatial-semantic fusion task, acting as the encoder for this task. Drawing on the hard parameter sharing approach used in multi-task learning, three submodules are designed for the three subtasks of geographic named entity feature segmentation, geographic named entity matching, and geographic named entity spatial similarity score, which together form the model's "decoder." The geographic named entity feature segmentation subtask can be considered a text sequence annotation task during training. Specifically, each character in the geographic named entity text sequence is annotated to predict the boundaries of the geographic named entity features. The geographic named entity matching subtask can be considered a binary classification task during training. A binary classifier is added to predict whether the input geographic named entity pair matches. The geographic named entity spatial similarity score prediction subtask can be considered a regression task that predicts a score between 0 and 5. A regression score predictor is added to achieve spatial similarity score prediction. This results in a multi-target matching model for geographic named entities that takes into account spatial semantic fusion information.
[0105] In some embodiments, the evaluation index of the multi-objective fusion matching model training process includes a distance mean error, wherein the distance mean error is calculated by:
[0106] ;
[0107] In this formula, It is an optional parameter, indicating that the model output Recommended results; Indicates the spatial closest match between the input query geographic named entity and the geographic named entity corpus. The spatial distance between geographic named entities; It means that the input query geographic named entity ranks first among the recommended results output by the model. The spatial distance between geographic named entities.
[0108] Optionally, the above spatial distance adopts:
[0109] Formula for calculation.
[0110] As you can understand, during model training, the model's results from processing training samples can be compared with the training sample labels, and the difference can be calculated based on the loss function; this difference can be used to adjust model parameters. Loss functions are a key tool in machine learning and deep learning for quantifying the difference between model predictions and actual results.
[0111] Here, the distance mean error calculation method can be used as the loss function.
[0112] Therefore, the model parameters can be adjusted based on the distance mean error. The prediction results of the trained model perform well in terms of spatial distance, and geographic named entities can be recommended based on spatial semantics.
[0113] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present invention. The terminal devices in the embodiments of the present invention may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0114] like Figure 3 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a storage device 308 into a random access memory (RAM) 303. RAM 303 also stores various programs and data required for the operation of electronic device 300. Processing device 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.
[0115] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0116] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present invention are performed.
[0117] It should be noted that the computer-readable medium described above in the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.
[0118] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or later developed network.
[0119] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0120] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0121] The flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The units involved in the embodiments of the present invention may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0123] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0124] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0125] The above description is merely an illustration of preferred embodiments of the present invention and the underlying technical principles. Those skilled in the art should understand that the scope of the present invention is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned concepts. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this invention.
[0126] In addition, although adopting specific order to describe each operation, this should not be interpreted as requiring these operations to be executed in the specific order shown or in sequential order.Under certain environment, multitasking and parallel processing may be advantageous.Similarly, although comprising some specific implementation details in the above discussion, these should not be interpreted as limiting the scope of the present invention.Some features described in the context of independent embodiment can also be implemented in single embodiment in combination.On the contrary, the various features described in the context of independent embodiment also can be implemented in multiple embodiments individually or in the mode of any suitable subcombination.
[0127] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. An address recommendation method combining spatial semantics and retrieval enhancement generation, characterized in that: include: receiving a user query request, wherein the user query request includes target query address information; Input the target query address information into the multi-target fusion matching model to determine N first candidate geographic named entities and corresponding geographic coordinates; Vectorizing the target query address information to obtain a target query vector, and searching and determining M candidate vectors in a second vector library based on the target query vector, wherein the second vector library corresponds to a second geographic information library, and the second geographic information library includes address document blocks; Obtaining M candidate address document blocks from the second geographic information database according to the determined M candidate vectors; Filling the target query address information and the corresponding geographic coordinates, the first candidate geographic named entity and the corresponding geographic coordinates, and the candidate address document block into a preset integrated prompt information template to obtain integrated prompt information; Inputting the integrated prompt information into the generation model, and using the recommended geographic named entity generated by the generation model as the geographic named entity matching the target query address information; The generation model performs a generation step based on the integrated prompt information to output a recommended geographic named entity and a corresponding geographic coordinate; The generation steps performed by the generative model include: extracting a second candidate geographic named entity from the candidate address document block; For the first candidate geographic named entity and the second candidate geographic named entity, calculating the geographic distance between them and the target query address information; sorting the first candidate geographic named entity and the second candidate geographic named entity based on geographic distance; According to the sorting results, output T geographic named entities and corresponding geographic coordinates; The step of determining the first candidate geographic named entity includes: Obtain target query address information; Inputting the target query address information into a multi-objective fusion matching model based on spatial semantics, wherein the multi-objective fusion matching model is used to generate a similarity score between the target query address information and candidate address information, where the candidate address information is address information in the first geographic information database; and determining a first candidate geographic named entity based on the similarity score; The multi-objective fusion matching model includes an encoder; The encoder is used to generate an address vector for the address information of the first geographic information database; the encoder generates a corresponding address vector in response to receiving the target query address information; The encoder training process includes: Set up multiple decoders corresponding to the encoder; adjusting parameters of the encoder according to outputs of the plurality of decoders; The plurality of decoders include at least two of the following: Geographic Named Entity Feature Segmentation Decoder, used to predict the boundaries of geographic named entity features; Geographic Named Entity Matching Decoder, used to predict whether the input geographic named entity pair matches; The geographic named entity spatial similarity score decoder achieves the prediction of spatial similarity scores by adding a regression score predictor.
2. The method according to claim 1, characterized in that The second geographic information base includes a structured address document block, wherein the address document block includes one or more of the following: an address, a name, an administrative area, and geographic coordinates; The address document block in the geographic information library and the second vector in the second vector library are linked based on the index library.
3. The method according to claim 1, characterized in that The vectorization method for vectorizing the target query address information is the same as the vectorization method for vectorizing the second geographic information database to obtain the second vector database.
4. The method according to claim 1, wherein The generating step further includes: identifying key geographic elements from the target query address information; Determining a candidate geographic named entity containing the key geographic element from the first candidate geographic named entity and the second candidate geographic named entity; and The ranking of the first candidate geographic named entity and the second candidate geographic named entity based on the geographic distance includes: The candidate geographic named entities containing the key geographic elements are sorted according to their geographic distances from the target query address information and their matching degrees with the key geographic elements.
5. The method according to claim 1, wherein The ranking of the first candidate geographic named entity and the second candidate geographic named entity based on the geographic distance includes: In response to the first candidate geographic named entity or the second candidate geographic named entity including the target query address information, the candidate geographic named entity including the target query address information is used as a recommended geographic named entity.
6. The method according to claim 1, characterized in that The evaluation index of the multi-objective fusion matching model training process includes the distance mean error, wherein the distance mean error is calculated in the following way: In this formula, K is an optional parameter, indicating that the model outputs the top K recommendation results; Represents the spatial distance between the input query geographic named entity and the spatially closest i-th geographic named entity in the geographic named entity corpus; It represents the spatial distance between the input query geographic named entity and the i-ranked geographic named entity in the recommended results output by the model.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Address information parsing method and apparatus, system and data acquisition method
CA3145918A1
Identifying at Least One Geospatial Location in Accordance with User Input
US20250165547A1