Retrieval and completion method and system based on place name and address database

By constructing a place name and address database and a knowledge graph, and utilizing the BERT+BILSTM+CRF algorithm and the conversion of similar-sounding and similar-looking characters, the problems of excessive information and user input errors in address retrieval were solved, achieving more accurate address retrieval and completion.

CN114780680BActive Publication Date: 2024-11-08HENAN SHUHUI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210421308.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-21
Publication Date
2024-11-08
Estimated Expiration
2042-04-21

AI Technical Summary

Technical Problem

Existing address retrieval systems suffer from excessive and incomplete information, and user input errors lead to inaccurate search results, making it difficult to meet user needs.

Method used

A place name and address database and knowledge graph are constructed. The BERT+BILSTM+CRF algorithm is used for word segmentation and classification. By combining the conversion of homophones and similar-looking characters, the similarity between place names and addresses is calculated, and erroneous input is corrected and address information is completed.

Benefits of technology

It improves the accuracy and efficiency of address retrieval, scientifically measures the semantic similarity between the results and user input, reduces irrelevant information, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114780680B_ABST
    Figure CN114780680B_ABST
Patent Text Reader

Abstract

The present invention discloses a retrieval and completion method and system based on a place name and address database, the method comprising: constructing a place name and address database; constructing a knowledge graph of the place name and address database; determining the input type according to the input search content; if the input type is a place name, searching for similar place names of the input place name, calculating the overall similarity of the place names of the similar place names found, sorting the place names from large to small according to the overall similarity of the place names and returning; if the input type is an address, performing word segmentation and address entity label determination based on the input search content, removing the address word segmentation results of the three levels of province, city and county, correcting the wrong input of the address below the county level, completing the place name entity information from province to the smallest, correcting it based on the time attribute of the ownership relationship, calculating the overall similarity of the address, and sorting the address from large to small according to the overall similarity of the address and returning it. The present invention can effectively solve the problems of excessive amount of returned information and incomplete information existing in the existing address search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of geographic information retrieval and completion, and in particular relates to a retrieval and completion method and system based on a place name and address database. Background Art

[0002] In order to promote the information integration of the national civil affairs, public security, industry and commerce, natural resources and other departments, surveys and database construction of place name and address data have been carried out across the country. At present, the work of place name and address in the country has entered the final stage, and most provinces, cities and counties have basically completed the construction of the database. Retrieval query and a small number of place name and address completion work have become very important aspects of subsequent applications. Traditional retrieval work is basically applied keyword query. For such a huge database, the amount of information returned by keywords is too large, and most of it is not the information needed by users. The standard of full-text matching is too "hard", and it is difficult for users to accurately remember the specific information of a place name or address. In addition, when users enter search information, there are inevitably missing words, typos, incomplete information, and old address names. The above two methods are difficult to meet today's needs. In addition, due to the large amount of address data, omissions are inevitable. Summary of the invention

[0003] Aiming at the problems of excessive amount of returned information and incomplete information in existing address retrieval, the present invention proposes a retrieval and completion method and system based on a place name and address database.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] The present invention provides a method for searching and completing a place name and address database, comprising:

[0006] Step A, constructing a place name address database; the database includes: administrative area place names, street lane names or community names, landmark names, house numbers or points of interest names, and addresses composed of place names at all levels;

[0007] Step B, constructing a knowledge graph of a place name and address database; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets, lanes, community groups, landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of a standard address composed of specific place names, and the equivalent relationship between place names and nicknames; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period of the ownership relationship;

[0008] Step C, determining the input type according to the input search content; the input type includes a place name and an address;

[0009] Step D: if the input type is a place name, then search for similar place names to the input place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them;

[0010] Step E: If the input type is an address, segmentation and address entity label determination are performed based on the input search content, the address segmentation results at the province, city, and county levels are removed, incorrect address input below the county level is corrected, and entity information from the province to the smallest place name is completed. The input search content is corrected based on the time attribute of the ownership relationship, the overall address similarity is calculated, and the addresses are sorted from large to small according to the overall address similarity and returned.

[0011] Further, the step C comprises:

[0012] The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.

[0013] Further, the step D comprises:

[0014] Step D1, matching based on the original sentence of the search content, the conversion of similar-sounding characters and similar-shaped characters, to find similar place name candidates of the input place name; wherein the conversion of similar-sounding characters is matched based on the pypinyin library and the dictionary library of similar-sounding characters of place names constructed by the place name address database; the conversion of similar-shaped characters is matched based on the dictionary library of similar-shaped characters and the dictionary library of similar-shaped characters of place names constructed by the place name address database;

[0015] Step D2, changing the matched alias result to a standard place name;

