Chinese address recognition methods, devices, equipment and storage media
By using Chinese address graphs to match query text to form sentence trees in Chinese address recognition methods, and by utilizing K-BERT, Bi-LSTM, and CRF models, the problem of high model learning complexity is solved, resulting in faster model convergence and higher accuracy.
Patent Information
- Application Number
- CN202311065086.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-08-22
AI Technical Summary
Existing Chinese address recognition methods suffer from high model learning complexity and slow convergence due to a lack of additional prior information.
By acquiring the user-annotated query text, matching it with the Chinese address map, injecting it into the target administrative subgraph to form a sentence tree, encoding it using the K-BERT model, and combining it with the Bi-LSTM and CRF models to generate Chinese address recognition results, the system provides rich prior information.
This reduces the model's learning complexity and improves the model's convergence speed and accuracy.
Smart Images

Figure CN117149950B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of address recognition technology, and more specifically, to a Chinese address recognition method, apparatus, device, and storage medium. Background Technology
[0002] In Chinese address recognition tasks, commonly used methods include dictionary matching, machine learning, and deep learning. In recent years, with the development of deep learning, the application of deep learning, especially deep language models, in constituent recognition tasks has become widespread and effective.
[0003] Existing Chinese address recognition methods generally employ deep language models to vectorize the segmented Chinese address characters to obtain a semantic information matrix. Then, a deep model is used to process the semantic information matrix to obtain a score sequence of labels. Finally, a conditional random field model is used to construct the constraint relationship between labels, thereby obtaining the optimal label sequence for Chinese address segmentation. However, the model input of this method is only the segmented Chinese address characters, that is, in addition to the current unstructured Chinese address text, no additional prior information is provided to the model, resulting in high learning complexity and slow convergence. Summary of the Invention
[0004] The main objective of this application is to provide a Chinese address recognition method, apparatus, device, and storage medium to reduce the learning complexity of the model, thereby accelerating model convergence and improving model accuracy.
[0005] To achieve the above-mentioned objectives, this application provides a Chinese address recognition method, including:
[0006] Retrieve the query text that the user has annotated;
[0007] The query text is matched with the administrative addresses in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0008] The target administrative subgraph is injected into the query text to form a sentence tree;
[0009] The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix;
[0010] The semantic information matrix is input into the Bi-LSTM deep model to obtain the score sequence of the labels, and the constraint relationship between the labels is constructed using the CRF conditional random field model to generate Chinese address recognition results.
[0011] Furthermore, after matching the query text with the administrative addresses in the Chinese address map, the process further includes:
[0012] When it is determined that there is no administrative sub-map in the Chinese address map that matches the query text, the latitude and longitude information of the user's current location is obtained;
[0013] The user's administrative address is obtained based on the latitude and longitude information;
[0014] The target administrative sub-map is obtained by querying the Chinese address map to find the administrative sub-map that matches the user's administrative address.
[0015] Furthermore, before injecting the target administrative subgraph into the query text to form a sentence tree, the process further includes:
[0016] When more than two target administrative subgraphs are detected, the user's historical behavior data is obtained;
[0017] The target administrative subgraph is filtered based on the user's historical behavior data to obtain the most matching target administrative subgraph, and other target administrative subgraphs are deleted.
[0018] Preferably, the step of filtering the target administrative submap based on the user's historical behavior data to obtain the most matching target administrative submap includes:
[0019] Based on the user's historical behavior data, determine the number of historical clicks the user made on the administrative address of each target administrative sub-map, and filter out the administrative address with the most historical clicks;
[0020] The administrative submap containing the administrative address with the most historical clicks is selected as the best-matching administrative submap.
[0021] Preferably, the step of injecting the target administrative subgraph into the query text to form a sentence tree includes:
[0022] Step A: Identify the lowest-level address entity in the query text that matches the target administrative subgraph but has not been injected into the query text. Starting from the lowest-level address entity, inject the address entities not present in the query text into the query text in a tree structure, following the order of lower-level address entities to higher-level address entities in the target administrative subgraph, until the address entity to be injected into the target administrative subgraph is present in the query text; wherein, the administrative address of the target administrative subgraph includes at least one address entity;
[0023] Step B: Repeat step A until there is no address entity in the query text that matches the target administrative subgraph and has not been injected into the query text, thus forming a sentence tree.
[0024] Preferably, the step of preprocessing the sentence tree and then inputting it into a pre-built K-BERT model for encoding to obtain a semantic information matrix includes:
[0025] Based on the input format of the K-BERT model, construct the input information corresponding to the sentence tree;
[0026] The input information is encoded into a pre-built K-BERT model to obtain a semantic information matrix.
[0027] Preferably, matching the query text with the administrative addresses in the Chinese address map includes:
[0028] Multiple first address entities are extracted from the query text;
[0029] Multiple second address entities are extracted from the administrative addresses of each administrative sub-map of the Chinese address map;
[0030] Calculate the similarity between each first address entity and each second address entity, and take the administrative submap to which the second address entity with a similarity greater than a preset threshold belongs as the target administrative submap.
[0031] This application also provides a Chinese address recognition device, the device comprising:
[0032] The acquisition module is used to retrieve the query text that has been annotated by the user;
[0033] The matching module is used to match the query text with the administrative addresses of the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0034] The injection module is used to inject the target administrative subgraph into the query text to form a sentence tree;
[0035] The input module is used to preprocess the sentence tree and input it into a pre-built K-BERT model for encoding to obtain a semantic information matrix;
[0036] The generation module is used to input the semantic information matrix into the Bi-LSTM deep model to obtain the score sequence of the labels, and to use the CRF conditional random field model to construct the constraint relationship between the labels to generate Chinese address recognition results.
[0037] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.
[0038] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.
[0039] This application provides a Chinese address recognition method, apparatus, device, and storage medium. It acquires user-annotated query text, matches the query text with administrative addresses in a Chinese address map, and when an administrative submap matching the query text is found, it uses this matching submap as the target submap. The target submap is then injected into the query text to form a sentence tree. The sentence tree is preprocessed and input into a pre-built K-BERT model for encoding to obtain a semantic information matrix. This semantic information matrix is then input into a Bi-LSTM deep model to obtain a label score sequence. A CRF (Conditional Random Field) model is used to construct constraint relationships between labels, generating Chinese address recognition results. This injects the hierarchical information associated with the Chinese address map into unstructured Chinese text. During input, the model obtains useful address entities in the sample and their geographical location information, providing rich prior information, reducing model learning complexity, accelerating model convergence, and improving model accuracy. Attached Figure Description
[0040] Figure 1 This is a flowchart illustrating a Chinese address recognition method according to an embodiment of this application;
[0041] Figure 2 This is a schematic block diagram of the sentence tree structure according to an embodiment of this application;
[0042] Figure 3 This is a schematic block diagram of the structure of a Chinese address recognition device according to an embodiment of this application;
[0043] Figure 4 This is a schematic block diagram of the structure of a computer device according to an embodiment of this application.
[0044] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] This application proposes a Chinese address recognition method, in which a computer device is executed. The computer device can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device can also be a mobile or stationary server. Components of the computing device include, but are not limited to, memory and a processor. The processor and memory are connected via a bus, and a database is used to store data. The computing device also includes an access device that enables the computing device to communicate via one or more networks. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. Access devices may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0047] This Chinese address recognition method addresses the technical problem that current models only input segmented Chinese address characters, meaning that no additional prior information is provided to the model besides the current unstructured Chinese address text, resulting in high learning complexity and slow convergence.
[0048] refer to Figure 1 In one embodiment, this application provides a Chinese address recognition method, the method comprising:
[0049] S11. Obtain the query text that the user has annotated;
[0050] S12. Match the query text with the administrative addresses in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is taken as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0051] S13. Inject the target administrative subgraph into the query text to form a sentence tree;
[0052] S14. After preprocessing the sentence tree, input it into the pre-built K-BERT model for encoding to obtain the semantic information matrix;
[0053] S15. Input the semantic information matrix into the Bi-LSTM deep model to obtain the label score sequence, and use the CRF conditional random field model to construct the constraint relationship between the labels to generate Chinese address recognition results.
[0054] This embodiment requires the following data to be prepared in advance: user query text with component annotations, user's latitude and longitude information, and Chinese address map. The Chinese address map is a Geographic Information System (GIS) tool that visualizes Chinese address information. It combines address data with geographic coordinates to graphically present the distribution of streets, buildings, locations, etc., in geographic space. The Chinese address map can be used to provide accurate location information, route planning, location recommendations, and other applications, making it easier for people to find and navigate to specific destinations. The query text and latitude and longitude must belong to the same user. Component tags include, but are not limited to: province, city, district / county, street / township, community / village, road / alley, landmark / area / commercial district, POI, and house number. The triplet information contained in the Chinese address map is as follows (format: head entity-relationship-tail entity):
[0055] Province-sub-city;
[0056] City-sub-district / county;
[0057] District / County - Sub-Street / Township;
[0058] District / County - Sub-Community / Village;
[0059] District / County - Sub-Roads and Lanes;
[0060] District / County - Sub-Landmark Area / Business District;
[0061] District / County - Sub-poi;
[0062] Streets, towns, townships - sub-communities, villages;
[0063] Streets, towns, townships - sub-roads and lanes;
[0064] Streets, towns, and sub-landmark areas / commercial districts;
[0065] Street / Township -sub-poi;
[0066] Community village - sub-roads and lanes;
[0067] Community village - sub-landmark commercial area;
[0068] Community Village - sub-poi;
[0069] Roads and alleys - sub-landmark areas and commercial districts;
[0070] Road lane - sub-poi;
[0071] Landmark area business district - sub-poi.
[0072] As can be seen from the triples above, the relationship between different types of head and tail entities is defined by only one "sub". The path between entities increases by one level for each sub level they pass through. The complete hierarchical relationship is: Province-City-District / County-Street / Township-Community / Village-Road / Alley-Landmark / Area / Business District-PO i. Jumps between levels are allowed (e.g., District / County-Sub-PO i, a jump of 4 levels) to support continuous graph completion work.
[0073] This embodiment of the Chinese address map includes at least one administrative submap, and each administrative submap includes administrative addresses. The query text is matched against the administrative addresses of each administrative submap in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. For example, the query text is matched nationwide to see if it contains the following five levels of administrative address information: province, city, district / county, street / township, community / village. All matching administrative submaps are identified, and then roads and lanes are matched under the constraints of these administrative submaps. If a road is matched, the administrative submap that does not match a road is deleted. For example, when querying the text "Jing'an Shaanxi North Road Golden Eagle International", matching is performed across provinces, cities, districts, counties, streets, towns, townships, communities, and villages nationwide using rules or similarity calculations. This yields results such as "Jing'an" potentially being an administrative submap of Shanghai's Jing'an District, Sichuan Province's Chengdu City's Xindu District's Jing'an Village, Guangdong Province's Shenzhen City's Luohu District's Jing'an Community, and "Shaanxi" potentially being "Shaanxi Province". Then, roads and lanes are matched under the constraints of these administrative submaps. The administrative submap of Shanghai's Jing'an District that matches Shaanxi North Road is selected as the target administrative submap, and other administrative submaps are deleted. The resulting address's hierarchical structure is: Shanghai's Jing'an District's Shaanxi North Road.
[0074] Then, the target administrative subgraph is injected into the query text to form a sentence tree. This sentence tree is used to complete the query text with other address entity information and the relationship information between address entities. After preprocessing, the sentence tree is input into a pre-built K-BERT model for encoding to obtain a semantic information matrix.
[0075] K-BERT is a knowledge-enhanced model based on BERT. BERT is a pre-trained language model using a Transformer architecture to learn contextual representations of text. K-BERT incorporates domain knowledge to enhance BERT's representational capabilities. It leverages entity and relation information from knowledge graphs, fusing this knowledge with the text and using a graph attention network to learn knowledge-enhanced representations. By integrating domain knowledge into the BERT model, K-BERT can better handle natural language processing tasks related to specific knowledge domains, such as question answering systems, entity linking, and relation extraction. It provides a method for combining pre-trained language models with knowledge graphs, thereby enabling better understanding and processing of text data containing domain knowledge.
[0076] A semantic information matrix is a matrix structure used to represent semantic relationships between texts. It can be used to describe concepts such as similarity, relevance, or semantic distance between a set of texts. When constructing a semantic information matrix, word embedding techniques are typically used to convert the text into vector form. Word embedding models can capture the context and semantic associations between words. Based on the vector representation of word embeddings, the similarity or distance between texts can be calculated and represented as a matrix. This helps in understanding and processing text data by extracting semantic relationships between texts.
[0077] Finally, the semantic information matrix is input into the Bi-LSTM deep model to obtain the label score sequence, and the constraint relationship between the labels is constructed using the CRF conditional random field model to generate Chinese address recognition results. The Chinese address recognition results include the optimal label sequence of Chinese address word segmentation, so that the model can obtain the useful address entities in the sample and the geographical location information to which the address entities belong at the input, providing the model with rich prior information, reducing the model learning complexity, thereby accelerating model convergence and improving model accuracy.
[0078] Bi-LSTM is a bidirectional long short-term memory network model. It extends the traditional Long Short-Term Memory (LSTM) network to capture forward and backward contextual information in text sequences. LSTM is a variant of recurrent neural networks, which has the advantage of processing sequential data. It effectively handles long-term dependencies and avoids the gradient vanishing problem through memory units and gating mechanisms.
[0079] Bi-LSTM combines two LSTM layers: one performs forward propagation in the original sequence order, and the other performs backward propagation in reverse order. This allows it to consider contextual information from both before and after a given position, enabling Bi-LSTM to better capture the semantic and syntactic structure of the sequence through the combined use of bidirectional contextual information.
[0080] Conditional Random Field (CRF) models are probabilistic graphical models used for sequence labeling tasks such as named entity recognition, part-of-speech tagging, and semantic role labeling. CRF models the sequence by defining a conditional probability distribution between the input and output sequences. It learns parameters that maximize the conditional probability based on the relationship between the feature functions of the input sequence and the labels of the output sequence. CRF has a strong ability to capture global dependencies in the labeled sequence, considering not only the features of the current state but also the features of the context. This makes CRF perform well in sequence labeling tasks.
[0081] The Chinese address recognition method provided in this application obtains user-annotated query text, matches the query text with administrative addresses in a Chinese address map, and when an administrative submap in the Chinese address map is found to match the query text, the matching administrative submap is used as the target administrative submap and injected into the query text to form a sentence tree. The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix. The semantic information matrix is then input into a Bi-LSTM deep model to obtain a label score sequence, and a CRF conditional random field model is used to construct the constraint relationship between the labels to generate Chinese address recognition results. This injects the hierarchical information associated with the Chinese address map into the unstructured Chinese text, allowing the model to obtain useful address entities in the sample and the geographical location information to which the address entities belong during input. This provides the model with rich prior information, reduces the model's learning complexity, accelerates model convergence, and improves model accuracy.
[0082] In one embodiment, after matching the query text with the administrative addresses in the Chinese address map, the process may further include:
[0083] When it is determined that there is no administrative sub-map in the Chinese address map that matches the query text, the latitude and longitude information of the user's current location is obtained;
[0084] The user's administrative address is obtained based on the latitude and longitude information;
[0085] The target administrative sub-map is obtained by querying the Chinese address map to find the administrative sub-map that matches the user's administrative address.
[0086] In this embodiment, after obtaining the administrative address, the name address (landmark, area, business district, PO i) is matched using matching rules or similarity calculations across all administrative addresses. Since there are too many names and addresses nationwide, if it is determined that no administrative sub-map in the Chinese address map matches the query text, then the user's current latitude and longitude information is obtained. Based on this information, the user's current city's administrative address is determined as a possible administrative address, i.e., the user's administrative address. This is because when the address entered by the user does not contain a specific administrative address, the search scope is highly likely to be within the current city.
[0087] The system queries the Chinese address map to find administrative sub-maps that match the user's administrative address, thus obtaining the target administrative sub-map. For example, it matches the query text nationwide to see if it contains the following five levels of administrative address information: province, city, district / county, street / township, community / village. It then mines all matching administrative sub-maps and matches roads and lanes under the constraints of these administrative sub-maps. If a road is matched, these administrative sub-maps are used as the target administrative sub-maps, and administrative sub-maps that do not match roads are deleted.
[0088] In one embodiment, before injecting the target administrative subgraph into the query text to form a sentence tree, the process may further include:
[0089] When more than two target administrative subgraphs are detected, the user's historical behavior data is obtained;
[0090] The target administrative subgraph is filtered based on the user's historical behavior data to obtain the most matching target administrative subgraph, and other target administrative subgraphs are deleted.
[0091] In this embodiment, if there are two or more administrative address sub-maps or two or more name address sub-maps, the sub-map ranked first is selected as the target administrative sub-map based on user history behavior, popularity, distance, etc.
[0092] For example, if a user's query text is "Lianhua Xinhua Shopping Plaza", the matching results are: "Xiamen City-Siming District-Jialian Street-Lianhua Community-Xinhua Shopping Plaza" and "Xiamen City-Tong'an District-Lianhua Village-Xinhua Shopping Plaza". At this time, the target administrative sub-map with the highest confidence can be selected by means of popularity, user historical click records, or distance, and other target administrative sub-maps can be deleted.
[0093] In one embodiment, the step of filtering the target administrative submap based on the user's historical behavior data to obtain the most matching target administrative submap may specifically include:
[0094] Based on the user's historical behavior data, determine the number of historical clicks the user made on the administrative address of each target administrative sub-map, and filter out the administrative address with the most historical clicks;
[0095] The administrative submap containing the administrative address with the most historical clicks is selected as the best-matching administrative submap.
[0096] This embodiment can determine the number of historical clicks a user makes on the administrative address of each target administrative submap based on the user's historical behavior data, and filter out the administrative address with the most historical clicks. The target administrative submap to which the administrative address with the most historical clicks belongs is then selected as the most matching target administrative submap. For example, if the user's query text is "Lianhua Xinhua Shopping Plaza", the matching results in the administrative submaps "Xiamen City-Siming District-Jialian Street-Lianhua Community-Xinhua Shopping Plaza" and "Xiamen City-Tong'an District-Lianhua Village-Xinhua Shopping Plaza". At this point, the user's historical click records show that "Xinhua Shopping Plaza" has the most historical clicks. Therefore, the administrative submap "Xiamen City-Tong'an District-Lianhua Village-Xinhua Shopping Plaza" is selected as the most matching target administrative submap, and the administrative submap "Xiamen City-Siming District-Jialian Street-Lianhua Community-Xinhua Shopping Plaza" is deleted.
[0097] In one embodiment, injecting the target administrative subgraph into the query text to form a sentence tree includes:
[0098] Step A: Identify the lowest-level address entity in the query text that matches the target administrative subgraph but has not been injected into the query text. Starting from the lowest-level address entity, inject the address entities not present in the query text into the query text in a tree structure, following the order of lower-level address entities to higher-level address entities in the target administrative subgraph, until the address entity to be injected into the target administrative subgraph is present in the query text; wherein, the administrative address of the target administrative subgraph includes at least one address entity;
[0099] Step B: Repeat step A until there is no address entity in the query text that matches the target administrative subgraph and has not been injected into the query text, thus forming a sentence tree.
[0100] This embodiment injects the mined target administrative subgraph into the query text. The injection rule is:
[0101] Step A: Determine the lowest-level address entity in the query text that matches the target administrative sub-graph and has not been injected into the query text. Starting from the lowest-level entity that is matched and not injected in the query text, inject the address entities that are not in the query text into the query text one by one in a tree structure in the order from the lowest-level address entity to the highest-level address entity in the target administrative sub-graph until an address entity in the target administrative sub-graph is included in the query text, and end the first round of address entity injection.
[0102] Step B: Repeat Step A until there are no address entities in the query text that match the target administrative sub-graph and have not been injected into the query text, thus forming a sentence tree.
[0103] For example, as shown in Figure 2 In the query text "Food Street near Chilechuan Street is a bit busy with fruit bowls", and the target administrative sub-graph is "Hohhot (City) - Saihan District (County - District) - Chilechuan Street (Road) - Taojie Food Street (Landmark Area Business District) - A Bit Busy Fruit Bowl (POI)". In the first round of injection, the lowest-level entity that is matched and not injected in the query text is "A Bit Busy Fruit Bowl". Starting from "A Bit Busy Fruit Bowl", its upper-level "Taojie Food Street" is not in the query text, so "Taojie Food Street" is added to the query text. The upper-level "Chilechuan Street" is in the query text, and the first round of address entity injection ends. Re-execute the previous step. At this time, the lowest-level entity that is matched and not injected in the query text is "Chilechuan Street". Starting from "Chilechuan Street", its upper-level "Saihan District" is not in the query text, so "Saihan District" is added to the query text. The upper-level "Hohhot" is also not in the query text, so "Hohhot" is also added to the query text, and the second round of address entity injection ends. At this time, there is no lowest-level entity that is matched and not injected in the query text, and the injection ends, forming Figure 2 the sentence tree shown, to supplement other address entity information in the query text and clearly reflect the relationship information between address entities, enhancing the corpus; at the same time, through exact or fuzzy matching means, in the form of an injected tree structure, assist in informing the model that "Chilechuan" is a whole and "A Bit Busy Fruit Bowl" is a whole, making the model more accurate in dividing the component boundaries.
[0104] In one embodiment, the preprocessing of the sentence tree and then inputting it into a pre-constructed K-BERT model for encoding to obtain a semantic information matrix may specifically include:
[0105] Construct the input information corresponding to the sentence tree according to the input form of the K-BERT model;
[0106] Input the input information into a pre-constructed K-BERT model for encoding to obtain a semantic information matrix.
[0107] In this embodiment, after obtaining the sentence tree, it is necessary to construct the corresponding input information for the sentence tree based on the input format of the K-BERT model. The input to the K-BERT model consists of three types: token embedding, soft-position embedding, and segment embedding. The result is as follows:
[0108]
[0109] In the model, since the Saihan District of Hohhot only affects the Chulechuan Street, its position starts from 5, just like the nearby food street. This means that the Saihan District of Hohhot and the nearby food festival cannot see each other.
[0110] In one embodiment, matching the query text with the administrative addresses in the Chinese address map may specifically include:
[0111] Multiple first address entities are extracted from the query text;
[0112] Multiple second address entities are extracted from the administrative addresses of each administrative sub-map of the Chinese address map;
[0113] Calculate the similarity between each first address entity and each second address entity, and take the administrative submap to which the second address entity with a similarity greater than a preset threshold belongs as the target administrative submap.
[0114] This embodiment can use Named Entity Recognition (NER) technology to extract address entities from the query text and the administrative address of each administrative sub-map, respectively, to obtain multiple first address entities corresponding to the query text and multiple second address entities corresponding to the administrative address of each administrative sub-map.
[0115] The goal of Named Entity Recognition (NER) is to identify and classify named entities with specific categories in text, such as person names, place names, and organization names. Specifically, this embodiment requires a training dataset containing labeled entities. This dataset includes text samples and corresponding entity annotation information. To train the model, the text samples need to be transformed into feature representations that can be processed by machine learning algorithms. Feature representations include part-of-speech tags, word boundaries, and context windows. Then, using the training dataset and the extracted features, combined with machine learning algorithms (such as Conditional Random Fields, Support Vector Machines, and deep learning models), a named entity recognition model is trained. This model will learn how to predict entities in text based on features. Finally, the trained model is used to extract entities from new unlabeled text. By inputting text into the model, the model predicts the location and category of entities in the text.
[0116] Then, the similarity between each first address entity and each second address entity is calculated to obtain multiple similarities. Each similarity is compared with a preset threshold. When there is a second address entity with a similarity greater than the preset threshold, it is determined that there is an administrative sub-map in the Chinese address map that matches the query text. At this time, the administrative sub-map to which the second address entity with a similarity greater than the preset threshold belongs is taken as the target administrative sub-map, so as to accurately match the target administrative sub-map through the similarity calculation method.
[0117] In this embodiment, the following calculation method can be used to calculate the similarity between entities:
[0118] Edit distance and string matching: Edit distance can be used to measure the similarity between two entity names. Additionally, string matching algorithms (such as cosine similarity) can be used to compare shared vocabulary between entities.
[0119] Word vector-based similarity: Entity names are represented as word vectors, and the distance or similarity between word vectors is used to measure the similarity between entities. Word vector models include Word2Vec and BERT, among others.
[0120] Knowledge graph-based similarity: If entities are related and form a knowledge graph, the similarity between entities can be calculated using information such as paths and graph structure. For example, link prediction algorithms (such as HITS, PageRank, etc.) can be used to measure the degree of association between entities.
[0121] Semantic association-based similarity: Utilizing contextual information from large-scale corpora, such as co-occurrence frequency and context windows, the semantic similarity between entities is measured by calculating the similarity of their contexts.
[0122] Reference Figure 3 This application also provides a Chinese address recognition device, the device comprising:
[0123] Module 11 is used to retrieve the query text that has been annotated by the user;
[0124] The matching module 12 is used to match the query text with the administrative addresses of the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0125] Injection module 13 is used to inject the target administrative subgraph into the query text to form a sentence tree;
[0126] Input module 14 is used to preprocess the sentence tree and input it into a pre-built K-BERT model for encoding to obtain a semantic information matrix;
[0127] The generation module 15 is used to input the semantic information matrix into the Bi-LSTM deep model to obtain the score sequence of the labels, and to use the CRF conditional random field model to construct the constraint relationship between the labels to generate Chinese address recognition results.
[0128] As described above, it is understood that each component of the Chinese address recognition device proposed in this application can realize the function of any of the Chinese address recognition methods described above, and the specific structure will not be described in detail.
[0129] Reference Figure 4 As shown in the embodiments of this application, a computer device is also provided, the internal structure of which can be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a storage medium and internal memory. The storage medium stores the operating system, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the storage medium. The database stores data related to the Chinese address recognition method. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a Chinese address recognition method.
[0130] The processor described above executes the Chinese address recognition method described above, the method comprising:
[0131] Retrieve the query text that the user has annotated;
[0132] The query text is matched with the administrative addresses in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0133] The target administrative subgraph is injected into the query text to form a sentence tree;
[0134] The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix;
[0135] The semantic information matrix is input into the Bi-LSTM deep model to obtain the score sequence of the labels, and the constraint relationship between the labels is constructed using the CRF conditional random field model to generate Chinese address recognition results.
[0136] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements a Chinese address recognition method, the method comprising:
[0137] Retrieve the query text that the user has annotated;
[0138] The query text is matched with the administrative addresses in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address.
[0139] The target administrative subgraph is injected into the query text to form a sentence tree;
[0140] The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix;
[0141] The semantic information matrix is input into the Bi-LSTM deep model to obtain the score sequence of the labels, and the constraint relationship between the labels is constructed using the CRF conditional random field model to generate Chinese address recognition results.
[0142] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0143] In summary, the greatest benefit of this application is that:
[0144] This application provides a Chinese address recognition method, apparatus, device, and storage medium. It acquires user-annotated query text, matches the query text with administrative addresses in a Chinese address map, and when an administrative submap matching the query text is found, it uses this matching submap as the target submap. The target submap is injected into the query text to form a sentence tree. The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix. This semantic information matrix is then input into a Bi-LSTM deep model to obtain a label score sequence. A CRF (Conditional Random Field) model is used to construct constraint relationships between labels, generating Chinese address recognition results. This injects the hierarchical information associated with the Chinese address map into unstructured Chinese text. During input, the model obtains useful address entities in the sample and their geographical location information, providing rich prior information, reducing model learning complexity, accelerating model convergence, and improving model accuracy.
[0145] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0146] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for recognizing Chinese addresses, characterized in that, include: Retrieve the query text that the user has annotated; The query text is matched with the administrative addresses in the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address. The target administrative subgraph is injected into the query text to form a sentence tree; The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix; The semantic information matrix is input into the Bi-LSTM deep model to obtain the score sequence of the labels, and the constraint relationship between the labels is constructed using the CRF conditional random field model to generate Chinese address recognition results. The step of injecting the target administrative subgraph into the query text to form a sentence tree includes: Step A: Identify the lowest-level address entity in the query text that matches the target administrative subgraph but has not been injected into the query text. Starting from the lowest-level address entity, inject the address entities not present in the query text into the query text in a tree structure, following the order of lower-level address entities to higher-level address entities in the target administrative subgraph, until the address entity to be injected into the target administrative subgraph is present in the query text; wherein, the administrative address of the target administrative subgraph includes at least one address entity; Step B: Repeat step A until there is no address entity in the query text that matches the target administrative subgraph and has not been injected into the query text, thus forming a sentence tree.
2. The method according to claim 1, characterized in that, After matching the query text with the administrative addresses in the Chinese address map, the process further includes: When it is determined that there is no administrative sub-map in the Chinese address map that matches the query text, the latitude and longitude information of the user's current location is obtained; The user's administrative address is obtained based on the latitude and longitude information; The target administrative sub-map is obtained by querying the Chinese address map to find the administrative sub-map that matches the user's administrative address.
3. The method according to claim 2, characterized in that, Before injecting the target administrative subgraph into the query text to form a sentence tree, the process also includes: When more than two target administrative subgraphs are detected, the user's historical behavior data is obtained; The target administrative subgraph is filtered based on the user's historical behavior data to obtain the most matching target administrative subgraph, and other target administrative subgraphs are deleted.
4. The method according to claim 3, characterized in that, The step of filtering the target administrative submap based on the user's historical behavior data to obtain the most matching target administrative submap includes: Based on the user's historical behavior data, determine the number of historical clicks the user made on the administrative address of each target administrative sub-map, and filter out the administrative address with the most historical clicks; The administrative submap containing the administrative address with the most historical clicks is selected as the best-matching administrative submap.
5. The method according to claim 1, characterized in that, The sentence tree is preprocessed and then input into a pre-built K-BERT model for encoding to obtain a semantic information matrix, including: Based on the input format of the K-BERT model, construct the input information corresponding to the sentence tree; The input information is encoded into a pre-built K-BERT model to obtain a semantic information matrix.
6. The method according to claim 1, characterized in that, The step of matching the query text with the administrative addresses in the Chinese address map includes: Multiple first address entities are extracted from the query text; Multiple second address entities are extracted from the administrative addresses of each administrative sub-map of the Chinese address map; Calculate the similarity between each first address entity and each second address entity, and take the administrative submap to which the second address entity with a similarity greater than a preset threshold belongs as the target administrative submap.
7. A Chinese address recognition device, characterized in that, include: The acquisition module is used to retrieve the query text that has been annotated by the user; The matching module is used to match the query text with the administrative addresses of the Chinese address map. When it is determined that there is an administrative submap in the Chinese address map whose administrative address matches the query text, the matching administrative submap is used as the target administrative submap. The Chinese address map includes at least one administrative submap, and each administrative submap includes an administrative address. The injection module is used to inject the target administrative subgraph into the query text to form a sentence tree; The input module is used to preprocess the sentence tree and input it into a pre-built K-BERT model for encoding to obtain a semantic information matrix; The generation module is used to input the semantic information matrix into the Bi-LSTM deep model to obtain the score sequence of the labels, and to use the CRF conditional random field model to construct the constraint relationship between the labels to generate Chinese address recognition results. The step of injecting the target administrative subgraph into the query text to form a sentence tree includes: Step A: Identify the lowest-level address entity in the query text that matches the target administrative subgraph but has not been injected into the query text. Starting from the lowest-level address entity, inject the address entities not present in the query text into the query text in a tree structure, following the order of lower-level address entities to higher-level address entities in the target administrative subgraph, until the address entity to be injected into the target administrative subgraph is present in the query text; wherein, the administrative address of the target administrative subgraph includes at least one address entity; Step B: Repeat step A until there is no address entity in the query text that matches the target administrative subgraph and has not been injected into the query text, thus forming a sentence tree.
8. A computer device, characterized in that, include: processor; Memory; The memory stores a computer program, and when the processor executes the computer program, it implements the Chinese address recognition method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the Chinese address recognition method according to any one of claims 1-6.
Citation Information
Patent Citations
Address identification method and system, storage medium and electronic equipment
CN113657111A
Address information resolution method, apparatus and device, and storage medium
WO2022134592A1