Geographic named entity matching method and electronic device integrating spatial semantics
Through the multi-objective fusion matching model, combined with the feature extraction of the multi-head self-attention layer and the residual connection layer, the problems of high resource consumption and limited semantic understanding ability of the geographic named entity matching model are solved, and efficient address matching and recommendation are achieved, which is suitable for resource-constrained environments.
Patent Information
- Application Number
- CN202511010440.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing geographic named entity matching models consume a lot of resources, have limited semantic understanding capabilities, are difficult to update and maintain, and are restricted in application in resource-constrained environments. The semantic diversity and contextual uncertainty of geographic named entities make it difficult to accurately identify and generate specific information.
A multi-target fusion matching model is adopted, including an encoder and a similarity calculation module. Through the segmentation, matching and spatial similarity score prediction of geographic named entity elements, the vector of the target query address is generated, which solves the spatial-semantic fusion matching model of the existing geographic named entity. The multi-head self-attention layer, residual connection layer and fully connected feedforward neural network are used for feature extraction, and the confusion word correction decoder is combined for training.
It improves the efficiency and accuracy of geographic named entity matching, solves unresolved problems in the existing technology, and achieves effectiveness in solving technical problems in applications with high resource consumption and limited semantic understanding capabilities. It achieves effectiveness in solving technical problems, and achieves unresolved problems in applications with low resource consumption. It solves unresolved technical problems in the existing technology in applications in resource-constrained environments, and provides efficient address matching and recommendation.
Smart Images