[0016] Step D3, removing the place names at the three levels of province, city and county that are matched by converting the characters with similar pronunciation and similar appearance;

[0017] Step D4, calculating the similarity a of the converted characters with similar pronunciations. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all the converted characters with similar pronunciations is greater than 0, a is the reciprocal of the sum of the edit distances of all the converted characters with similar pronunciations plus 1, otherwise a is 1.

[0018] Step D5, calculating the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1.

[0019] Step D6, taking the product of the similarity a after the conversion of the phonetically similar characters and the similarity b after the conversion of the geometrically similar characters as the overall similarity c of the place name:

[0020] c = a × b;

[0021] Step D7, sorting the place names from large to small according to their overall similarity. If the overall similarity of the place names is less than the set threshold, the corresponding place name candidates are removed, and the remaining place name candidates are returned as search results.

[0022] Further, the step E comprises:

[0023] Step E1, using BERT+BILSTM+CRF algorithm to segment the input search content, and using phonetic similarity conversion and shape similarity conversion to obtain multiple segmentation results;

[0024] Step E2, determining the address entity label: matching the knowledge graph of the place name address database according to the word segmentation results to obtain the corresponding word-level label, wherein the matched alias entity is converted into the standard entity related thereto, and the unique subgraph of the address entity set that can satisfy the combination order of the urban or rural standard address label is taken as the candidate address segmentation result;

[0025] Step E3, removing the candidate address segmentation results of the three levels of province, city and county obtained by converting similar-sounding characters and similar-looking characters;

[0026] Step E4, correcting incorrect input of addresses below the county level: when the candidate address segmentation result corresponding to the original search content is empty, delete the street or village address entity and obtain a unique subgraph as the candidate address segmentation result;

[0027] Step E5, completing the place name and address database based on reasoning verification: when the candidate address segmentation result is empty and the input address information structure is complete, the specific address entity is obtained and the location is close to the specific address, and the input information is inferred to be correct. If correct, the segmentation result and the detailed address are stored in the place name and address database, and the place name and address database knowledge graph, the place name pronunciation dictionary, and the place name shape dictionary are linked and updated, and the segmentation result is used as the candidate address segmentation result;

[0028] Step E6, complete the address: use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name;

[0029] Step E7, correcting the input address based on the time attribute of the ownership relationship: for the entity paths at all levels, for the ownership relationship from the lower level to the upper level, if the time attribute is before, the upper level entity is replaced by the associated entity whose time attribute from the lower level to the upper level is now;

[0030] Step E8, sorting:

[0031] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0032] Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1.

[0033] Calculate the completion similarity d. When the number of entities continuously completed by the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed by the subgraph, otherwise d is 1;

[0034] The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e:

[0035] e = a × b × d;

[0036] The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the address is less than the set threshold, the corresponding address candidate is removed and the remaining address candidates are returned as search results.

[0037] Another aspect of the present invention provides a retrieval and completion system based on a place name and address database, comprising:

[0038] A place name and address database construction module is used to construct a place name and address database; the database includes: administrative area place names, street and lane names or community names, landmark names, house numbers or points of interest, and addresses composed of place names at all levels;

[0039] A knowledge graph construction module is used to construct a knowledge graph of a place name and address database; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets and lanes, community groups, landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of a standard address composed of specific place names, and the equivalent relationship between place names and nicknames; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period in which the ownership relationship exists;

[0040] An input type determination module, used to determine the input type according to the input search content; the input type includes a place name and an address;

[0041] A place name search module is used to find similar place names to the input place name if the input type is a place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them;

[0042] The address search completion module is used to perform word segmentation and address entity label determination based on the input search content if the input type is an address, remove the address word segmentation results at the province, city, and county levels, correct incorrect address input below the county level, complete the entity information from the province to the smallest place name, correct the input search content based on the time attribute of the ownership relationship, calculate the overall similarity of the address, and return it after sorting it from large to small according to the overall similarity of the address.

[0043] Furthermore, the input type determination module is specifically used for:

[0044] The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.

[0045] Furthermore, the place name retrieval module is specifically used for:

[0046] Based on the original sentence of the search content, the conversion of similar sound characters and similar shape characters is matched to find similar place name candidates of the input place name; the conversion of similar sound characters is matched based on the pypinyin library and the dictionary library of similar sound characters of place names constructed by the place name address database; the conversion of similar shape characters is matched based on the dictionary library of similar shape characters and the dictionary library of similar shape characters of place names constructed by the place name address database;

[0047] Change the matched alias results to standard place names;

[0048] Remove the place names at the province, city and county levels that are matched by the conversion of similar-sounding characters and similar-looking characters;

[0049] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0050] Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1. The product of the similarity a of the converted characters and the similarity b of the converted characters is taken as the overall similarity c of the place name:

