Address matching method and device, equipment and storage medium
The address matching method uses grid-based encoding and semantic refinement to enhance accuracy and speed in financial fraud detection, addressing inefficiencies in existing methods by narrowing search scope and integrating semantic information.
Patent Information
- Application Number
- CN202411698098.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-07-15
AI Technical Summary
The existing address matching methods are not accurate when writing irregular address text and word segmentation are unreasonable, and the matching rules are time-consuming and cumbersome, making it difficult to adapt to the large-scale address matching needs in big data scenarios.
By grid encoding the address text, the address is positioned to a rectangular area with preset accuracy using the GeoHash algorithm, distributed search is performed in combination with ElasticSearch, and further matches through hierarchy and vector encoding, and fine-grained matching is performed using the pretrained entity recognition and address vector encoding model.
In big data scenarios, the matching range is rapidly narrowed, the matching rate and accuracy is improved, the dependence on expert experience is reduced, and the matching accuracy and rate is provided, which supports risk control in financial credit anti-fraud business scenarios.
Smart Images

Figure CN120316191A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data analysis technology, and in particular to an address matching method, device, equipment and storage medium. Background Art
[0002] In the financial field, such as the financial credit business scenario, while the credit business is developing rapidly, various new fraud methods are also being introduced and continuously infiltrating the field. Investigation and analysis have found that fraudulent customers are mostly organized in nature, and these customers have a strong geographical correlation. Therefore, using address matching technology to build associations with customer address information, combined with other investigation methods in the business to jointly explore risk groups, and then implement differentiated risk control strategies for risk groups, is an effective way to prevent and control organized fraud risks.
[0003] The existing address matching methods mainly adopt the method of first segmenting Chinese words and then combining various matching rules designed in advance, such as regular expression matching, hierarchical element matching and fuzzy address matching. However, on the one hand, this type of address matching method is greatly affected by the standardization of the address text and the word segmentation boundaries. For example, when faced with address texts that are not written in a standardized manner and unreasonable word segmentation of the address text, the matching effect is very unsatisfactory and the accuracy is not high; on the other hand, this type of address matching method involves the design of matching rules, which is relatively time-consuming, and the design of matching rules is limited by manual experience, and the rationality cannot be guaranteed, and thus the matching accuracy cannot be guaranteed. In addition, the matching rule implementation process is also cumbersome, which reduces the matching rate and is difficult to adapt to the large-scale address matching needs in big data scenarios. Summary of the invention
[0004] The main purpose of this application is to provide an address matching method, device, equipment and storage medium, aiming to improve the accuracy and speed of address matching, and provide reliable support for preventing and controlling organized fraud risks in financial credit anti-fraud business scenarios.
[0005] In a first aspect, the present application provides an address matching method, the method comprising:
[0006] Acquire address text, perform grid coding on the address text, and obtain the area code and neighboring area code corresponding to the address text;
[0007] Searching a historical address database according to the area code and the neighbor area code to obtain a candidate set of address texts to be matched corresponding to the address texts;
[0008] The address text and each to-be-matched address text in the candidate set are respectively graded and encoded in sequence to obtain a first address element and a first encoding vector corresponding to the address text, and a second address element and a second encoding vector corresponding to each to-be-matched address text;
[0009] According to the first address element and the first encoding vector, and each second address element and each second encoding vector, a target matching address text of the address text is searched from the candidate set.
[0010] In a second aspect, the present application further provides an address matching device, and the device includes:
[0011] A grid encoding module, configured to obtain an address text, perform grid encoding on the address text, and obtain a region encoding and a neighbor region encoding corresponding to the address text;
[0012] A first search module, configured to search a historical address database according to the region encoding and the neighbor region encoding, and obtain a candidate set of to-be-matched address texts corresponding to the address text;
[0013] A grading and encoding module, configured to respectively grade and encode the address text and each to-be-matched address text in the candidate set in sequence to obtain a first address element and a first encoding vector corresponding to the address text, and a second address element and a second encoding vector corresponding to each to-be-matched address text;
[0014] A second search module, configured to search a target matching address text of the address text from the candidate set according to the first address element and the first encoding vector, and each second address element and each second encoding vector.
[0015] In a third aspect, the present application further provides a computer device, and the computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the address matching method as described above are implemented.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the address matching method as described above are implemented.
[0017] The present application discloses an address matching method, apparatus, computer device, and readable storage medium. The address matching method can be applied to the credit anti-fraud business scenario in the financial field. It obtains an address text, performs grid coding on the address text to obtain a region code and neighbor region codes corresponding to the address text; searches a historical address database according to the region code and neighbor region codes to obtain a candidate set of address texts to be matched corresponding to the address text; hierarchically classifies and codes the address text and each address text to be matched in the candidate set in sequence to obtain a first address element and a first coding vector corresponding to the address text, and a second address element and a second coding vector corresponding to each address text to be matched; searches for the target matching address text of the address text from the candidate set according to the first address element and the first coding vector, and each second address element and each second coding vector. Through address grid processing, the address matching method can realize the grid mapping of the address text. The grid mapping can quickly locate addresses with similar geographical distances to the same rectangular area. In the case of a large number of scattered addresses in the big data scenario, it can quickly and preliminarily obtain the candidate set of address texts to be matched corresponding to the address text, greatly narrowing the range of address matching, thereby greatly improving the matching rate; by integrating various aspects of information such as the address text structure and address text semantics, it further searches and matches the candidate set of address texts to be matched. Compared with the existing method of first segmenting words and then combining matching rules, it can obtain higher matching accuracy, improve the accuracy of address matching, and since there is no need to introduce expert experience to design complex matching rules, it further improves the address matching rate, and can provide reliable support and strategies for preventing organized fraud risks in the financial credit anti-fraud business scenario.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0020] Figure 1 It is a schematic flowchart of an embodiment of the address matching method of the present application;
[0021] Figure 2 It is a schematic flowchart of another embodiment of the address matching method of the present application;
[0022] Figure 3 It is an example diagram of an application scenario involved in an embodiment of the address matching method of the present application;
[0023] Figure 4 A schematic block diagram of an address matching device provided in an embodiment of the present application;
[0024] Figure 5 A schematic structural block diagram of a computer device related to an embodiment of the present application.
[0025] The implementation, functional features, and advantages of the purpose of the present application will be further described in conjunction with the embodiments with reference to the accompanying drawings. Specific embodiments
[0026] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0027] The flowcharts shown in the accompanying drawings are only illustrative examples, and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can also be decomposed, combined, or partially merged. Therefore, the actual execution order may be changed according to the actual situation.
[0028] It should be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0029] It should be understood that in order to facilitate a clear description of the technical solutions in the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order, and the terms "first" and "second" do not necessarily mean different.
[0030] It should also be understood that the term " / and" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0031] Embodiments of the present application provide an address matching method, apparatus, computer device, and readable storage medium. Among them, this address matching method can be applied to the credit anti-fraud business scenario in the financial field. Through address grid processing, grid mapping of address text can be achieved. Grid mapping can quickly locate addresses with similar geographical distances into the same rectangular area. In the case of scattered addresses in the big data scenario, a candidate set of to-be-matched address texts corresponding to the address text can be quickly obtained initially, greatly narrowing the range of address matching, thereby greatly improving the matching rate. By integrating various aspects of information such as the address text structure and address text semantics, further search and matching are performed on the candidate set of to-be-matched address texts. Compared with the existing method of first segmenting words and then combining matching rules, higher matching accuracy can be obtained, improving the accuracy of address matching. And since there is no need to introduce expert experience to design complex matching rules, the address matching rate is further improved, which can provide reliable support and strategies for preventing organized fraud risks in the financial credit anti-fraud business scenario.
[0032] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0033] Please refer to Figure 1 , Figure 1 which is an address matching method provided by an embodiment of the present application. This address matching method is mainly applied to an address matching device, which can be a terminal device with data processing functions such as a server.
[0034] Among them, the server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and data analysis platforms.
[0035] As Figure 1 shown, this address matching method includes steps S101 to S104.
[0036] Step S101: Obtain an address text, perform grid encoding on the address text, and obtain the area code and neighbor area code corresponding to the address text.
[0037] The address matching method mainly includes two stages. One is the address gridification stage, which mainly performs grid encoding on the address text, quickly locates the address text to the grid area under the preset accuracy. The encoding speed in this stage is fast and parallel processing is supported. At the same time, by gridifying the scattered addresses, the subsequent range to be matched is greatly reduced, improving the matching rate. The other is the address search and matching stage. First, based on the grid area corresponding to the address text and its neighboring grid areas, a quick preliminary search and matching are performed through the distributed search engine ElasticSearch to obtain a candidate set of address texts to be matched corresponding to the address text. Then, the address text and each address text to be matched in the candidate set of address texts to be matched are graded and vectorized encoded, so as to perform further efficient search and matching in the candidate set of address texts to be matched through ElasticSearch, improving the accuracy of matching and the matching rate.
[0038] The implementation process of the address gridification stage is introduced in detail below.
[0039] Among them, the address text refers to the address information that needs to be matched for the address, which is composed of continuous strings and is a carrier for geographical location description, such as "No. xx Building, xx Road, xx Street, xx New Area, xx City". The address text contains rich geographical space information and social public information, which is an important and indispensable part of urban information resources and is also the basic resource for the development of smart cities in modern society. Exemplarily, the way to obtain the address text can be that the text matching device loads the input interface to obtain the address text input by the user on the input interface, or receive the address text sent by other devices, or receive an address matching request and extract the address text carried in the address matching request. After obtaining the address text, grid encoding is performed on the address text to obtain the area encoding and neighboring area encoding corresponding to the address text.
[0040] In some embodiments, in order to improve the accuracy of grid encoding, performing grid encoding on the address text to obtain the area encoding and neighboring area encoding corresponding to the address text can be to preprocess the address text to obtain the complemented address text; convert the complemented address text into the corresponding longitude and latitude coordinates; perform grid encoding on the longitude and latitude coordinates through the preset GeoHash algorithm to obtain the area encoding and neighboring area encoding.
[0041] To improve the standardization of address text, preprocessing is first performed on the address text. Specifically, preprocessing the address text includes cleaning, format conversion, and completion processing on the address text in sequence. Exemplarily, performing cleaning processing on the address text includes cleaning and deleting non-address data and incomplete data in the address text, deleting blank characters and special characters, such as punctuation marks, @, #, etc., and deleting duplicate address data, etc. After the cleaning processing is completed, the address text is converted into a unified format, such as the GB2312 encoding format. Then, completion processing is performed on the address text. To improve convenience and efficiency, a four-level administrative division database can be pre-constructed, and an administrative division dictionary is generated based on this four-level administrative division database, so as to complete the address text through the administrative division dictionary. For example, for an address text in the form of "xx City xx District xx Road xx No.", it is completed to "xx City xx District xx Street xx Road xx No." according to the index of the administrative division dictionary, and thus the completed address text is obtained.
[0042] Furthermore, the completed address text is converted into corresponding longitude and latitude coordinates. To improve convenience, open-source geocoding tools and platforms can be used, such as Amap geocoding or Bing location geocoding, etc., to forward-encode the completed address text into corresponding longitude and latitude coordinates.
[0043] Finally, reverse grid coding is performed on the longitude and latitude coordinates through a preset GeoHash algorithm to obtain a region code and a neighbor region code. Among them, GeoHash represents two coordinates of longitude and latitude with a string, and it represents the rectangular area where the longitude and latitude coordinates are located after encoding. The size of the rectangular area is related to the number of digits of the GeoHash encoding. Please refer to Table 1, and Table 1 exemplifies the approximate range of the GeoHash encoding digits and the rectangular area.
[0044] Table 1 Range of GeoHash Encoding Digits and Rectangular Area
[0045]
[0046]
[0047] As can be seen from Table 1, each rectangular area contains 8 neighbor rectangular areas. Taking the GeoHash encoding "wx4g0ec1" as an example, the GeoHash encoding values of its neighbor areas are ["wx4g0ec4", "wx4g0ec6", "wx4g0ec3", "wx4g0ec2", "wx4g0ec0", "wx4g0ebb", "wx4g0ebc", "wx4g0ebf"].
[0048] In addition, if the GeoHash encoded values of two latitude and longitude coordinates are the same, it means that they are in the same rectangular area. Taking the latitude and longitude coordinates (39.923201, 116.390705) as an example, after GeoHash encoding, the string "wx4g0ec1" is obtained, indicating that when the encoding length (precision) is set to 8, the latitude and longitude coordinates of this address are within the area encoded as wx4g0ec1. If there is another address with latitude and longitude coordinates (39.923220, 116.390725), its GeoHash value is also encoded as "wx4g0ec1", and both are within a rectangular area with a length and width of 19m in the geographical space.
[0049] It should be noted that in the actual credit anti-fraud business scenario, organized frauds with an associated relationship in the geographical space do not use exactly the same address text, but their geographical locations are close. Therefore, the technical solution provided in this embodiment quickly locates the address text to multiple GeoHash rectangular areas by flexibly setting the preset GeoHash length (precision), and obtains the regional encoding hash corresponding to the address text addr and the neighbor regional encoding hash neighbor_k .
[0050] It should be noted that the above grid encoding process can be processed in parallel, and still maintain a high processing rate in large-scale applications.
[0051] Step S102: Search the historical address database according to the regional encoding and the neighbor regional encoding, and obtain the candidate set of address texts to be matched corresponding to the address text.
[0052] The implementation process of the address search and matching stage is introduced in detail below.
[0053] Taking the application in the financial credit anti-fraud business scenario as an example, in the financial credit anti-fraud business scenario, for historical addresses with fraud risks identified in the past, their corresponding GeoHash encoded values are obtained through the preset GeoHash algorithm, and the historical addresses are associated with their corresponding GeoHash encoded values and saved in ElasticSearch that has a communication connection with the address matching device.
[0054] In some embodiments, ElasticSearch can also be deployed and run in the address matching device. ElasticSearch is a real-time distributed search and analysis engine that can perform full-text retrieval, complex data analysis, synonym processing, and near-real-time processing of similarity ranking at extremely high speeds.
[0055] In this way, in order to quickly identify the fraud risk of the address text, the historical address database can be searched according to the area code and the neighbor area code corresponding to the address text, and multiple historical address texts can be matched from the historical address database as the address texts to be matched corresponding to the address text. The multiple address texts to be matched form a candidate set of address texts to be matched, addr set1 。
[0056] In some embodiments, step S102 may be: using the area code and the neighbor area code as indexes, retrieving, through a distributed search engine, the historical codes that match the area code and the neighbor area code in the historical address data; based on the mapping relationship between the historical codes and the historical address texts in the historical address data, determining multiple historical address texts corresponding to the area code and the neighbor area code; and using the determined multiple historical address texts as the address texts to be matched corresponding to the address text. The multiple address texts to be matched form a candidate set of address texts to be matched.
[0057] Specifically, using the area code and the neighbor area code corresponding to the address text as indexes, retrieving, through a distributed search engine, the historical codes that match the area code and the neighbor area code corresponding to the address text in the historical address data; then, based on the mapping relationship between the historical codes and the historical address texts in the historical address data, determining multiple historical address texts corresponding to the area code and the neighbor area code corresponding to the address text; and using the determined multiple historical address texts as the address texts to be matched corresponding to the address text. The multiple address texts to be matched form a candidate set of address texts to be matched.
[0058] In this way, based on the area code and the neighbor area code corresponding to the address text, through ElasticSearch, multiple address texts to be matched with the same GeoHash coding value as the address text can be quickly and efficiently retrieved from the historical address data, improving the matching rate.
[0059] Step S103: Hierarchically classify and encode the address text and each address text to be matched in the candidate set in turn to obtain the first address element and the first coding vector corresponding to the address text, and the second address element and the second coding vector corresponding to each address text to be matched.
[0060] Since the multiple address texts to be matched initially searched through ElasticSearch, although they have similarity in geographical spatial distance after being aggregated by GeoHash grid, the granularity is relatively coarse, and there may still be errors due to errors in the forward coding of the address text to longitude and latitude coordinates in the early stage. Therefore, on this basis, a finer-grained matching and screening is further performed.
[0061] Specifically, the hierarchical parsing and vector quantization encoding are sequentially performed on the address text and each candidate address text to be matched in the candidate set of the address text to be matched, respectively, to obtain the first address elements and the first encoding vectors corresponding to the address text, and the second address elements and the second encoding vectors corresponding to each candidate address text to be matched.
[0062] In some embodiments, step S103 may be to perform hierarchical parsing on the address text and each candidate address text to be matched, respectively, through a preset entity recognition model to obtain the first hierarchical result corresponding to the address text and the second hierarchical results corresponding to each candidate address text to be matched; determine the first address elements and the first combined address elements corresponding to the address text according to the first hierarchical result, and determine the second address elements and the second combined address elements corresponding to each candidate address text to be matched according to the second hierarchical result; and perform vector quantization encoding on the first combined address elements and each second combined address element, respectively, through a preset address vector encoding model to obtain the first encoding vector and each second encoding vector.
[0063] To improve the convenience and accuracy of address hierarchical parsing, different from the existing method of parsing addresses based on word segmentation combined with character matching, the technical solution provided in this embodiment can convert the address parsing task into an entity recognition task of address elements through a preset entity recognition model.
[0064] Among them, the preset entity recognition model may be an LSTM (Long Short-Term Memory) model based on a tree structure that is pre-trained with a large amount of address tag data. The preset entity recognition model is used to identify the address elements of the address text, complete the hierarchical parsing of the address text, and obtain several levels of address elements and tags corresponding to the address text (defined as the first hierarchical result); similarly, the preset entity recognition model is used to identify the address elements of each candidate address text to be matched, complete the hierarchical parsing of each candidate address text to be matched, and obtain several levels of address elements and tags corresponding to each candidate address text to be matched (defined as the second hierarchical result).
[0065] Exemplarily, the preset entity recognition model can identify the tags of 16 levels of address elements. Please refer to Table 2, which exemplifies the tags of 16 levels of address elements.
[0066] Table 2 Address Element Tags
[0067]
[0068]
[0069] As shown in Table 2, the address element tags range from the coarser-grained country to the finer-grained location auxiliary words. Compared with the existing methods, the preset entity recognition model is pre-trained with a large amount of address tag data, which not only avoids manually designing rules and judging word boundaries, but also increases the learning of grammar and semantics, and can improve the accuracy of address element parsing and the convenience of address element parsing.
[0070] After completing the hierarchical parsing of the address, perform fine-grained matching on the address text and each address text to be matched.
[0071] First, split and combine the several levels of address elements corresponding to the address text and the several levels of address elements corresponding to each address text to be matched respectively. Specifically, for the several levels of address elements corresponding to the address text, take the texts with tags Country, Province, City, District, Town as separate address elements (defined as the first address elements), and merge the texts corresponding to the remaining tags into one address element (defined as the first merged address element). Exemplarily, taking "No. 316, Building X, Road D, Street C, District B, City A" as an example, City A, District B, and Street C are taken as separate elements, and Road D, No. 316, and Building X are merged into one element.
[0072] Similarly, for the several levels of address elements corresponding to each address text to be matched, take the texts with tags Country, Province, City, District, Town as separate address elements (defined as the second address elements), and merge the texts corresponding to the remaining tags into one address element (defined as the second merged address element).
[0073] Secondly, through the preset address vector encoding model, vectorize and encode the first merged address element to obtain the encoding vector corresponding to the first merged address element (defined as the first encoding vector); also through the preset address vector encoding model, vectorize and encode each second merged address element to obtain the respective encoding vectors corresponding to each second merged address element (defined as the second encoding vectors).
[0074] Among them, the preset address vector encoding model can be a pre-trained Sentence-BERT (Sentence-Bidirectional Encoder Representation from Transformers) model. This Sentence-BERT model uses a siamese network structure to generate sentence embedding vectors with semantic meanings. For sentences with similar semantics, the distances of their embedding vectors are relatively close, which facilitates subsequent similarity calculation. Exemplarily, through the Sentence-BERT model, the first merged address element and each second merged address element can be encoded into vectors with a length of 512 respectively.
[0075] Step S104: Search for the target matching address text of the address text from the candidate set according to the first address element and the first encoding vector, and each second address element and each second encoding vector.
[0076] Furthermore, according to the first address element and the first encoding vector, and each second address element and each second encoding vector, determine the to-be-matched address text (defined as the target matching address text) that matches the address text from the candidate set of to-be-matched address texts.
[0077] In some embodiments, please refer to Figure 2 , to achieve fine-grained address matching, step S104 may include sub-steps S1041 to S1042.
[0078] Sub-step S1041: According to the first address element and the first encoding vector, and each second address element and each second encoding vector, perform a boolean search through a distributed search engine to determine the similarity between each to-be-matched address text and the address text.
[0079] Specifically, using the boolean search method of ElasticSearch, based on the first address element and the first encoding vector corresponding to the address text, and each second address element and each second encoding vector corresponding to each to-be-matched address text, perform a boolean search through a distributed search engine to search and determine the similarity between each to-be-matched address text and the address text.
[0080] In some embodiments, based on the cosine similarity between each second coding vector and the first coding vector, the similarity between each address text to be matched and the address text is measured. Sub-step S1041 may be to construct an index for boolean search according to the first address element and the second coding vector; according to the index of the boolean search, perform a boolean search on each second address element and each second coding vector through a distributed search engine to determine the cosine similarity between each second coding vector and the first coding vector; use each cosine similarity as the similarity between each address text to be matched and the address text.
[0081] First, construct an ElasticSearch index, that is, construct the first address element and the first merged address element together as an index for boolean search. It can be understood that when the text corresponding to the label is empty, a specific string can be uniformly used for replacement, for example, replacing it with the string NAN.
[0082] After that, according to the index of the boolean search, perform a boolean vector search on each second address element and each second coding vector through ElasticSearch to search and determine the cosine similarity between each second coding vector and the first coding vector.
[0083] Use the cosine similarity between each second coding vector and the first coding vector to represent the similarity between each address text to be matched and the address text. The higher the similarity, the higher the matching degree with the address text.
[0084] Sub-step S1042: Search for the target matching address text of the address text from the candidate set of address texts to be matched according to each similarity.
[0085] Thus, based on the similarity between each address text to be matched and the address text, search for the target matching address text of the address text from the candidate set of address texts to be matched.
[0086] In some embodiments, the similarity threshold threshold can be flexibly set in advance k , and sub-step S1042 may be to compare each similarity with the preset threshold; use the address text to be matched with a similarity greater than the preset threshold as the target matching address text of the address text.
[0087] Compare the similarity between each address text to be matched and the address text with the preset threshold k for comparison, and use the address text to be matched with a similarity greater than the preset threshold as the target matching address text of the address text. In this way, fine-grained address matching is achieved on the basis of the candidate set of address texts to be matched.
[0088] In summary, through address gridification, in the case of multiple scattered addresses in the big data scenario, longitude and latitude coordinates with similar geographical distances can be quickly and parallelly located in the same rectangular area. Compared with matching each address with all addresses, the address matching range is greatly reduced. Therefore, compared with the existing methods, the matching rate is improved. Through address search and matching based on address grading and vectorization, integrating various information such as address text structure and address text semantics for training and learning, compared with the existing methods that first segment words and then design matching rules, higher accuracy can be obtained in the address text similarity matching task, and there is no need to introduce expert experience to design complex rules. In addition, with the help of the vector search method of ElasticSearch, compared with traditional data search, the search and matching rate is further improved.
[0089] Please refer to Figure 3 , for a better understanding of the above embodiments, the following is an example of an application scenario:
[0090] For example, in the scenario of financial credit anti-fraud business, first obtain the address text of the current credit customer; then, in order to improve the standardization of the current address text, perform preprocessing such as cleaning, format conversion, and completion on the current address text in sequence, and also convert the preprocessed current address text into corresponding longitude and latitude coordinates; then, perform grid encoding on the longitude and latitude coordinates to obtain the GeoHash code value; then, through ElasticSearch, search and obtain all the historical addresses in the area where the GeoHash code value is located and the areas where the neighbors are located from the historical address database with fraud risks to form a candidate set of address texts to be matched.
[0091] After that, through the LSTM model based on the tree structure, perform address grading on the current address text and the candidate set of address texts to be matched respectively, to obtain several levels of address elements and labels corresponding to the current address, and several levels of address elements and labels corresponding to each address text to be matched in the candidate set. For the several levels of address elements corresponding to the address text, take the texts with labels of Country, Province, City, District, and Town as separate address elements (defined as the first address elements), and merge the texts corresponding to the remaining labels into one address element (defined as the first merged address element). Similarly, for each address text to be matched, take the texts with labels of Country, Province, City, District, and Town as separate address elements (defined as the second address elements), and merge the texts corresponding to the remaining labels into one address element (defined as the second merged address element).
[0092] Further, by presetting the Sentence-BERT model, the first merged address element and each second merged address element are respectively vectorized and encoded to obtain a first encoded vector and each second encoded vector.
[0093] Next, the first address element and the first merged address element are jointly constructed into an index for boolean search. ElasticSearch is used to perform boolean search on each second address element and each second encoded vector, and the cosine similarity between each second encoded vector and the first encoded vector is searched and determined, so as to obtain the similarity between each to-be-matched address text and the current address text in the candidate set. Finally, according to the similarity, the target matching address text that matches the current address text is screened out from the candidate set.
[0094] In this way, in terms of address encoding, the address text is converted into GeoHash encoding through longitude and latitude coordinates, realizing the grid mapping of the address. In the case of scattered addresses in the big data scenario, the grid mapping can quickly locate the longitude and latitude coordinates with similar geographical distances to the same rectangular area, narrowing the scope of subsequent address matching. At the same time, the GeoHash encoding calculation is independent and will not be affected by the longitude and latitude coordinates of other addresses during the calculation process, so it can be parallel calculated when applied to large-scale data.
[0095] In terms of address search and matching, first, the entity recognition model is used to classify the address text. Secondly, the classified address elements are split and merged. Then, the address vector encoding model is used to perform embedding vectorization on the merged address elements. Finally, the split address elements are used as the screening conditions during the boolean vector search of ElasticSearch, and the merged encoded address element vectors are used as the boolean vector search conditions, and efficient vector search is performed under the conditions of the candidate set and the preset similarity threshold. In this process, on the one hand, different from the commonly used text tokenization method in the existing solutions, the technical solution provided by the embodiments of the present invention uses an entity recognition model, which can fuse address structure and grammar semantic information and automatically learn to classify address elements, with higher accuracy compared to manually setting rules to determine word boundaries. On the other hand, different from the commonly used search and matching methods in the existing solutions, the technical solution provided by this embodiment pre-trains a text vector encoding model, vectorizes address elements rich in semantic information, such as road names and POIs, and then combines the boolean vector search mode of ElasticSearch to obtain similar addresses through vector cosine similarity calculation, avoiding the complex process of manually constructing multiple matching modes with the help of expert experience in the existing methods, and at the same time ensuring the matching rate.
[0096] In this way, through the technical solution provided by this embodiment, the address information of credit customers can be associated, so as to identify and excavate risk credit customer groups, providing reliable support and strategies for preventing organized fraud risks in the financial credit anti-fraud business scenario.
[0097] The address matching method provided by the above embodiment obtains an address text, performs grid coding on the address text to obtain a region code and a neighbor region code corresponding to the address text; searches a historical address database according to the region code and the neighbor region code to obtain a candidate set of address texts to be matched corresponding to the address text; respectively performs grading and coding on the address text and each address text to be matched in the candidate set to obtain a first address element and a first coding vector corresponding to the address text, and a second address element and a second coding vector corresponding to each address text to be matched; searches for a target matching address text of the address text from the candidate set according to the first address element and the first coding vector, and each second address element and each second coding vector. Through address grid processing, grid mapping of the address text can be realized. Grid mapping can quickly locate addresses with similar geographical distances to the same rectangular area. In the case of a large number of scattered addresses in the big data scenario, a candidate set of address texts to be matched corresponding to the address text can be quickly obtained initially, greatly narrowing the scope of address matching. Therefore, compared with the existing method, the matching rate is greatly improved; by integrating multi-faceted information such as the address text structure and the address text semantics, further search and matching are performed on the candidate set of address texts to be matched. Compared with the existing method of first segmenting words and then combining matching rules, higher matching accuracy can be obtained, improving the accuracy of address matching. And since there is no need to introduce expert experience to design complex matching rules, the address matching rate is further improved, providing reliable support and strategies for preventing organized fraud risks in the financial credit anti-fraud business scenario.
[0098] Please refer to Figure 4 , Figure 4 which is a schematic block diagram of an address matching device provided by an embodiment of the present application.
[0099] As Figure 4 shown, the device 400 includes: a grid coding module 401, a first search module 402, a grading and coding module 403, and a second search module 404.
[0100] The grid coding module 401 is configured to obtain an address text, perform grid coding on the address text to obtain a region code and a neighbor region code corresponding to the address text;
[0101] The first search module 402 is configured to search a historical address database according to the region code and the neighbor region code to obtain a candidate set of address texts to be matched corresponding to the address text;
[0102] A grading and encoding module 403 is configured to sequentially grade and encode the address text and each address text to be matched in the candidate set, so as to obtain a first address element and a first encoding vector corresponding to the address text, and a second address element and a second encoding vector corresponding to each address text to be matched.
[0103] A second search module 404 is configured to search for a target matching address text of the address text from the candidate set according to the first address element and the first encoding vector, and each second address element and each second encoding vector.
[0104] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described device and each module and unit can refer to the corresponding processes in the foregoing address matching method embodiments, and will not be elaborated herein.
[0105] The device provided in the foregoing embodiment can be implemented in the form of a computer program, and the computer program can run on a computer device as shown in Figure 5 .
[0106] Please refer to Figure 5 , Figure 5 which is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device can be a device with data processing functions such as a personal computer (PC), a server, etc.
[0107] As shown in Figure 5 , the computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the memory can include a non-volatile storage medium and an internal memory.
[0108] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any address matching method.
[0109] The processor is configured to provide computing and control capabilities to support the operation of the entire computer device.
[0110] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any address matching method.
[0111] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that Figure 5The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0112] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0113] Among them, in one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0114] Obtain an address text, perform grid coding on the address text to obtain a region code and a neighbor region code corresponding to the address text;
[0115] According to the region code and the neighbor region code, search a historical address database to obtain a candidate set of address texts to be matched corresponding to the address text;
[0116] Perform grading and coding on the address text and each address text to be matched in the candidate set in sequence to obtain a first address element and a first coding vector corresponding to the address text, and a second address element and a second coding vector corresponding to each address text to be matched;
[0117] According to the first address element and the first coding vector, and each second address element and each second coding vector, search for a target matching address text of the address text from the candidate set.
[0118] In some embodiments, when the processor implements searching for a target matching address text of the address text from the candidate set according to the first address element and the first coding vector, and each second address element and each second coding vector, it is used to implement:
[0119] Based on the first address element and the first coding vector, as well as each of the second address elements and each of the second coding vectors, perform a Boolean search through a distributed search engine to determine the similarity between each of the to-be-matched address texts and the address text;
[0120] Search for the target matching address text of the address text from the candidate set according to each of the similarities.
[0121] In some embodiments, when the processor implements performing a Boolean search through a distributed search engine based on the first address element and the first coding vector, as well as each of the second address elements and each of the second coding vectors, to determine the similarity between each of the to-be-matched address texts and the address text, it is used to implement:
[0122] Construct an index for Boolean search based on the first address element and the second coding vector;
[0123] According to the index of the Boolean search, perform a Boolean search on each of the second address elements and each of the second coding vectors through a distributed search engine to determine the cosine similarity between each of the second coding vectors and the first coding vector;
[0124] Use each of the cosine similarities as the similarity between each of the to-be-matched address texts and the address text.
[0125] In some embodiments, when the processor implements searching for the target matching address text of the address text from the candidate set according to each of the similarities, it is used to implement:
[0126] Compare each of the similarities with a preset threshold;
[0127] Use the to-be-matched address text with a similarity greater than the preset threshold as the target matching address text of the address text.
[0128] In some embodiments, the historical address database is stored in a distributed search engine. When the processor implements searching the historical address database based on the area code and the neighbor area code to obtain the candidate set of to-be-matched address texts corresponding to the address text, it is used to implement:
[0129] Use the area code and the neighbor area code as an index, and through a distributed search engine, search for the historical codes in the historical address database that match the area code and the neighbor area code;
[0130] Based on the mapping relationship between historical codes and historical address texts in the historical address data, determine multiple historical address texts corresponding to the area code and the neighbor area code;
[0131] Determine multiple pieces of the historical address text as the to-be-matched address text corresponding to the address text, and the multiple pieces of to-be-matched address text constitute the candidate set.
[0132] In some embodiments, when the processor implements the steps of respectively hierarchically classifying and encoding the address text and each to-be-matched address text in the candidate set to obtain the first address element and the first encoding vector corresponding to the address text, and the second address element and the second encoding vector corresponding to each to-be-matched address text, it is used to implement:
[0133] Respectively perform hierarchical parsing on the address text and each to-be-matched address text through a preset entity recognition model to obtain the first hierarchical result corresponding to the address text and the second hierarchical result corresponding to each to-be-matched address text;
[0134] Determine the first address element and the first merged address element corresponding to the address text according to the first hierarchical result, and determine the second address element and the second merged address element corresponding to each to-be-matched address text according to the second hierarchical result;
[0135] Use a preset address vector encoding model to respectively perform vector encoding on the first merged address element and each second merged address element to obtain the first encoding vector and each second encoding vector.
[0136] In some embodiments, when the processor implements the step of performing grid encoding on the address text to obtain the region encoding and the neighbor region encoding corresponding to the address text, it is used to implement:
[0137] Preprocess the address text to obtain the complemented address text;
[0138] Convert the complemented address text into corresponding longitude and latitude coordinates;
[0139] Perform grid encoding on the longitude and latitude coordinates through a preset GeoHash algorithm to obtain the region encoding and the neighbor region encoding.
[0140] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and the method implemented when the program instructions are executed can refer to the various embodiments of the address matching method of the present application or the various embodiments of the method for identifying medical entity relationships.
[0141] Among them, the computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device.
[0142] Furthermore, the computer-readable storage medium may mainly include a storage program area and a storage data area. Among them, the storage program area may store an operating system, application programs required for at least one function, etc.; the storage data area may store data created according to the use of the blockchain node, etc.
[0143] The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain, in essence, is a decentralized database, a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, etc.
[0144] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including that element.
[0145] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments. The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. An address matching method, characterized in that, The method includes the following steps: Obtain an address text, perform grid coding on the address text to obtain a region code and a neighbor region code corresponding to the address text; According to the region code and the neighbor region code, search a historical address database to obtain a candidate set of address texts to be matched corresponding to the address text; Perform grading and coding on the address text and each address text to be matched in the candidate set in sequence to obtain a first address element and a first coding vector corresponding to the address text, and a second address element and a second coding vector corresponding to each address text to be matched; According to the first address element and the first coding vector, and each second address element and each second coding vector, search for a target matching address text of the address text from the candidate set.
2. The address matching method according to claim 1, wherein The searching for the target matching address text of the address text from the candidate set according to the first address element and the first coding vector, and each second address element and each second coding vector includes: According to the first address element and the first coding vector, and each second address element and each second coding vector, perform a Boolean search through a distributed search engine to determine the similarity between each address text to be matched and the address text; According to each similarity, search for the target matching address text of the address text from the candidate set.
3. The address matching method according to claim 2, characterized in that The performing a Boolean search through a distributed search engine according to the first address element and the first coding vector, and each second address element and each second coding vector to determine the similarity between each address text to be matched and the address text includes: Construct an index for the Boolean search according to the first address element and the second coding vector; According to the index of the Boolean search, perform a Boolean search on each second address element and each second coding vector through a distributed search engine to determine the cosine similarity between each second coding vector and the first coding vector; Use each cosine similarity as the similarity between each address text to be matched and the address text.
4. The address matching method according to claim 2, wherein The searching for the target matching address text of the address text from the candidate set according to each similarity includes: Compare each similarity with a preset threshold; Use the address text to be matched with a similarity greater than the preset threshold as the target matching address text of the address text.
5. The address matching method according to claim 1, wherein The historical address database is stored in a distributed search engine. The searching for the candidate set of address texts to be matched corresponding to the address text according to the region code and the neighbor region code includes: Use the region code and the neighbor region code as an index, and through a distributed search engine, search for historical codes in the historical address database that match the region code and the neighbor region code; Based on the mapping relationship between the historical code and the historical address text in the historical address data, determine multiple historical address texts corresponding to the region code and the neighbor region code; Determine multiple pieces of the historical address text as the address text to be matched corresponding to the address text, and multiple pieces of the address text to be matched form the candidate set.
6. The address matching method according to claim 1, characterized in that, The steps of respectively performing grading and encoding on the address text and each address text to be matched in the candidate set in sequence to obtain a first address element and a first encoding vector corresponding to the address text, and a second address element and a second encoding vector corresponding to each address text to be matched include: Respectively perform grading and parsing on the address text and each address text to be matched through a preset entity recognition model to obtain a first grading result corresponding to the address text and a second grading result corresponding to each address text to be matched; Determine a first address element and a first combined address element corresponding to the address text according to the first grading result, and determine a second address element and a second combined address element corresponding to each address text to be matched according to the second grading result; Use a preset address vector encoding model to respectively perform vector encoding on the first combined address element and each second combined address element to obtain the first encoding vector and each second encoding vector.
7. The address matching method according to claim 1, wherein The steps of performing grid encoding on the address text to obtain a region encoding and a neighbor region encoding corresponding to the address text include: Preprocess the address text to obtain a complemented address text; Convert the complemented address text into corresponding longitude and latitude coordinates; Perform grid encoding on the longitude and latitude coordinates through a preset GeoHash algorithm to obtain the region encoding and the neighbor region encoding.
8. An address matching device, characterized in that, The address matching device includes: A grid encoding module, configured to obtain an address text, perform grid encoding on the address text, and obtain a region encoding and a neighbor region encoding corresponding to the address text; A first search module, configured to search a historical address database according to the region encoding and the neighbor region encoding, and obtain a candidate set of address texts to be matched corresponding to the address text; A grading and encoding module, configured to respectively perform grading and encoding on the address text and each address text to be matched in the candidate set in sequence to obtain a first address element and a first encoding vector corresponding to the address text, and a second address element and a second encoding vector corresponding to each address text to be matched; A second search module, configured to search for a target matching address text of the address text from the candidate set according to the first address element and the first encoding vector, and each second address element and each second encoding vector.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, the steps of the address matching method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that, A computer program is stored on a computer-readable storage medium. When the computer program is executed by a processor, the steps of the address matching method according to any one of claims 1 to 7 are implemented.