Address information processing method and device, mobile terminal and storage medium
Patent Information
- Application Number
- CN202310372010.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-04-10
AI Technical Summary
由于本申请实施例提供的地址信息处理方法基于编辑距离和拼音对输入地址片段和第一候选地址信息进行相似度计算,可以综合考虑用户输入地址信息可能对应的所有标准地址信息,避免了因用户输入地址信息颠倒、别字等问题导致现有基于语义模型或基于字符相似度等方法判断偏差的问题,提高了地址信息补全的准确性
[0039]用户在输入地址信息时通常使用自然语言,但自然语言往往受用户自身语言习惯、地址书写随意、错别字和顺序颠倒等因素影响而与标准地址信息存在差异。现有的地址信息处理方法通过语义和字符相似度进行匹配,当用户输入的地址信息错误时,根据错误的地址信息匹配到的标准地址信息并不是用户实际想要输入的地址信息,准确性较差差。
Smart Images

Figure CN116501834B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an address information processing method, apparatus, mobile terminal and storage medium. Background Technology
[0002] Users typically describe address information and inquire about address-related matters using natural language. However, address information described in natural language is often inaccurate, and pre-set automated intelligent responses or intelligent customer service systems cannot simply match the natural language address information with pre-stored address information. Therefore, it is necessary to recognize users' natural language and complete the address information accordingly. This assists automated intelligent responses, intelligent customer service, and other tools in answering user questions, improving the efficiency of answering address-related inquiries, and resolving user issues more quickly.
[0003] To address the aforementioned issues, existing address information processing methods employ inverted indexes. These methods retrieve candidate address information from a standard address database based on the user's natural language input, and then use semantic models and character similarity methods to determine the corresponding address information. However, this approach relies entirely on the user's natural language input. When the user's input is out of order, repetitive, or contains typos, existing methods cannot exclude it. Address information obtained based on erroneous input cannot meet user needs, resulting in low accuracy. Summary of the Invention
[0004] This application provides an address information processing method, apparatus, mobile terminal, and storage medium. Because the address information processing method provided in this application calculates the similarity between the input address fragment and the first candidate address information based on edit distance and pinyin, it can comprehensively consider all standard address information that may correspond to the user's input address information. This avoids the problem of judgment deviations caused by issues such as reversed or misspelled user input address information, which are common in existing methods based on semantic models or character similarity, thus improving the accuracy of address information completion.
[0005] To address the aforementioned technical problems, this application provides an address information processing method, including:
[0006] The system matches the input address fragment against a pre-set standard address database and obtains the matching result. The standard address database stores standard address information.
[0007] Based on the matching results, obtain multiple first candidate address information from the standard address information;
[0008] The similarity calculation of the input address fragment is performed based on multiple first candidate address information to obtain the first similarity calculation result. The similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0009] The input address fragment is processed based on the first candidate address information with the highest similarity calculation result to obtain the first address information processing result.
[0010] Optionally, the address information processing method provided in this application also includes:
[0011] The input address segment is obtained by standardizing the original address segment corresponding to the input address segment.
[0012] Optionally, the address information processing method provided in this application also includes:
[0013] Generate a prefix tree based on the characters of the standard address information;
[0014] Generate a mapping between standard address information and the corresponding record index in the address database;
[0015] A standard address library is constructed based on the prefix tree and mapping.
[0016] Optionally, the address information processing method provided in this application also includes:
[0017] Retrieve multiple characters corresponding to the input address fragment;
[0018] Multiple characters are entered into the standard address database in a pre-set order for querying, and the first matching result is generated.
[0019] Optionally, the address information processing method provided in this application also includes:
[0020] By hierarchically classifying the addresses of multiple characters, we can obtain characters at multiple levels.
[0021] The characters at multiple levels are entered into the prefix tree of the corresponding level in the standard address database in order of level for querying, and a second matching result is generated.
[0022] Optionally, the address information processing method provided in this application also includes:
[0023] A cluster search tree is constructed based on the levels of multiple first candidate address information;
[0024] The similarity calculation results are obtained by performing similarity calculations on the first candidate address information and the input address fragment according to the level order.
[0025] Optionally, the address information processing method provided in this application also includes:
[0026] When the matching result is no match, perform fuzzy matching on the pre-set standard address database based on the input address fragment to obtain multiple second candidate address information from the standard address information;
[0027] The similarity calculation results are obtained by performing similarity calculation on the input address fragment based on multiple second candidate address information. The similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0028] The input address fragment is filled with address information based on the second candidate address information with the highest similarity calculation result, and the processing result of the second address information is obtained.
[0029] This application also provides an address information processing apparatus, including:
[0030] The first matching module is used to match the input address fragment against a pre-set standard address database and obtain the matching result;
[0031] The first candidate acquisition module is used to obtain multiple first candidate address information from the standard address information based on the matching results.
[0032] The first calculation module is used to perform similarity calculation on the input address fragment based on multiple first candidate address information to obtain the first similarity calculation result. The similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0033] The first completion module is used to complete the address information of the input address fragment based on the first candidate address information with the highest similarity calculation result, and obtain the first address information processing result.
[0034] This application also provides a mobile terminal, including:
[0035] At least one processor; and,
[0036] A memory that is communicatively connected to at least one processor; wherein,
[0037] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to implement the address information processing method described above.
[0038] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the address information processing method described above.
[0039] Users typically use natural language when entering address information. However, natural language is often affected by factors such as user's own language habits, arbitrary address writing, typos, and reversed word order, resulting in discrepancies between the actual address and the standard address information. Existing address processing methods match based on semantics and character similarity. When the user enters an incorrect address, the standard address information matched based on the incorrect address is not the address the user actually intended, leading to poor accuracy.
[0040] Since the address information processing method provided in this application calculates the similarity between the input address fragment and the first candidate address information based on edit distance and pinyin, it can comprehensively consider all standard address information that the user input address information may correspond to. This avoids the problem of judgment deviation caused by the user input address information being reversed or having typos, which is common in existing methods based on semantic models or character similarity, and improves the accuracy of address information completion.
[0041] The above description is merely an overview of the technical solution provided in this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are described below. Attached Figure Description
[0042] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0043] Figure 1 This is one of the schematic diagrams of the address information processing method provided in the embodiments of this application;
[0044] Figure 2 This is a second schematic diagram of the address information processing method provided in the embodiments of this application;
[0045] Figure 3 This is the third schematic diagram of the address information processing method provided in the embodiments of this application;
[0046] Figure 4 This is the fourth schematic diagram of the address information processing method provided in the embodiments of this application;
[0047] Figure 5 This is the fifth schematic diagram of the address information processing method provided in the embodiments of this application;
[0048] Figure 6 This is the sixth schematic diagram of the address information processing method provided in the embodiments of this application;
[0049] Figure 7This is the seventh schematic diagram of the address information processing method provided in the embodiments of this application;
[0050] Figure 8 This is a schematic flowchart of an address information processing method provided in an embodiment of this application;
[0051] Figure 9 This is a schematic diagram of a standard address database tree structure provided in this application;
[0052] Figure 10 This is a schematic diagram of a cluster search tree provided in this application;
[0053] Figure 11 This is one of the schematic diagrams of the address information processing device provided in the embodiments of this application;
[0054] Figure 12 This is a second schematic diagram of the address information processing device provided in the embodiments of this application;
[0055] Figure 13 This is the third schematic diagram of the address information processing device provided in the embodiments of this application;
[0056] Figure 14 This is the fourth schematic diagram of the address information processing device provided in the embodiments of this application;
[0057] Figure 15 This is the fifth schematic diagram of the address information processing device provided in the embodiments of this application;
[0058] Figure 16 This is the sixth schematic diagram of the address information processing device provided in the embodiments of this application;
[0059] Figure 17 This is the seventh schematic diagram of the address information processing device provided in the embodiments of this application;
[0060] Figure 18 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0061] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0062] The address information processing method provided in this application relies on the standard address library with character prefix tree and trie structure. The relevant concepts are explained and described below:
[0063] The tree structure in this application is a one-level nested structure. The outer and inner layers of a tree structure have similar structures, so such structures can often be represented recursively. For example, various tree diagrams in classic data structures include a root, left subtree, and right subtree, and both the left and right subtrees have their own subtrees. The tree and its subtrees have similar structures, which is a common type of tree structure.
[0064] The trie tree, also known as a dictionary tree, is a variant of the hash tree. A hash tree is a persistent data structure used to implement sets and mappings of records in a database, and can replace hash tables in pure functional programming. In the basic form of a hash tree, the hash value of the key is stored in a tree structure, while the actual key and value are stored in the final nodes of the tree structure. Trie trees are often used for statistics, sorting, and storing large amounts of strings, and are frequently used for text frequency analysis. Compared to hash trees, trie trees can reduce query time and duplicate string comparisons by utilizing common prefixes of strings, resulting in higher query efficiency.
[0065] Furthermore, the similarity calculation provided in this application is based on edit distance and semantic similarity of pinyin. The relevant concepts are explained and described below:
[0066] In this application, edit distance refers to the quantification and measurement of the degree of difference between two strings. Specifically, the measurement method can be to count the minimum number of processing steps required to transform the first string into the second string, thereby obtaining the quantified edit distance between the two strings.
[0067] The semantic similarity in this application is an indicator that measures the consistency of meaning between two or more statements. Specifically, the semantic similarity in this application is measured using pinyin. Specifically, existing technologies for automatic pinyin annotation can be used to add pinyin to the characters of Chinese text, thereby achieving pinyin-based semantic similarity comparison.
[0068] Furthermore, the semantic similarity calculation based on pinyin in this application involves the concept of the bag-of-words model, a simplified expression model in natural language processing and information retrieval.
[0069] The first embodiment of this application relates to an address information processing method, such as... Figure 1 As shown, it includes:
[0070] Step 101: Match the input address fragment against the pre-set standard address database and obtain the matching result. The standard address database stores standard address information.
[0071] Step 102: Obtain multiple first candidate address information from the standard address information based on the matching results;
[0072] Step 103: Calculate the similarity of the input address fragments based on multiple first candidate address information to obtain the first similarity calculation result. The similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0073] Step 104: Complete the address information of the input address segment based on the first candidate address information with the highest similarity calculation result, and obtain the first address information processing result.
[0074] Specifically, the address information processing method provided in this application carries standard address information that conforms to address standards in the standard address database. The user-entered address fragment is sent to the standard address database for query and matching to obtain the matching result. The method can also label the multiple standard address information that are matched based on the matching result.
[0075] Subsequently, based on the annotations on multiple standard address information in the standard address database, these standard address information are recalled to obtain multiple first candidate address information.
[0076] Then, similarity calculation is performed. The first similarity calculation result is obtained by summing the similarity based on edit distance and the speech similarity based on pinyin.
[0077] For example, similarity calculation based on edit distance can be performed in, but is not limited to, the following ways:
[0078] The number of edit steps required to determine the distance between the input address fragment and the first candidate address information field is used to obtain the difference between the two fields, and then the similarity is calculated. For example, if it takes one step to change the field information from the input address fragment to the field information in the first candidate address information, changing one word, and the field information in the input address fragment has four words, the calculated difference is 0.25, while the similarity is 0.75.
[0079] For example, semantic similarity calculation based on pinyin can be performed in, but is not limited to, the following ways:
[0080] This paper utilizes existing automatic pinyin annotation technology to automatically annotate the first candidate address information in the input address segment. Following the rules of Hanyu Pinyin, the annotated pinyin is separated into initials and finals. Then, the pinyin corresponding to the input address segment and the first candidate address information is encoded using the bag-of-words model. The encoding results are then compared for similarity to obtain a semantic similarity result based on pinyin.
[0081] Finally, based on the first similarity calculation result with the highest similarity, the input address fragment is completed and corrected to obtain the first address information processing result that meets the user's actual needs.
[0082] Based on the above implementation methods, such as Figure 2 As shown, prior to step 101, the address information processing method provided in this application further includes:
[0083] Step 105: Standardize the original address segment corresponding to the input address segment to obtain the input address segment.
[0084] Specifically, the address information processing method provided in this application can also perform standardization processing on the input address fragment, including but not limited to unifying the case of the original address fragment, unifying full-width and half-width characters, and removing whitespace characters, thereby eliminating noise in the original address fragment to obtain the input address fragment.
[0085] The address information processing method provided in this application obtains noise-free input address segments by standardizing the original address segments, thereby avoiding interference from noise on subsequent querying, matching, and similarity calculation of the input address segments.
[0086] Based on the above implementation methods, such as Figure 3 As shown, prior to step 101, the address information processing method provided in this application further includes:
[0087] Step 106: Generate a prefix tree based on the standard address information according to the characters;
[0088] Step 107: Generate a mapping between standard address information and the corresponding record index in the address database;
[0089] Step 108: Construct a standard address library based on the prefix tree and mapping.
[0090] Specifically, the address information processing method provided in this application constructs a standard address database using standard address information in a character prefix tree manner. For example, standard address information is extracted from an available address database and stored in a trie structure. All characters from the standard address information are inserted into a trie, with each standard address information representing a path and each character representing a node on that path. Once the prefix tree corresponding to the standard address information is constructed, a mapping between the standard address information and the indices recorded in the standard address database is generated. At this point, the key of the mapping is the standard address information, and the value corresponding to the key is the set of indices corresponding to the standard address information recorded in the standard address database, for subsequent querying and matching of input address fragments in the standard address database.
[0091] The address information processing method provided in this application, by constructing a prefix tree based on characters of standard address information, can perform matching and recall of first candidate address information more quickly compared to existing address information processing methods, thereby improving the working efficiency of the address information processing method.
[0092] Based on the above implementation methods, such as Figure 4 As shown, the matching results include the first matching result. Step 101 in the address information processing method provided in this application includes:
[0093] Step 111: Obtain multiple characters corresponding to the input address fragment;
[0094] Step 112: Enter multiple characters into the standard address database in a pre-set order for querying and generate the first matching result.
[0095] Specifically, the input address fragment is searched character by character from left to right in the standard address database. The search begins at the root node of the trie. Once the root node corresponding to the first character of the input address fragment is found, the search continues along the path under that root node. Then, the second character of the input address fragment is searched along its corresponding path, iterating through all characters in the input address fragment. During the search, all corresponding characters along the path are marked. Finally, the marked characters are searched in the mapping to obtain the first matching result.
[0096] The address information processing method provided in this application improves the efficiency of address information processing by querying the standard address database character by character for input address fragments and utilizing the character prefix tree structure of the standard address database to quickly obtain matching results.
[0097] Based on the above implementation methods, such as Figure 5 As shown, the matching result includes the second matching result. After step 111, the address information processing method provided in this application further includes:
[0098] Step 113: Hierarchically classify the addresses of multiple characters to obtain characters at multiple levels;
[0099] Step 114: Enter the characters of multiple levels into the prefix tree of the corresponding level in the standard address database according to the level order for querying, and generate the second matching result.
[0100] Specifically, the address information processing method provided in this application also classifies the input address fragments and standard address information according to the address administrative division conventions, for example, into four levels: "province," "city," "district / county," and "road, street, alley, town." The "province" level includes provincial addresses such as municipalities, provincial autonomous regions, and special administrative regions, while the "city" level includes municipal units such as autonomous prefectures. When constructing a prefix tree based on the standard address information, address classification and storage are also required, with each standard address information including four levels of field information. In addition, an extra level can be added to represent field information that cannot be matched at the address level.
[0101] During prefix tree construction, each standard address information is divided into four levels of field information, each forming a path in the prefix tree. Similarly, the characters in the field information serve as nodes on the path. To distinguish these four paths, the address level corresponding to the path's endpoint can be marked on the node. To facilitate differentiation between intermediate nodes and the endpoint during matching, the address level is only marked at the endpoint; intermediate nodes are either non-standard or marked empty. When multiple path field information entries in the standard address information are identical but have different address levels, the path can be marked according to the higher address level. When the standard address information contains address levels, mappings need to be generated separately for each different level of field information to facilitate subsequent matching based on level.
[0102] Once the standard address database is constructed, the input address fragments are searched character by character from left to right. The search begins at the root node of the trie. When the root node corresponding to the first character of the input address fragment is found, the search continues along the path under that root node. Then, the search continues along the path corresponding to the second character of the input address fragment, iterating through all characters in the input address fragment. When no next node can be found after a given node, the address level of that node is read, and the search restarts from the root node starting with the next character. During the search, all corresponding characters along the path are marked. Specifically, if the address level exists when reading the node, all fields in the input address fragment located on that path are marked with that address level; otherwise, if the address level does not exist, the corresponding fields in the input address fragment and along that path are marked as non-existent.
[0103] The marked characters are then searched in the mapping according to the address level according to the preset rules. The search results of multiple different address levels are combined and the second matching result is obtained based on the intersection of the search results of multiple different address levels.
[0104] The address information processing method provided in this application reduces the workload of a single match and improves the efficiency of address information completion by hierarchically classifying the input address fragments and standard address information into multiple fields for matching and searching. Furthermore, multiple fields at different levels are mapped and aggregated to obtain search results, and the intersection of these search results serves as the second matching result, reducing the impact of typos in the input address fragments on the second matching result.
[0105] Based on the above implementation methods, such as Figure 6 As shown, step 103 of the address information processing method provided in this application includes:
[0106] Step 131: Construct a bundle search tree according to address level based on multiple first candidate address information;
[0107] Step 132: Calculate the similarity between the first candidate address information and the input address fragment according to the level order to obtain the first similarity calculation result.
[0108] Specifically, the retrieved first-candidate address information is used to construct a bundle search tree from high to low level. Multiple address information at the same address level are displayed in a branching manner on the bundle search tree. In addition, to avoid repeated similarity calculations in subsequent steps, the matching range can be narrowed by adding optional window sizes for address levels, but not limited to this method.
[0109] The similarity calculation method provided in this application can be obtained by summing, but is not limited to, similarity based on edit distance and semantic similarity based on pinyin, thereby avoiding the influence of homophones, misspellings, etc. in the input address fragment on the matching results. The similarity calculation is also performed according to the address level. When the address level is "empty" or does not exist, the corresponding first similarity calculation result is 0.
[0110] The similarity calculation based on edit distance can be performed in, but is not limited to, the following ways:
[0111] The number of edit distance steps between the input address fragment and the field information at the same address level in the first candidate address information is calculated to obtain the difference between the two field information, and then the similarity is obtained. For example, if it takes one step to change the field information from the field information in the input address fragment to the field information in the first candidate address information, changing one word, and the field information in the input address fragment has four words, the calculated difference is 0.25, and the similarity is 0.75.
[0112] The semantic similarity calculation based on pinyin can be performed in, but is not limited to, the following ways:
[0113] This paper utilizes existing automatic pinyin annotation technology to automatically annotate the field information in the input address fragments and the first candidate address information at the same level. Following the rules of Hanyu Pinyin, the annotated pinyin is separated into initials and finals. Then, the pinyin corresponding to the field information in the input address fragments and the first candidate address information is encoded using the bag-of-words model. The encoding results are then compared for similarity to obtain the semantic similarity result based on pinyin.
[0114] The similarity calculation results based on edit distance and the similarity calculation results based on speech are then weighted and summed to obtain the first candidate address information and the first similarity calculation result of the input address segment at this address level.
[0115] The first similarity calculation results calculated from the first candidate address information at multiple levels are summed, and the input address segment is completed and corrected based on the first candidate address information with the highest similarity.
[0116] The address information processing method provided in this application constructs a cluster search tree according to address level and performs similarity calculations separately. The calculation results of multiple address levels are accumulated to obtain the final result, which reduces the complexity of similarity calculation, improves the accuracy of similarity calculation results, and thus improves the accuracy of address information completion.
[0117] Based on the above implementation methods, such as Figure 7 As shown, after step 101, the address information processing method provided in this application further includes:
[0118] Step 109: When the matching result is no match, perform fuzzy matching on the pre-set standard address database based on the input address fragment to obtain multiple second candidate address information from the standard address information;
[0119] Step 110: Calculate the similarity of the input address fragments based on multiple second candidate address information to obtain the second similarity calculation result. The similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0120] Step 115: Complete the address information of the input address segment based on the second candidate address information with the highest similarity calculation result, and obtain the second address information processing result.
[0121] Specifically, when the input address fragment contains unmatched characters, candidate address information is first retrieved based on the matching results of the already matched characters. Then, fuzzy matching is performed on the unmatched characters, and corresponding candidate address information is retrieved based on the fuzzy matching results. The two are combined to form the second candidate address information. Subsequently, the similarity between the input address fragment and the second candidate address information is calculated, and the input address fragment is completed and repaired based on the second candidate address information with the highest similarity. It should be emphasized that the rules for fuzzy matching are derived from common sense regarding address information, and will not be elaborated here.
[0122] The address information processing method provided in this application avoids the problem of difficulty in matching the actual required standard address information when there are typos or other issues in the input address fragment by adding a fuzzy matching action.
[0123] Based on the above implementation methods, such as Figure 8 As shown in the figure, this application also provides a schematic diagram of an address information processing flow.
[0124] The address information processing method provided in this application requires first constructing a standard address library. Address records are obtained from a working address library as standard address information. A prefix tree is constructed from the standard address information according to its characters, and the tree-structured standard address library is output.
[0125] Subsequently, the user-entered address fragments are standardized, for example, by unifying capitalization, standardizing full-width and half-width characters, and removing whitespace characters. The standardized address fragments are then sent to a tree-structured standard address database for querying and matching. Specifically, the query method involves searching for the longest matching path in the standard address database character by character within the input address fragment, generating matching results, and labeling or tagging each character in the input address fragment based on the matching results.
[0126] The characters in the input address fragment are then checked for matchability. If the input address fragment contains unmatchable characters, a fuzzy match is performed according to the rules and categorized by address level. Candidate address information is then retrieved based on the matching and fuzzy match results. If all characters in the input address fragment can be matched in the standard address database, the corresponding candidate address information is retrieved directly based on the field information obtained by segmenting the input address information according to address level.
[0127] Then, a bundle search tree is constructed according to the candidate address information and its level, for example, the bundle search tree is constructed from high to low address level, and the similarity between the field information in the input address fragment and the candidate address information is calculated level by level. Then, the input address fragment is completed and corrected from low to high level according to the address level based on the most similar candidate address information.
[0128] To facilitate understanding of the address information processing method provided in this application, this application provides a detailed description of the address information completion and correction methods in the address information processing method, based on the schematic diagram of the address information completion process and in conjunction with the second embodiment of this application.
[0129] The second embodiment of this application relates to an address information completion method, including:
[0130] First, a tree-structured standard address database is constructed based on the standard address information, organized by character. For example, a standard address is "Beijing, Changping District, Tiantongyuan". This is broken down into multiple segments based on address level: "Beijing", "Changping District", and "Tiantongyuan". These segments can be represented using, but are not limited to, a four-element list, such as "["Beijing", "", "Changping District", "Tiantongyuan"]". If no address information at a corresponding address level exists, it is represented as a blank in the four-element list. A trie is then constructed for this standard address information, organized by character. Each segment in the standard address information generates a branch in the trie. The address level is labeled at the end of each branch. To distinguish between the end point and intermediate nodes, the address level is only labeled at the end point; intermediate nodes have an empty or nonexistent address level. The address level at the end point can be represented by "province" or "p", "city" or "c", "district / county" or "d", or "road, street, alley, town" or "s". Address information that cannot be matched with a specific address level is represented by "n". Multiple different standard address information, after being segmented according to address level, can also generate paths on a trie. For example, "Beijing Changping District Tiantongyuan" and "Beijing Haidian District Zhongguancun Road" can be represented by two lists: "["Beijing", "", "Changping District", "Tiantongyuan"]" and "["Beijing", "", "Haidian District", "Zhongguancun Road"]". Then, as follows... Figure 9 As shown, multiple fragments generate multiple branch paths in a tree structure with the "root" node as the root node. Only one path needs to be generated for the same fragment, resulting in 5 paths. The endpoints of these 5 paths are marked with the corresponding address levels. To facilitate subsequent querying of the input address fragments into the standard address library, it is necessary to generate mappings for multiple address levels. For example, based on "Beijing Changping District Tiantongyuan" and "Beijing Haidian District Zhongguancun Road", the "p" level mapping is generated as "{"Beijing": [0,1]}", where "0" corresponds to the address information "Beijing Changping District Tiantongyuan" and "1" corresponds to the address information "Beijing Haidian District Zhongguancun Road". The "d" level mapping is "{"Changping District": [0], "Haidian District": [1]}", and the "s" level mapping is "{"Tiantongyuan": [0], "Zhongguancun Road": [1]}". The standard address information corresponding to the "c" level is blank, so no corresponding mapping needs to be established. This completes the construction of the standard address library corresponding to these two standard address information. Similarly, all labeled address information is added to the trie to generate the standard address library. It should be noted that in this example, "0" and "1" are only used for index marking and have no order. They can be determined by, but not limited to, the row number where the standard address information is located.
[0131] Secondly, the input address segment is sent to the standard address library for querying and matching, and the corresponding candidate address information is recalled according to the matching result. For example, the input address segment after normalization is "Zhongguancun Road, Beijing". It is sent to the standard address library for querying character by character from left to right, and tags or annotations are added to each character in the input address segment according to the query result. Specifically, when the character "North" finds multiple paths in the standard address library, then the character "Beijing" is sent to the standard address library and further queried for paths among these multiple paths. When the character "City" is sent, it is found that the corresponding node on the path has an address level, which is the end point of the path. According to the corresponding address level "p", the three characters "North", "Beijing", and "City" are annotated. Then the subsequent character "Middle" is sent to the standard address library to start querying and matching again. Finally, the annotation corresponding to "Zhongguancun Road, Beijing" is "pppssss". Subsequently, queries are made separately in the address mappings of "Beijing" and "Zhongguancun Road" to the corresponding levels, and the "["Beijing", "", "Changping District", "Tiantongyuan"]" and "["Beijing", "", "Haidian District", "Zhongguancun Road"]" matched at the "p" level and the "["Beijing", "", "Haidian District", "Zhongguancun Road"]" matched at the "s" level are obtained. Then the intersection is taken to obtain the candidate address information "["Beijing", "", "Haidian District", "Zhongguancun Road"]". If there is only one candidate address information, the input address segment is completed and corrected according to the candidate address information.
[0132] When there are errors such as homophones and typos in the input address segment, for example, the input address segment is "Changping District, Tiantongyuan", and the standard address information is only "Tiantongyuan, Changping District, Beijing" and "Zhongguancun Road, Haidian District, Beijing", and the label is "nnnsss", where "nnn" has no matching segment, and the matching result of "sss" is only "Tiantongyuan". Therefore, the input address segment is completed and corrected with the standard address information "Tiantongyuan, Changping District, Beijing".
[0133] When there are multiple matching candidate address information, these candidate address information can be recalled through fuzzy matching. For example, the input address segment is "Fenggang Town, Dongguan City, Toyota Garden". According to the preset fuzzy matching rules, there are two standard address information "Fenggang Town, Dongguan City, Guangdong Province" and "Xiegang Town, Dongguan City, Guangdong Province", and these two standard address information are recalled as candidate address information. It should be emphasized that the fuzzy matching rules are compiled according to the common sense of address information and will not be elaborated here.
[0134] Then, the similarity between each of the multiple candidate address information and the input address segment is calculated. For example, the multiple candidate address information includes "Changping District, Beijing", "Haidian District, Beijing", "Zhuhai City, Guangdong Province", "Futian District, Shenzhen City, Guangdong Province", and "Luohu District, Shenzhen City, Guangdong Province", such as Figure 10 As shown, a beam search tree can be constructed to reduce the number of similarity calculations, and an optional window size can be set for each level to narrow the matching range.
[0135] The calculation of similarity includes the similarity calculation based on the edit distance and the semantic similarity calculation based on pinyin. For example, in the similarity calculation based on the edit distance, the input address segment is "Fenggang Town, Dongguan City", and "Toyota Garden" below the "s" level is temporarily omitted. The two candidate address information are "Fenggang Town, Dongguan City, Guangdong Province" and "Xiegang Town, Dongguan City, Guangdong Province". They are divided into multiple segments according to the address level. The input address segments at the "p" level and "d" level are empty, and the similarity is 0. The input address segments at the "c" level are the same as the candidate address information, and the similarity is 1. The edit distance from the input address segment at the "s" level to the two candidate address information is 1 step, and there are 3 characters in the input address segment at the "s" level. Therefore, the difference degree based on the edit distance calculated for the two candidate address information is 0.33, and the similarity calculation results are both 0.67.
[0136] Subsequently, the semantic similarity based on pinyin is calculated. The existing automatic pinyin annotation technology is used to phonetically annotate the input address segment and the two candidate address information. "Fenggang Town" is "feng gang zhe", "Fenggang Town" is "feng gangzhen", and "Xiegang Town" is "xie gang zhen", and the initials and finals are separated respectively, obtaining the corresponding "f eng gang zh en", "f eng g ang zh en" and "x ie g ang zh en". Subsequently, the pinyin after the separation of the initials and finals is encoded and the similarity is calculated according to the method of the bag-of-words model, which are respectively "{1,1,1,1,1,1,0,0}", "{1,1,1,1,1,1,0,0}" and "{0,0,1,1,1,1,1,1}". Subsequently, the similarity between the input address segment and the vectors of the two candidate address information can be calculated through calculation methods including but not limited to the vector cosine similarity. The similarity between the input address segment "Fenggang Town" and the first candidate address information "Fenggang Town" is 1, and the similarity between the input address segment "Fenggang Town" and the second candidate address information "Xiegang Town" is 0.67.
[0137] For example, the calculation of the vector cosine similarity is shown in Equation 1:
[0138]
[0139] As shown in Equation 1, A i and B iThe input address segment is divided into two vectors. The cosine similarity between the two vectors is calculated and compared. In this application, the vector of the input address segment and the vectors of the two candidate address information are substituted into the formula to calculate the similarity between the input address segment and the first candidate address information and the second candidate address information, respectively.
[0140] After obtaining the similarity calculation results based on edit distance and the semantic similarity calculation results based on pinyin, the first similarity result between the two candidate address information and the input address segment is obtained according to a pre-set weighted calculation formula. The weighted calculation can be adjusted by setting weighting parameters, but not limited to this method. When the weighting parameter corresponding to pinyin increases, the weighting parameter corresponding to edit distance decreases, and the first similarity result focuses more on pinyin, which can eliminate more interference from speech errors in the input address segment. Conversely, when the weighting parameter corresponding to pinyin decreases, the weighting parameter corresponding to edit distance increases, which is more likely to find the most similar candidate address information when there are no pinyin errors.
[0141] For example, the first similarity calculation is shown in Equation 2:
[0142] F=α×Pscore+(1-α)×Lscore (2)
[0143] As shown in Equation 2, F represents the final calculated first similarity score, Pscore represents the semantic similarity score calculated based on pinyin, Lscore represents the semantic similarity score calculated based on edit distance, and α is the difference parameter, which can be selected from 0 to 1. Its value can be adjusted according to the actual number of errors. When the value of α is larger, the score is more biased towards pinyin similarity, which can avoid more speech recognition errors; conversely, it places more trust on semantic similarity itself.
[0144] Finally, the first similarity calculation results of multiple levels are summed for each candidate address information, and the one with the highest similarity can be used to complete and correct the information of the input address fragment. In addition, address information completion can be performed first based on the first four address levels, and then the input address fragments below the "s" level, such as "Toyota Garden", are added to the first address information completion result.
[0145] The third embodiment of this application relates to an address information processing apparatus, such as... Figure 11 As shown, it includes:
[0146] The first matching module 121 is used to match the input address fragment against a pre-set standard address database and obtain the matching result;
[0147] The first candidate acquisition module 122 is used to acquire multiple first candidate address information from the standard address information based on the matching result;
[0148] The first calculation module 123 is used to perform similarity calculation on the input address fragment based on multiple first candidate address information to obtain the first similarity calculation result, wherein the similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin.
[0149] The first completion module 124 is used to complete the address information of the input address segment based on the first candidate address information with the highest similarity calculation result, and obtain the first address information processing result.
[0150] Based on the above implementation methods, such as Figure 12 As shown, the address information processing apparatus provided in this application further includes:
[0151] The standardization processing module 125 is used to standardize the original address segment corresponding to the input address segment to obtain the input address segment.
[0152] Based on the above implementation methods, such as Figure 13 As shown, the address information processing method provided in this application also includes:
[0153] Prefix tree generation module 126 is used to generate a prefix tree based on standard address information according to characters;
[0154] The mapping generation module 127 is used to generate a mapping between an address and a corresponding record index in the address database based on standard address information;
[0155] Address library construction module 128 is used to build a standard address library based on the prefix tree and mapping.
[0156] Based on the above implementation methods, such as Figure 14 As shown, the first matching module 121 includes:
[0157] The character acquisition unit 129 is used to acquire multiple characters corresponding to the input address segment;
[0158] The first query unit 130 is used to enter multiple characters into the prefix tree of the standard address library in a pre-set order for querying and to generate matching results.
[0159] Based on the above implementation methods, such as Figure 15 As shown, the first matching module 121 further includes:
[0160] Address hierarchy unit 141 is used to hierarchically classify the addresses of multiple characters to obtain characters at multiple levels;
[0161] The second query unit 142 is used to query the prefix tree of the corresponding level in the standard address library according to the level order of characters at multiple levels, and generate matching results.
[0162] Based on the above implementation methods, such as Figure 16 As shown, the first calculation module 123 includes:
[0163] The cluster search unit 143 is used to construct a cluster search tree according to the level based on multiple first candidate address information;
[0164] The similarity calculation unit 144 is used to perform similarity calculation on the first candidate address information and the input address fragment according to the level order to obtain the first similarity calculation result.
[0165] Based on the above implementation methods, such as Figure 17 As shown, the address information processing apparatus provided in this application further includes:
[0166] The fuzzy matching module 145 is used to perform fuzzy matching on a pre-set standard address library based on the input address fragment when the matching result is unmatchable, and to obtain multiple second candidate address information from the standard address information.
[0167] The second calculation module 146 is used to perform similarity calculation on the input address segment based on multiple second candidate address information to obtain the second similarity calculation result, wherein the similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin;
[0168] The second completion module 147 is used to complete the address information of the input address segment based on the second candidate address information with the highest similarity calculation result, and obtain the second address information processing result.
[0169] The fourth embodiment of this application relates to a mobile terminal, such as... Figure 18 As shown, it includes:
[0170] At least one processor 161; and,
[0171] Memory 162 communicatively connected to the at least one processor 161; wherein,
[0172] The memory 162 stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor 161 to enable the at least one processor 161 to implement the address information processing method described in the first embodiment of this application.
[0173] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0174] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0175] The fifth embodiment of this application relates to a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the address information processing method described in the first embodiment of this application.
[0176] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0177] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0178] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for processing address information, characterized in that, The method includes: The system matches the input address fragment against a pre-set standard address database and obtains the matching result. The standard address database stores standard address information. Based on the matching result, obtain multiple first candidate address information from the standard address information; The similarity calculation of the input address fragment is performed based on multiple first candidate address information to obtain a first similarity calculation result, wherein the similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin; Based on the first candidate address information with the highest similarity calculation result, the input address segment is filled with address information to obtain the first address information processing result; Before matching the input address fragment against a pre-set standard address database and obtaining the matching result, the process also includes: Generate a prefix tree based on the standard address information according to the characters; Generate a mapping between the standard address information and the corresponding record index in the address database; The standard address library is constructed based on the prefix tree and the mapping. The matching result includes a first matching result, and the step of matching the input address fragment against a pre-set standard address database and obtaining the matching result includes: Obtain multiple characters corresponding to the input address fragment; The multiple characters are entered into the standard address database in a pre-set order for querying, and the first matching result is generated; The matching result includes a second matching result, and after obtaining the multiple characters corresponding to the input address fragment, the process further includes: By hierarchically classifying the addresses of multiple characters, we can obtain characters at multiple levels. The characters at the multiple levels are entered into the prefix tree of the corresponding level in the standard address database according to the level order for querying, and the second matching result is generated.
2. The method according to claim 1, characterized in that, Before matching the input address fragment against a pre-set standard address database and obtaining the matching result, the process also includes: The input address segment is obtained by standardizing the original address segment corresponding to the input address segment.
3. The method according to claim 1, characterized in that, The step of calculating the similarity of the input address segment based on multiple first candidate address information to obtain the first similarity calculation result includes: A bundle search tree is constructed according to the levels based on multiple first candidate address information; The similarity calculation results are obtained by performing similarity calculations on the first candidate address information and the input address fragment according to the level order.
4. The method according to claim 1, characterized in that, The step of matching the input address fragment against a pre-set standard address database and obtaining the matching result, wherein after the standard address database stores standard address information, it further includes: When the matching result is no match, a fuzzy match is performed on the pre-set standard address library based on the input address fragment to obtain multiple second candidate address information from the standard address information; The similarity calculation of the input address fragment is performed based on multiple second candidate address information to obtain a second similarity calculation result, wherein the similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin; The input address fragment is filled with address information based on the second candidate address information with the highest similarity calculation result to obtain the second address information processing result.
5. An address information processing device, characterized in that, include: The first matching module is used to match the input address fragment against a pre-set standard address database and obtain the matching result; The first candidate acquisition module is used to acquire multiple first candidate address information from the standard address information based on the matching result; The first calculation module is used to perform similarity calculation on the input address fragment based on multiple first candidate address information to obtain a first similarity calculation result, wherein the similarity calculation includes similarity calculation based on edit distance and semantic similarity calculation based on pinyin. The first completion module is used to complete the address information of the input address segment based on the first candidate address information with the highest similarity calculation result, and obtain the first address information processing result. The device further includes: The prefix tree generation module is used to generate a prefix tree based on standard address information according to characters; The mapping generation module is used to generate mappings between addresses and corresponding record indices in the address database based on standard address information; The address library construction module is used to build a standard address library based on the prefix tree and mapping. The first matching module includes: The character acquisition unit is used to acquire multiple characters corresponding to the input address fragment; The first query unit is used to enter multiple characters into the prefix tree of the standard address library in a pre-set order for querying and to generate matching results; Based on the above implementation method, the first matching module further includes: Address hierarchy unit is used to classify the addresses of multiple characters to obtain characters at multiple levels; The second query unit is used to search for characters at multiple levels in the corresponding prefix tree of the standard address database according to the level order, and generate matching results.
6. A mobile terminal, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to implement the address information processing method according to any one of claims 1-4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the address information processing method according to any one of claims 1-4.
Citation Information
Patent Citations
Address matching method and device, electronic equipment and storage medium
CN112818685A
Retrieval and completion method and system based on place name address database
CN114780680A