[0051] c = a × b;

[0052] Place names are sorted from large to small according to their overall similarity. If the overall similarity of a place name is less than the set threshold, the corresponding place name candidate is removed and the remaining place name candidates are returned as search results.

[0053] Furthermore, the address search and completion module is specifically used for:

[0054] The BERT+BILSTM+CRF algorithm is used to segment the input search content, and multiple segmentation results are obtained by converting similar-sounding characters and similar-shaped characters.

[0055] Determine the address entity label: match the knowledge graph of the place name and address database according to the word segmentation results to obtain the corresponding word-level labels, where the matched alias entities are converted into standard entities related to them, and the unique subgraph of the address entity set that can meet the combination order of urban or rural standard address labels is taken as the candidate address segmentation result;

[0056] Remove the candidate address segmentation results at the province, city, and county levels obtained by converting similar-sounding characters and similar-looking characters;

[0057] Correct incorrect input of addresses below the county level: When the candidate address segmentation result corresponding to the original search content is empty, delete the address entity of the street or village and obtain the only sub-graph as the candidate address segmentation result;

[0058] Completing the place name and address database based on reasoning verification: When the candidate address segmentation result is empty and the input address information structure is complete, the specific address entity is obtained and the location is close to the specific address, and the input information is inferred to be correct. If correct, the segmentation result and the detailed address are stored in the place name and address database. At the same time, the knowledge graph of the place name and address database, the dictionary library of place name phonetic characters, and the dictionary library of place name morphological characters are linked and updated, and the segmentation result is used as the candidate address segmentation result;

[0059] Complete the address: Use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name;

[0060] Correct input addresses based on the time attribute of ownership relationship: For entity paths at all levels, for ownership relationships from subordinate to superior, if the time attribute is before, the superior entity is replaced by the associated entity whose time attribute is now from the subordinate to superior;

[0061] Sorting:

[0062] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0063] Calculate the similarity b of the place names after conversion of similar characters. If the number of strokes of the converted character is the same as that of the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all similar characters after conversion is greater than 0, b is the reciprocal of the sum of the distances of all similar characters after conversion plus 1, otherwise b is 1;

[0064] Calculate the completion similarity d. When the number of entities continuously completed by the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed by the subgraph, otherwise d is 1;

[0065] The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e:

[0066] e = a × b × d;

[0067] The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the address is less than the set threshold, the corresponding address candidate is removed and the remaining address candidates are returned as search results.

[0068] Compared with the prior art, the present invention has the following beneficial effects:

[0069] The present invention first constructs a place name and address database; then constructs a place name and address database knowledge graph; and determines the input type according to the input search content; if the input type is a place name, then find similar place names of the input place name, and calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place name and return; if the input type is an address, then perform word segmentation and address entity label determination based on the input search content, remove the address word segmentation results of the three levels of province, city and county, correct the wrong input of the address below the county level, complete the place name entity information from province to the smallest, correct it based on the time attribute of the ownership relationship, calculate the overall similarity of the address, and sort it from large to small according to the overall similarity of the address and return. The present invention proposes a place name and address similarity calculation method, which can scientifically measure the semantic similarity between the returned result and the user input content, and further sort the results so that the results closer to the user's intention are more advanced. The present invention adopts a reasoning method to check and fill in the gaps of a large number of place names and addresses in real time based on the user's knowledge. The present invention has multiple levels of response measures when the returned result is empty due to insufficient user cognition. The present invention can effectively solve the problems of excessive amount of returned information, incomplete information, user input errors, etc. in the existing address search. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A basic flow chart of a retrieval and completion method based on a place name and address database according to an embodiment of the present invention;

[0071] Figure 2 This is an example diagram of a knowledge graph of a place name and address database constructed based on a retrieval and completion method of a place name and address database according to an embodiment of the present invention;

[0072] Figure 3 The present invention is a schematic diagram of the architecture of a retrieval and completion system based on a place name and address database according to an embodiment of the present invention. DETAILED DESCRIPTION

[0073] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:

[0074] like Figure 1 As shown, a retrieval and completion method based on a place name and address database includes:

[0075] Step A, constructing a place name and address database; specifically, refer to CH / Z 9002-2007 "Digital City Geographic Spatial Information Public Platform Place Name / Address Classification, Description and Coding Rules", the first section is the administrative region place name (province / city / county (district), township (street) / village (community) can be omitted), the second section is the street name or community name, and the third section is the landmark name, house number or point of interest name; it is worth noting that all three sections must not be empty at the same time; construct a place name and address database based on MySQL; specifically, the place name table and address table are shown in Table 1 and Table 2 respectively.

[0076] Table 1 Place name list (partial examples)

[0077]

[0078]

[0079] Table 2 Address table (partial example)