Figure CN120524953B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to the field of spatial positioning data analysis and application technology, and specifically to a geographic named entity matching method and electronic device integrating spatial semantics. 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] The methods used by computer systems to implement address matching still have various problems. For example, content-based recommendation methods require reasonable representation and extraction of the content of geographic texts; collaborative filtering-based recommendation methods need to query users' historical behavior data after calculating the similarity of geographic texts; deep learning-based recommendation methods require massive amounts of data for advance learning before they can be used, and their operation requires high computing costs, which limits 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. 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 a geographic named entity matching method that integrates spatial semantics, the method comprising: obtaining target query address information; inputting the target query address information into a multi-target fusion matching model based on spatial semantics, and obtaining a similarity score output by the multi-target fusion matching model, wherein the multi-target fusion matching model is used to generate a similarity score between the target query address information and candidate address information, the candidate address information being address information in a first geographic information database; determining a geographic named entity that matches the target query address based on the similarity score; wherein the multi-target fusion matching model comprises an encoder and a similarity calculation module; the encoder receives the target query address information and outputs a target address vector; the similarity score is used to generate a similarity score between the target query address information and the candidate address information, and the candidate address information is address information in a first geographic information database; and the geographic named entity that matches the target query address is determined based on the similarity score. The calculation module calculates the similarity between the target address vector and the candidate address vector, wherein the candidate address vector is obtained by extracting the address features in the first geographic information database by the encoder; wherein the training process of the encoder includes: setting multiple decoders corresponding to the encoding network; adjusting the parameters of the encoding network based on the outputs of the multiple decoders to obtain the encoder; wherein the multiple decoders include at least two of the following: a geographic named entity feature segmentation decoder for predicting the boundaries of geographic named entity features; a geographic named entity matching decoder for predicting whether the input geographic named entity pair matches; a geographic named entity spatial similarity score decoder for realizing the prediction of spatial similarity scores by adding a regression score predictor.
[0006] Optionally, the encoder includes multiple sequentially connected geographic named entity converter modules; the geographic named entity converter module includes a multi-head self-attention layer, a residual connection layer, a normalization layer and a fully connected feedforward neural network connected in sequence.
[0007] Optionally, the method is further used to: segment the target query address information and determine the hierarchical symbols for segmenting geographic named entity elements; and generate an encoder input vector corresponding to the target query address information based on the target query address information and the hierarchical symbols.
[0008] Optionally, the encoder includes a character vector generation module, wherein the character vector generation module is used to: receive an encoder input vector, and generate a word embedding vector for the characters in the encoder input vector; obtain the position information of the characters in the target query address information; calculate the position weight of the characters; and obtain a character vector for the characters based on the word embedding vector and the position weight of the characters, wherein the character vector is used to be input into the multiple sequentially connected geographic named entity converter modules.
[0009] Optionally, the method further includes: using the encoder to extract address features from the address information in the first geographic information database to obtain a corresponding address vector.
[0010] Optionally, the training process of the encoder includes: setting a confusion correction decoder corresponding to the encoding network; masking the complete geographic named entity elements in the training samples; using the encoding network to process the masked training samples to obtain the semantic extraction vector output by the encoding network; inputting the output semantic extraction vector into the confusion correction decoder to obtain a corrected text vector; adjusting the parameters of the encoding network according to the corrected text vector output by the confusion correction decoder and the training samples input to the encoding network.
[0011] Optionally, the confusion correction encoder includes a LeakyReLU activation function layer, a fully connected layer and a softmax function layer connected in sequence.
[0012] Optionally, masking the complete geographic named entity elements in the training samples includes: using easily confused words corresponding to the geographic named entity elements to mask the geographic named entity elements in the training samples; wherein the easily confused words include homophones and / or synonyms.
[0013] Optionally, the evaluation index of the multi-objective fusion matching model training process includes a distance mean error, wherein the distance mean error is calculated in the following manner:
[0014] ;
[0015] Where, It is an optional parameter, indicating that the model output Recommended results; Indicates that the input target query address information is the closest in space to the first geographic information database. The spatial distance between geographic named entities; It means that the input target query address information 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 geographic named entity matching method integrating spatial semantics as described in the first aspect.
[0017] The geographic named entity matching method and electronic device that integrate spatial semantics provided by the embodiments of the present invention can obtain target query address information, input the target query address information into a multi-target fusion matching model based on spatial semantics, and obtain a similarity score output by the multi-target fusion matching model, 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; according to the similarity score, the geographic named entity that matches the target query address is determined; wherein the multi-target fusion matching model includes an encoder and a similarity calculation module; the encoder receives the target query address information and outputs a target address vector; the similarity score ...; the candidate address information is the address information in the first geographic information database; the geographic named entity that matches the target query address is determined; The calculation module calculates the similarity between the target address vector and the candidate address vector, wherein the candidate address vector is obtained by extracting the address features in the first geographic information database by the encoder; wherein the training process of the encoder includes: setting multiple decoders corresponding to the encoding network; adjusting the parameters of the encoding network based on the outputs of the multiple decoders to obtain the encoder; wherein the multiple decoders include at least two of the following: a geographic named entity feature segmentation decoder for predicting the boundaries of geographic named entity features; a geographic named entity matching decoder for predicting whether the input geographic named entity pair matches; a geographic named entity spatial similarity score decoder for realizing the prediction of spatial similarity scores by adding a regression score predictor.
[0018] Thus, these multiple subtasks (geographic named entity element segmentation, geo-named entity matching, and geo-named entity spatial similarity score prediction) are jointly used to train a single, powerful multi-objective fusion matching model that considers the spatial and semantic information of geo-named entities (Multi-Objective Fusion Matching Model for Spatial Semantic Information of Geo-Named Entities). The training process, involving at least two of these three tasks, creates an efficient encoder that learns to generate rich vector representations of geo-named entities. This vector encapsulates the spatial and semantic features learned from all three tasks. This trained encoder is used to generate vectors for each entity (i.e., address information) in the user's query and the standard corpus (i.e., the first geographic information database). Then, by calculating the similarity between the target address vector and the corpus vectors (i.e., candidate address vectors), geo-named entities that match the target query address information are recommended. This 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
[0019] 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.
[0020] Figure 1 is a flowchart of an embodiment of a geographic named entity matching method integrating spatial semantics according to the present invention;
[0021] Figure 2 is a schematic diagram of the training process of the encoder in the multi-objective fusion matching model according to the present invention;
[0022] Figure 3 is a schematic diagram of an encoder in a multi-objective fusion matching model according to the present invention;
[0023] Figure 4 FIG. 1 is a schematic diagram of the basic structure of an electronic device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] 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.
[0025] 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.
[0026] Please refer to Figure 1 , which shows the process of an embodiment of the geographic named entity matching method integrating spatial semantics according to the present invention. Figure 1 The geographic named entity matching method integrating spatial semantics includes the following steps:
[0027] Step 101: Obtain target query address information.
[0028] Step 102: input the target query address information into a multi-target fusion matching model based on spatial semantics to obtain a similarity score output by the multi-target fusion matching model.
[0029] Step 103: Determine the geographic named entity that matches the target query address based on the similarity score.
[0030] In this embodiment, the multi-target fusion matching model is used to generate a similarity score between the target query address information and the candidate address information, where the candidate address information is the address information in the first geographic information database.
[0031] In this embodiment, the multi-target fusion matching model includes an encoder and a similarity calculation module; the encoder receives target query address information and outputs a target address vector; the similarity calculation module calculates the similarity between the target address vector and the candidate address vector, wherein the candidate address vector is obtained by the encoder extracting address features from the first geographic information database.
[0032] In some embodiments, the method further includes: using the encoder to extract address features from the address information in the first geographic information database to obtain a corresponding address vector.
[0033] The address information in the first geographic information database may be encoded in advance using an encoder.
[0034] In this embodiment, the training process of the encoder includes: setting a plurality of decoders corresponding to the encoding network; and adjusting the parameters of the encoding network based on the outputs of the plurality of decoders to obtain the encoder.
[0035] The encoding network can be understood as an untrained encoder. For example, Figure 3 shown.
[0036] In this embodiment, 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 realizes the prediction of spatial similarity scores by adding a regression score predictor.
[0037] 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. Referring to the hard parameter sharing method 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 predict the spatial similarity score. This results in a multi-target matching model for geographic named entities that takes into account spatial semantic fusion information.
[0038] In this embodiment, the target query address information may be information in the user query request or the address information to be queried input by the user.
[0039] Optionally, the address information may contain geographic named entities.
[0040] 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.
[0041] 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.
[0042] In this embodiment, the target query address information may be input into a multi-target fusion matching model. The multi-target fusion matching model is established based on a multi-target task and may be used to generate a similarity score for the input target query address information.
[0043] Optionally, the multi-objective fusion matching model can be trained based on geographic data in the first geographic information database.
[0044] Optionally, the multi-objective fusion matching model can output N similarity scores with higher similarity values based on the similarity values. The specific value of N can be set according to the actual application scenario and is not limited here. As an example, the value of N can be 5.
[0045] It should be noted that the method provided in this embodiment can obtain the target query address information, input the target query address information into the multi-target fusion matching model based on spatial semantics, and obtain the similarity score output by the multi-target fusion matching model, 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; according to the similarity score, the geographic named entity matching the target query address is determined; wherein, the multi-target fusion matching model includes an encoder and a similarity calculation module; the encoder receives the target query address information and outputs a target address vector; the similarity calculation module calculates the target The similarity between an address vector and a candidate address vector, wherein the candidate address vector is obtained by extracting address features from a first geographic information database by the encoder; wherein the training process of the encoder includes: setting multiple decoders corresponding to the encoding network; adjusting the parameters of the encoding network based on the outputs of the multiple decoders to obtain the encoder; wherein the multiple decoders include at least two of the following: a geographic named entity feature segmentation decoder for predicting the boundaries of geographic named entity features; a geographic named entity matching decoder for predicting whether an input geographic named entity pair matches; and a geographic named entity spatial similarity score decoder for realizing the prediction of spatial similarity scores by adding a regression score predictor.
[0046] Thus, these multiple subtasks (geographic named entity element segmentation, geographic named entity matching and geographic named entity spatial similarity score prediction, e.g. Figure 2 As shown in the figure, they are jointly used to train a single, powerful multi-objective fusion matching model that takes into account the spatial-semantic information of geographic named entities (a multi-objective fusion matching model for the spatial semantic information of geographic named entities). The training process involves at least two of these three tasks, and an efficient encoder is created to learn to generate rich vector representations of geographic named entities. This vector encapsulates the spatial and semantic features learned from all three tasks. This trained encoder is used to generate vectors for the user's query and each entity (i.e., address information) in the standard corpus (i.e., the first geographic information database). Then, by calculating the similarity between the target address vector and the corpus vector (i.e., the candidate address vector), geographic named entities that match the target query address information are recommended, which solves 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] As an example, we used a multi-objective fusion matching model that considers the spatial-semantic information of geographic named entities as a basis for geographic named entity recommendation. Based on the spatial-semantic similarity between geographic named entities, we designed a spatial-semantic geographic named entity recommendation task. The process is as follows:
[0051] In the first step, the first geographic information database serves as the standard corpus for querying (i.e., the first geographic information database). Then, a fine-tuned multi-objective fusion matching model that considers the spatial and semantic information of geographic named entities is used to encode the geographic named entity text in the corpus, obtaining its corresponding vector representation. The same model is used to obtain the vector representation of the input target query address information text (i.e., the target query address information).
[0052] The second step is to determine the similarity score between the geographic named entity texts by calculating the cosine similarity between the vector representation of the target query address information text and the vector representation of each geographic named entity text in the corpus.
[0053] Step 3: Sort the multiple similarity scores from high to low, and recommend multiple known geographical named entities corresponding to the top similarity scores.
[0054] Where K is an optional parameter. The formula for calculating the geographic named entity text similarity score based on cosine similarity is as follows:
[0055] In the above formula, It represents the dot product of the vector representation of the target query address information 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.
[0056] Therefore, through a standard corpus, the user inputs a geographic named entity and obtains K recommended similar geographic named entities.
[0057] In some embodiments, the encoder includes multiple sequentially connected geographic named entity converter modules; the geographic named entity converter module includes a multi-head self-attention layer, a residual connection layer, a normalization layer and a fully connected feedforward neural network connected in sequence.
[0058] Here, parts of the multi-head attention mechanism are integrated into a module, and this module is stacked layer by layer to build a model architecture with sufficient depth to perform semantic extraction of geographic named entities.
[0059] In addition, the residual network is introduced to solve the gradient vanishing problem. The output of each layer of the module is normalized to alleviate the impact of gradient vanishing. At the same time, it can make the training process more stable and help the model converge faster. The residual network consists of several residual units. In the module containing multi-head self-attention, the first Taking the output of the multi-head attention layer of the layer as an example, a single residual unit can be expressed as:
[0060] ;
[0061] In this formula, and Respectively represent Layer and The output of the layer, Represents the processing function of multi-head self-attention. The residual network in this method superimposes the information of the previous layer after the output of each multi-head self-attention layer, fusing the self-attention semantics with the text representation information.
[0062] Furthermore, a normalization layer is introduced to address the internal covariate shift problem in deep neural networks. Layer Normalization (LN) is applied to the output of each layer of the model stack. Layer Normalization normalizes all neurons in a network layer to maintain a stable input distribution. This helps mitigate the effects of vanishing gradients and makes model training more stable and converges faster.
[0063] Furthermore, this method adds a fully connected feedforward neural network after the output of the self-attention layer and uses LeakyReLU as the activation function, transforming the output of the self-attention layer and adding nonlinearity. LeakyReLU is a variant of ReLU. The full name of the ReLU activation function is Rectified Linear Unit (ReLU), which is mathematically defined as:
[0064] ReLU alleviates the vanishing gradient problem that can occur in deep neural networks by providing a large, constant gradient for positive inputs. However, when the input value is negative, the output of ReLU is always 0, and its first-order derivative is also always 0, which causes the neuron to no longer update its parameters, that is, the problem of dead neurons will occur. LeakyReLU is a variant of ReLU that prevents dead neurons and improves the learning ability of neural networks by allowing negative inputs to have a small non-zero gradient.
[0065] This results in a semantic feature extraction module based on a multi-head self-attention mechanism. This module is stacked layer by layer and incorporates residual connections, layer normalization, and a fully connected feedforward neural network design, enabling the geographic named entity semantic model to better extract semantic features. Each multi-head self-attention module in the geographic named entity semantic model is defined as a Geographical Named Entity Transformer Module.
[0066] In some embodiments, the method is further used to: segment the target query address information and determine the hierarchical symbols for segmenting geographic named entity elements; and generate an encoder input vector corresponding to the target query address information based on the target query address information and the hierarchical symbols.
[0067] As an example, the design process looks like this:
[0068] The first step is to use a word segmentation tool to segment the geographic named entity text in the first geographic information database. During the word segmentation process, multiple place name dictionaries for a specific region are loaded as custom dictionaries. This allows the word segmentation database to more accurately segment geographic named entity elements based on the place name information in the custom dictionaries, thus avoiding the excessive segmentation of geographic named entities by the original word segmentation database.
[0069] In the second step, after word segmentation, special markers are inserted between geographic named entity elements as separators. These markers are regarded as ordinary characters in the model and are also part of the input to the GeographicalNamed EntityTransformer Module.
[0070] Therefore, a character encoding strategy that takes into account the boundary information of geographical named entities is provided. This strategy does not use words as the basic input unit, but uses character-level vectorization expression and injects hierarchical information (such as [B]) by inserting special tags (such as [B]) between geographical named entity levels. Figure 3 This special marker tells the model that the previous character is the end of a geographic named entity hierarchy and the next character is the beginning of another geographic named entity hierarchy.
[0071] In some embodiments, the encoder includes a character vector generation module, wherein the character vector generation module is used to: receive an encoder input vector, and generate a word embedding vector for the characters in the encoder input vector; obtain the position information of the characters in the target query address information; calculate the position weight of the characters; and obtain a character vector for the characters based on the word embedding vector and the position weight of the characters, wherein the character vector is used to input into the multiple sequentially connected geographic named entity converter modules.
[0072] As an example, the model input includes the word embeddings for each character in the text sequence and the weights for the position order. The steps for calculating the word embeddings and position weights for the input text sequence are as follows:
[0073] (1) Obtaining the dictionary-vector conversion matrix (LookupTable) .
[0074] (2) Get the character's sequence number in the dictionary.
[0075] (3) Obtain the unique hot vector of the character according to the sequence number. The length of the vector is the size of the dictionary.
[0076] (4) Multiply the one-hot vector by the dictionary-vector conversion matrix to get the word embedding of the character:
[0077] ;
[0078] (5) Get the position of the character in the text sequence ;
[0079] (6) Calculate the position weight information of the character:
[0080] ;
[0081] ;
[0082] In this formula, d model Represents the total dimension of the word embedding vector in the model; i represents the dimension index in the word embedding vector; i%2 alternately uses the sin and cos functions by judging the parity of the dimension index, thereby generating a unique code for the vector at each position in different dimensions.
[0083] (7) Finally, the word embedding and position weight of the character are added to obtain the character representation vector of the model input:
[0084] ;
[0085] In some embodiments, the training process of the encoder includes: setting a confusion correction decoder corresponding to the encoding network; masking the complete geographic named entity elements in the training sample; using the encoding network to process the masked training sample to obtain a semantic extraction vector output by the encoding network; inputting the output semantic extraction vector into the confusion correction decoder to obtain a corrected text vector; adjusting the parameters of the encoding network according to the corrected text vector output by the confusion correction decoder and the training sample input to the encoding network.
[0086] In some embodiments, the confusion correction encoder includes a LeakyReLU activation function layer, a fully connected layer, and a softmax function layer connected in sequence.
[0087] In some embodiments, masking the complete geographic named entity elements in the training samples includes: using easily confused words corresponding to the geographic named entity elements to mask the geographic named entity elements in the training samples; wherein the easily confused words include homophones and / or synonyms.
[0088] Therefore, a module for correcting confused words can be provided, so that the model can correctly identify the input geographic named entities and automatically correct the output.
[0089] The specific content of the target task of confusing word correction is:
[0090] (1) Assumptions: A certain geographic named entity element in a geographic named entity text sequence is replaced by a confusing word, while the rest of the context is known, that is:
[0091] ;
[0092] (2) Target task: Based on the known context, predict the probability of occurrence of the word replaced by the confused word, which can be expressed as the following conditional probability expression:
[0093] ;
[0094] To simplify the expression, the words replaced by the confusing words are expressed as , which actually consists of multiple characters, and It is the characters in the context that are expressed.
[0095] (3) Input the text content into the multi-layered GeographicalNamed Entity TransformerModule to obtain the semantic feature information of the word:
[0096] ;
[0097] (4) From the multi-head attention mechanism, we can see that It expresses the influence of the full text on the word, so the conditional probability can be approximately expressed as:
[0098] ;
[0099] Based on the above conclusions, the neural network structure of the target task module for correcting confusing words based on known context is designed as follows:
[0100] (1) In order to convert the output of the semantic feature extraction module based on multi-head self-attention into the "corrected word embedding" information of each character after the context influence, and to prepare for the calculation of the probability of each character in the predicted word according to the LookupTable in the subsequent steps, it is necessary to use the output of the semantic feature extraction module as the input of the fully connected neural network layer and use the LeakyReLU activation function to implement nonlinear transformation:
[0101] ;
[0102] Where, represents the output of the semantic feature extraction module, represents the LeakyReLU activation function, and represents the weights of the fully connected neural network.
[0103] (2) Establish a fully connected layer and perform a linear transformation on the correction word embedding to obtain the probability distribution score:
[0104] ;
[0105] (3) Finally, by inputting the above results into the softmax function, the conditional probability distribution of each character in the word to be predicted as each word in the dictionary is obtained:
[0106] ;
[0107] The above is the goal of confusing word correction. To enable the model to achieve this goal of correcting confusing words based on known context, a full-word dynamic masking strategy based on confusing word replacement is designed based on the characteristics of geographic named entity text data. This method designs the following masking strategy:
[0108] (1) Dynamic masking strategy: To avoid the model using the same masking strategy in each round of training, this method copies the training dataset N times, so that each input text sequence is masked in N different ways during the training process. Therefore, during the entire training process, for each input text sequence, the number of times the same mask is used is:
[0109] ;
[0110] in, is the number of training rounds.
[0111] (2) Whole-word masking: This method adopts the whole-word masking strategy, that is, if the characters to be masked belong to a complete geographic named entity element, the entire geographic named entity element will be masked.
[0112] (3) Masking strategy based on confusion word replacement: This method uses confusion words to replace the [MASK] tag, which solves the problem of inconsistency between pre-training and fine-tuning caused by the use of the [MASK] tag masking strategy.
[0113] In pre-training, synonyms and homophones are used as confusion words. A Chinese synonym generation tool library synonyms based on word2vec is used for similarity calculation, and a data enhancement toolkit JioNLP is used to generate homophones.
[0114] Taking into account both accuracy and efficiency of model training, we masked 15% of the words in the input text. Of these 15% of masked words, 40% were replaced with synonyms, 40% with homophones, and 10% with random words. The remaining 10% remained unchanged.
[0115] In summary, this section constructs a target task module for correcting confusing words based on known context, which is placed immediately after the semantic feature extraction module. Specifically, given a word, this method uses the semantic representation output by stacking multiple layers of GeographicalNamedEntity Transformer Modules to perform confusing word correction.
[0116] 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:
[0117] ;
[0118] In this formula, It is an optional parameter, indicating that the model output Recommended results; Indicates that the input target query address information is the closest in space to the first geographic information database. The spatial distance between geographic named entities; It means that the input target query address information ranks first among the recommended results output by the model. The spatial distance between geographic named entities.
[0119] Optionally, the above spatial distance is adopted
[0120] Formula for calculation.
[0121] 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.
[0122] Here, the distance mean error calculation method can be used as the loss function.
[0123] 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.
[0124] It should be noted that the present invention also verifies and pre-trains the multi-target fusion model. The process is as follows:
[0125] 1. A total of 3,530,611 geographic named entity text data located in a certain area in 2022, which have been cleaned and preprocessed, are used as the first geographic information database experimental object to construct a geographic named entity semantic model instance.
[0126] Second, in terms of experimental design, we first considered two influencing factors: whether to use a character encoding strategy that respects the hierarchical boundaries of geographic named entities (GNEs) and whether to use a full-word dynamic masking strategy based on confusion word replacement. We then conducted ablation experiments to examine these factors. Furthermore, existing methods for semantic models of place names and addresses analyzed the impact of the number of semantic feature extraction modules and the use of special symbols to replace Arabic numerals in text on model performance, and concluded that these two hyperparameters are crucial in building pre-trained models for geographic text. Geographical named entity text data encompasses a wider range of data than place name and address data. To verify the effectiveness of the strategies used in previous methods, we experimentally tested two hyperparameters: the number of semantic feature extraction modules (Geographical Named Entity Transformer Module) and whether to replace Arabic numerals in GNE text. For other hyperparameters, we referenced the experimental designs of existing methods for pre-trained language models and conducted multiple experiments ourselves to determine their optimal values.
[0127] Furthermore, the purpose of this step is to verify the effectiveness of the geographic named entity semantic model designed by this method. Since the model does not need to be tested or predicted, only the training set and validation set are used when pre-training the model. At the same time, in order to allow more geographic named entity text data to participate in training to influence the model parameters and enable the model to understand the semantics of geographic named entity text as comprehensively as possible, the proportions of the training set and validation set are set to approximately 99% (3,495,304 items) and 1% (35,307 items), respectively.
[0128] Third, to fully utilize the semantic knowledge learned by the pre-trained language model from a general corpus, we downloaded a BERT model and pre-trained it based on its parameters. This significantly reduced the time and computational cost required for model pre-training and enabled the model to better adapt to specific tasks in the field of geography while retaining its general semantic representation capabilities.
[0129] After the above experiments, the results verified the feasibility and accuracy of the basic geographic named entity semantic model.
[0130] Reference below Figure 4 , 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 4 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.
[0131] like Figure 4 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0132] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 4 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.
[0133] 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 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present invention are performed.
[0134] 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.
[0135] 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.
[0136] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0137] 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).
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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.
[0142] 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.
Claims
1. A geographic named entity matching method integrating spatial semantics, characterized in that: include: Obtain target query address information; Inputting the target query address information into a multi-objective fusion matching model based on spatial semantics to obtain a similarity score output by the multi-objective fusion matching model, 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; Determine the geographic named entity that matches the target query address based on the similarity score; The multi-target fusion matching model includes an encoder and a similarity calculation module; the encoder receives target query address information and outputs a target address vector; the similarity calculation module calculates the similarity between the target address vector and a candidate address vector, wherein the candidate address vector is obtained by extracting address features from the first geographic information database by the encoder; The encoder training process includes: Setting a plurality of decoders corresponding to the encoding network; Adjusting parameters of the encoding network based on outputs of a plurality of decoders to obtain the encoder; The plurality of decoders include at least two of the following: Geographic Named Entity Feature Segmentation Decoder, used to predict geographic named entity feature boundaries; 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 encoder includes a plurality of sequentially connected geographic named entity converter modules; The geographic named entity converter module consists of a multi-head self-attention layer, a residual connection layer, a normalization layer and a fully connected feed-forward neural network connected in sequence.
3. The method according to claim 2, characterized in that The method is also used to: Segment the target query address information and determine the hierarchical symbols for segmenting geographic named entity elements; According to the target query address information and the level symbol, an encoder input vector corresponding to the target query address information is generated.
4. The method according to claim 3, characterized in that The encoder includes a character vector generation module, wherein the character vector generation module is configured to: Receive the encoder input vector and generate word embedding vectors for the characters in the encoder input vector; Obtaining position information of the character in the target query address information; Calculate the position weight of the character; Based on the word embedding vector and position weight of the character, a character vector of the character is obtained, wherein the character vector is used to input into the multiple sequentially connected geographic named entity converter modules.
5. The method according to claim 1, wherein The method further comprises: The encoder is used to extract address features from the address information in the first geographic information database to obtain a corresponding address vector.
6. The method according to claim 1, characterized in that The encoder training process includes: Setting up an alias correction decoder corresponding to the encoding network; Mask the complete geographic named entity features in the training samples; The masked training samples are processed by the encoding network to obtain the semantic extraction vector output by the encoding network; The output semantic extraction vector is input into the confusion correction decoder to obtain the corrected text vector; The parameters of the encoding network are adjusted according to the corrected text vector output by the confusion correction decoder and the training sample input to the encoding network.
7. The method according to claim 6, characterized in that The confusion correction encoder includes a LeakyReLU activation function layer, a fully connected layer and a softmax function layer connected in sequence.
8. The method according to claim 6, characterized in that The masking of the complete geographic named entity elements in the training samples includes: The geographical named entity elements in the training samples are masked using easily confused words corresponding to the geographical named entity elements; wherein the easily confused words include homophones and / or synonyms.
9. 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: ; Where, It is an optional parameter, indicating that the model output Recommended results; Indicates that the input target query address information is the closest in space to the first geographic information database. The spatial distance between geographic named entities; It means that the input target query address information ranks first among the recommended results output by the model. The spatial distance between geographic named entities.
10. 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 9.
Citation Information
Patent Citations
Address information feature extraction method based on deep neural network model
CN110377686A
Address matching method and system fusing geographic element semantic segmentation and similarity
CN116955541A