[0080]

[0081]

[0082] Step B, constructing a place name and address database knowledge graph, i.e., a place name and address graph database, such as Figure 2 As shown; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets and lanes, community groups (community, natural village, team, group), landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of standard addresses composed of specific place names, and the equivalent relationship between place names and nicknames; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, and the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period of the ownership relationship; specifically, the place name and address graph database of the present invention is the native graph database neo4j.

[0083] 1) The standard city address format is usually:

[0084] Administrative division (province, city, county, street) + street lane (street, road, lane, urban village) + house number + community group (community, building) + building row number

[0085] 2) The composition of the rural standard address varies depending on whether the administrative village is divided into districts, groups, teams or natural villages. For administrative villages with districts, groups, teams or natural villages, the rural standard address composition is as follows:

[0086] Administrative division (province, city, county, district) + township + street (administrative village) + community group (natural village, team, group) + building number;

[0087] For rural administrative villages without districts, groups, teams or natural villages, the standard address composition is generally:

[0088] Administrative division (province, city, county, district) + township (street) + street (administrative village) + house number.

[0089] Specifically, the alias entities come from the place name and address database and are manually created; the time attribute information corresponding to the ownership relationship of the administrative divisions comes from the official website of the administrative department and other similar websites.

[0090] Step C, determining the input type according to the input search content; the input type includes place name and address.

[0091] Step D: If the input type is a place name, then find similar place names to the input place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them.

[0092] Step E: If the input type is an address, segmentation and address entity label determination are performed based on the input search content, the address segmentation results at the province, city, and county levels are removed, incorrect address input below the county level is corrected, and entity information from the province to the smallest place name is completed. The input search content is corrected based on the time attribute of the ownership relationship, the overall address similarity is calculated, and the addresses are sorted from large to small according to the overall address similarity and returned.

[0093] Further, the step C comprises:

[0094] The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.

[0095] Specifically, the step C comprises:

[0096] According to the characteristics of place names and addresses, we first segment words and then classify them using the decision tree method. For example, an address contains the characteristics of administrative divisions and the combination of place names in the second and third segments, and a place name is one of the components of a single address.

[0097] The word segmentation algorithm uses the BERT+BILSTM+CRF algorithm. The BERT pre-trained model is used to convert words into word vectors as input, and a network training model consisting of a bidirectional long short-term memory network and a conditional random field is selected to predict the word segmentation results. The decision tree is used for classification, and the final classification results have two categories, namely single place names and addresses.

[0098] Further, the step D comprises:

[0099] Step D1, based on the original sentence of the search content, similar-sounding characters and similar-shaped characters conversion, matching is performed to find similar place name candidates of the input place name; specifically, the similar-sounding character conversion is matched using a place name similar-sounding character dictionary library constructed based on the pypinyin library and the collected and sorted place name and address database (specifically, a place name table); the similar-shaped character conversion is matched based on a place name similar-shaped character dictionary (specifically, based on the electronic version of the book "Dictionary of Similar-shaped Characters" compiled by Ran Hong and published by Foreign Language Teaching and Research Press) and a place name and address database (specifically, a place name table).

[0100] Specifically, the construction process of the dictionary library of phonetic characters of place names is as follows: first, use the Python language based on the pypinyin library to convert the place names in the place name table into corresponding pinyin, and perform conversion on flat and retroflex consonants and front and back nasal sounds to obtain the pinyin of the phonetic characters corresponding to the place names, thereby forming a dictionary library of phonetic characters of place names.

[0101] Specifically, the construction process of the dictionary library of similar characters for place names is as follows: first, the similar characters corresponding to the place names in the place name table are matched based on the dictionary of similar characters to obtain the similar characters corresponding to the place names, and the matched similar characters are spliced ​​in the order of the Chinese characters corresponding to the place names to obtain the similar characters for the place names; through the above method, the similar characters for the place names corresponding to the various place names are finally obtained, thereby forming a dictionary library of similar characters for place names.

[0102] Step D2, changing the matched alias result to a standard place name;

[0103] Step D3, considering that the probability of incorrect input of the administrative division province, city, and county level is relatively small, the place names of this level that are matched by converting similar-sounding characters and similar-looking characters are removed;

[0104] Step D4, calculating the similarity a of the converted characters with similar pronunciations. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all the converted characters with similar pronunciations is greater than 0, a is the reciprocal of the sum of the edit distances of all the converted characters with similar pronunciations plus 1, otherwise a is 1.

[0105] Step D5, calculating the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1.

[0106] Step D6, taking the product of the similarity a after the conversion of the phonetically similar characters and the similarity b after the conversion of the geometrically similar characters as the overall similarity c of the place name:

[0107] c = a × b;

[0108] Step D7, sorting the place names from large to small according to their overall similarity. If the overall similarity of the place names is less than the set threshold, the corresponding place name candidates are removed, and the remaining place name candidates are returned as search results.

[0109] Further, the step E comprises:

[0110] Step E1, use the BERT+BILSTM+CRF algorithm to segment the input search content, and use the conversion of similar-sounding characters and similar-shaped characters to obtain multiple segmentation results.

[0111] Step E2, address entity label determination: match the knowledge graph of the place name and address database according to the word segmentation results to obtain the corresponding labels at the word level, where the matched alias entities are converted into standard entities related to them (i.e. entities other than alias entities), and the unique subgraph of the address entity set that can meet the combination order of urban or rural standard address labels is taken as the candidate address segmentation result.

[0112] Step E3, further screening, because the probability of incorrect input of entities at the administrative division level of province, city, and county is relatively small, the candidate address segmentation results at the three levels of province, city, and county obtained by converting similar-sounding characters and similar-looking characters are removed.

[0113] Step E4, correcting incorrect input of addresses below the county level: Since users often have unclear judgments about the ownership of a certain place, they often input incorrect administrative division ownership. For example, it is common to input No. 100 Beihuan Road, Beilin Road Street, Jinshui District, Zhengzhou City as No. 100 Beihuan Road, Wenhua Road Street, Jinshui District, Zhengzhou City. Therefore, it is necessary to correct this problem. Since the possibility of inputting specific address entities at the county level and above is small, address entities below the county level are corrected. Therefore, when the candidate address segmentation result of the original search content is empty, delete the address entity of the street or village, and obtain a unique subgraph as the candidate address segmentation result. If there are place names such as community names, landmark names, and points of interest, delete the address entities of the street, village, and house number, and obtain a unique subgraph as the candidate address segmentation result.

[0114] Step E5, complete the place name and address database based on reasoning verification: when the candidate address segmentation result is empty and the input address information structure is complete (except for the provincial level), obtain the specific address close to the location according to the specific address entity, such as No. 100, Beihuan Road, Beilin Road Street, Jinshui District, Zhengzhou City, and search the place name and address database to see whether No. 101, Beihuan Road, Beilin Road Street, Jinshui District, Zhengzhou City and No. 99, Beihuan Road, Beilin Road Street, Jinshui District, Zhengzhou City exist. Then, it can be inferred whether the input information is correct. If correct, the segmentation result and the detailed address are stored in the place name and address database. At the same time, the place name and address database knowledge graph (place name and address graph database), the place name phonetic dictionary, and the place name morphological dictionary are linked and updated, and the segmentation result is used as the candidate address segmentation result.

[0115] Step E6, complete the address: use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name.

[0116] Step E7, correct the input address based on the time attribute of the ownership relationship: With the change of time, the ownership relationship of administrative divisions will change. Many searchers are not very clear about this information, and the search is still the old ownership relationship. Therefore, it is necessary to correct the search content based on the time attribute. For the entity paths at all levels, for the ownership relationship from the subordinate to the superior, the time attribute is before, and the superior entity is replaced by the associated entity with the time attribute of now from the subordinate to the superior.

[0117] Step E8, sorting:

[0118] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0119] Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1.

[0120] Calculate the completion similarity d. When the number of entities continuously completed by the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed by the subgraph, otherwise d is 1;

[0121] The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e:

[0122] e = a × b × d;

[0123] The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the addresses is less than the set threshold, the corresponding address candidates are removed, and the remaining address candidates are returned as search results. Figure 3 As shown, the present invention further provides a retrieval and completion system based on a place name and address database, comprising:

[0124] A place name and address database construction module is used to construct a place name and address database; the database includes: administrative area place names, street and lane names or community names, landmark names, house numbers or points of interest, and addresses composed of place names at all levels;

[0125] A knowledge graph construction module is used to construct a knowledge graph of a place name and address database; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets and lanes, community groups, landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of a standard address composed of specific place names, and the equivalent relationship between place names and nicknames; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period in which the ownership relationship exists;

[0126] An input type determination module, used to determine the input type according to the input search content; the input type includes a place name and an address;

[0127] A place name search module is used to find similar place names to the input place name if the input type is a place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them;

[0128] The address search completion module is used to perform word segmentation and address entity label determination based on the input search content if the input type is an address, remove the address word segmentation results at the province, city, and county levels, correct incorrect address input below the county level, complete the entity information from the province to the smallest place name, correct the input search content based on the time attribute of the ownership relationship, calculate the overall similarity of the address, and return it after sorting it from large to small according to the overall similarity of the address.

[0129] Furthermore, the input type determination module is specifically used for:

[0130] The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.

[0131] Furthermore, the place name retrieval module is specifically used for:

[0132] Based on the original sentence of the search content, the conversion of similar sound characters and similar shape characters is matched to find similar place name candidates of the input place name; the conversion of similar sound characters is matched based on the pypinyin library and the dictionary library of similar sound characters of place names constructed by the place name address database; the conversion of similar shape characters is matched based on the dictionary library of similar shape characters and the dictionary library of similar shape characters of place names constructed by the place name address database;

[0133] Change the matched alias results to standard place names;

[0134] Remove the place names at the province, city and county levels that are matched by the conversion of similar-sounding characters and similar-looking characters;

[0135] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0136] Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1. The product of the similarity a of the converted characters and the similarity b of the converted characters is taken as the overall similarity c of the place name:

[0137] c = a × b;

[0138] Place names are sorted from large to small according to their overall similarity. If the overall similarity of a place name is less than the set threshold, the corresponding place name candidate is removed and the remaining place name candidates are returned as search results.

[0139] Furthermore, the address search and completion module is specifically used for:

[0140] The BERT+BILSTM+CRF algorithm is used to segment the input search content, and multiple segmentation results are obtained by converting similar-sounding characters and similar-shaped characters.

[0141] Determine the address entity label: match the knowledge graph of the place name and address database according to the word segmentation results to obtain the corresponding word-level labels, where the matched alias entities are converted into standard entities related to them, and the unique subgraph of the address entity set that can meet the combination order of urban or rural standard address labels is taken as the candidate address segmentation result;

[0142] Remove the candidate address segmentation results at the province, city, and county levels obtained by converting similar-sounding characters and similar-looking characters;

[0143] Correct incorrect input of addresses below the county level: When the candidate address segmentation result corresponding to the original search content is empty, delete the address entity of the street or village and obtain the only sub-graph as the candidate address segmentation result;

[0144] Completing the place name and address database based on reasoning verification: When the candidate address segmentation result is empty and the input address information structure is complete, the specific address entity is obtained and the location is close to the specific address, and the input information is inferred to be correct. If correct, the segmentation result and the detailed address are stored in the place name and address database. At the same time, the knowledge graph of the place name and address database, the dictionary library of place name phonetic characters, and the dictionary library of place name morphological characters are linked and updated, and the segmentation result is used as the candidate address segmentation result;

[0145] Complete the address: Use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name;

[0146] Correct input addresses based on the time attribute of ownership relationship: For entity paths at all levels, for ownership relationships from subordinate to superior, if the time attribute is before, the superior entity is replaced by the associated entity whose time attribute is now from the subordinate to superior;

[0147] Sorting:

[0148] Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1.

[0149] Calculate the similarity b of the place names after conversion of similar characters. If the number of strokes of the converted character is the same as that of the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all similar characters after conversion is greater than 0, b is the reciprocal of the sum of the distances of all similar characters after conversion plus 1, otherwise b is 1;

[0150] Calculate the completion similarity d. When the number of entities continuously completed by the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed by the subgraph, otherwise d is 1;

[0151] The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e:

[0152] e = a × b × d;

[0153] The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the address is less than the set threshold, the corresponding address candidate is removed and the remaining address candidates are returned as search results.

[0154] In summary, the present invention first constructs a place name and address database; then constructs a place name and address database knowledge graph; and determines the input type according to the input search content; if the input type is a place name, then find similar place names of the input place name, and calculate the overall similarity of the place names of each similar place name found, sort them from large to small according to the overall similarity of the place name and return; if the input type is an address, then the word segmentation and address entity label determination are performed based on the input search content, the address word segmentation results of the three levels of province, city and county are removed, the wrong address input below the county level is corrected, the place name entity information from province to the smallest is completed, the time attribute based on the ownership relationship is corrected, the overall similarity of the address is calculated, and the overall similarity of the address is sorted from large to small and returned. The present invention proposes a place name and address similarity calculation method, which can scientifically measure the semantic similarity between the returned result and the user input content, and further sort the results so that the results closer to the user's intention are closer to the front. The present invention adopts a reasoning method to check and fill in the gaps of a large number of place names and addresses in real time based on the user's knowledge. The present invention has multiple levels of response measures when the returned result is empty due to insufficient user cognition. The present invention can effectively solve the problems of excessive amount of returned information, incomplete information, user input errors, etc. in the existing address search.

[0155] The above is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A retrieval and completion method based on a place name and address database, characterized in that: include: Step A, constructing a place name address database; the database includes: administrative area place names, street lane names or community names, landmark names, house numbers or points of interest names, and addresses composed of place names at all levels; Step B, constructing a knowledge graph of a place name and address database; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets, lanes, community groups, landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of a standard address composed of specific place names, and the equivalent relationship between a place name and a nickname; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, and the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period of the ownership relationship; Step C, determining the input type according to the input search content; the input type includes a place name and an address; Step D: if the input type is a place name, then search for similar place names to the input place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them; Step D1, matching based on the original sentence of the search content, similar-sounding characters and similar-shaped characters, to find similar place name candidates of the input place name; The conversion of similar-sounding characters is based on the matching of the dictionary of similar-sounding characters of place names constructed by the pypinyin library and the place name and address database; the conversion of similar-shaped characters is based on the matching of the dictionary of similar-shaped characters and the dictionary of similar-shaped characters of place names constructed by the place name and address database; Step D2, changing the matched alias result to a standard place name; Step D3, removing the place names at the three levels of province, city and county that are matched by converting the characters with similar pronunciation and similar appearance; Step D4, calculating the similarity a of the converted characters with similar pronunciations. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all the converted characters with similar pronunciations is greater than 0, a is the reciprocal of the sum of the edit distances of all the converted characters with similar pronunciations plus 1, otherwise a is 1. Step D5, calculating the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1. Step D6, taking the product of the similarity a after the conversion of the phonetically similar characters and the similarity b after the conversion of the geometrically similar characters as the overall similarity c of the place name: c = a × b; Step D7, sorting the place names from large to small according to their overall similarity. If the overall similarity of the place names is less than a set threshold, the corresponding place name candidate is removed, and the remaining place name candidate is returned as a search result; Step E: If the input type is an address, then the word segmentation and address entity label determination are performed based on the input search content, the address word segmentation results at the province, city, and county levels are removed, incorrect address input below the county level is corrected, and the entity information from the province to the smallest place name is completed. The input search content is corrected based on the time attribute of the ownership relationship, the overall address similarity is calculated, and the addresses are sorted from large to small according to the overall address similarity and returned; Step E1, using BERT+BILSTM+CRF algorithm to segment the input search content, and using similar-sounding character conversion and similar-shape character conversion to obtain multiple segmentation results; Step E2, determining the address entity label: matching the knowledge graph of the place name address database according to the word segmentation results to obtain the corresponding word-level label, wherein the matched alias entity is converted into the standard entity related thereto, and the unique subgraph of the address entity set that can satisfy the combination order of the urban or rural standard address label is taken as the candidate address segmentation result; Step E3, removing the candidate address segmentation results of the three levels of province, city and county obtained by converting similar-sounding characters and similar-looking characters; Step E4, correcting incorrect input of addresses below the county level: when the candidate address segmentation result corresponding to the original search content is empty, delete the street or village address entity and obtain a unique subgraph as the candidate address segmentation result; Step E5, completing the place name and address database based on reasoning verification: when the candidate address segmentation result is empty and the input address information structure is complete, the specific address entity is obtained and the location is close to the specific address, and the input information is inferred to be correct. If correct, the segmentation result and the detailed address are stored in the place name and address database, and the place name and address database knowledge graph, the place name pronunciation dictionary, and the place name shape dictionary are linked and updated, and the segmentation result is used as the candidate address segmentation result; Step E6, complete the address: use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name; Step E7, correcting the input address based on the time attribute of the ownership relationship: for the entity paths at all levels, for the ownership relationship from the lower level to the upper level, if the time attribute is before, the upper level entity is replaced by the associated entity whose time attribute from the lower level to the upper level is now; Step E8, sorting: Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1. Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1. Calculate the completion similarity d. When the number of entities continuously completed in the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed in the subgraph, otherwise d is 1; The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e: e = a × b × d; The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the address is less than the set threshold, the corresponding address candidate is removed and the remaining address candidates are returned as search results.

2. The method for searching and completing a place name and address database according to claim 1, characterized in that: The step C comprises: The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.

3. A retrieval and completion system based on a place name and address database, characterized in that: include: A place name and address database construction module is used to construct a place name and address database; the database includes: administrative area place names, street and lane names or community names, landmark names, house numbers or points of interest, and addresses composed of place names at all levels; A knowledge graph construction module is used to construct a knowledge graph of a place name and address database; the entities of the knowledge graph include five levels of administrative divisions: province, city, county, township, and village, streets and lanes, community groups, landmarks, house numbers, points of interest, and nicknames; the relationships of the knowledge graph include the ownership relationship of a standard address composed of specific place names, and the equivalent relationship between place names and nicknames; the ownership relationship has a time attribute and a name attribute, the time attribute is now or before, if the time attribute is now, the ownership relationship is current, and the name attribute value is the starting time of the ownership relationship, if the time attribute is before, the ownership relationship is a historical relationship, and the name attribute value is the time period of the ownership relationship; An input type determination module, used to determine the input type according to the input search content; the input type includes a place name and an address; A place name search module is used to find similar place names to the input place name if the input type is a place name, calculate the overall similarity of each similar place name found, sort them from large to small according to the overall similarity of the place names, and then return them; The place name retrieval module is specifically used for: Based on the original sentence of the search content, the conversion of similar sound characters and similar shape characters is matched to find similar place name candidates of the input place name; the conversion of similar sound characters is matched based on the pypinyin library and the dictionary library of similar sound characters of place names constructed by the place name address database; the conversion of similar shape characters is matched based on the dictionary library of similar shape characters and the dictionary library of similar shape characters of place names constructed by the place name address database; Change the matched alias results to standard place names; Remove the place names at the province, city and county levels that are matched by the conversion of similar-sounding characters and similar-looking characters; Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1. Calculate the similarity b of the converted characters. If the converted character has the same number of strokes as the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all the converted characters is greater than 0, b is the reciprocal of the sum of the distances of all the converted characters plus 1, otherwise b is 1. The product of the similarity a of the converted characters and the similarity b of the converted characters is taken as the overall similarity c of the place name: c = a × b; Sort the place names from large to small according to their overall similarity. If the overall similarity of a place name is less than the set threshold, remove the corresponding place name candidate and return the remaining place name candidate as the search result. The address search completion module is used to perform word segmentation and address entity label determination based on the input search content if the input type is an address, remove the address word segmentation results at the three levels of province, city, and county, correct the incorrect address input below the county level, complete the entity information from the province to the smallest place name, correct the input search content based on the time attribute of the ownership relationship, calculate the overall similarity of the address, and sort the addresses from large to small according to the overall similarity and return them; The address search and completion module is specifically used for: The BERT+BILSTM+CRF algorithm is used to segment the input search content, and multiple segmentation results are obtained by converting similar-sounding characters and similar-shaped characters. Determine the address entity label: match the knowledge graph of the place name and address database according to the word segmentation results to obtain the corresponding word-level labels, where the matched alias entities are converted into standard entities related to them, and the unique subgraph of the address entity set that can meet the combination order of urban or rural standard address labels is taken as the candidate address segmentation result; Remove the candidate address segmentation results at the province, city, and county levels obtained by converting similar-sounding characters and similar-looking characters; Correct incorrect input of addresses below the county level: When the candidate address segmentation result corresponding to the original search content is empty, delete the address entity of the street or village and obtain the only sub-graph as the candidate address segmentation result; Completing the place name and address database based on reasoning verification: When the candidate address segmentation result is empty and the input address information structure is complete, the specific address entity is obtained and the location is close to the specific address, and the input information is inferred to be correct. If correct, the segmentation result and the detailed address are stored in the place name and address database. At the same time, the knowledge graph of the place name and address database, the dictionary library of place name phonetic characters, and the dictionary library of place name morphological characters are linked and updated, and the segmentation result is used as the candidate address segmentation result; Complete the address: Use the entities on the unique subgraph path to complete the entity information from the province to the smallest place name; Correct input addresses based on the time attribute of ownership relationship: For entity paths at all levels, for ownership relationships from subordinate to superior, if the time attribute is before, the superior entity is replaced by the associated entity whose time attribute is now from the subordinate to superior; Sorting: Calculate the similarity a of the converted characters with similar pronunciation. If the pinyin is the same, the edit distance of the character is 1. If the pinyin is converted from flat and retroflex consonants and front and back nasals, the edit distance of the character is 2. When the sum of the edit distances of all converted characters with similar pronunciation is greater than 0, a is the reciprocal of the sum of the edit distances of all converted characters with similar pronunciation plus 1, otherwise a is 1. Calculate the similarity b of the place names after conversion of similar characters. If the number of strokes of the converted character is the same as that of the original character, the edit distance is 1, otherwise it is 2. When the sum of the edit distances of all similar characters after conversion is greater than 0, b is the reciprocal of the sum of the distances of all similar characters after conversion plus 1, otherwise b is 1; Calculate the completion similarity d. When the number of entities continuously completed in the subgraph is greater than 1, the completion similarity is calculated by the inverse of the number of entities continuously completed in the subgraph, otherwise d is 1; The product of the similarity a after the conversion of similar-sounding characters, the similarity b after the conversion of similar-shape characters, and the completion similarity d is taken as the overall address similarity e: e = a × b × d; The addresses are sorted from large to small according to their overall similarity. If the overall similarity of the address is less than the set threshold, the corresponding address candidate is removed and the remaining address candidates are returned as search results.

4. The retrieval and completion system based on place name and address database according to claim 3 is characterized in that: The input type determination module is specifically used for: The bert+bilstm+CRF algorithm is used to segment the input search content, and the decision tree method is used for classification, and the classification results are obtained as place names or addresses.