Address information standardization method, device, equipment and medium
Through dynamic programming of graph database query and regular matching combined with initialization algorithm model, the problems of low accuracy and poor scalability of address information standardization are solved, and efficient and accurate address information processing is achieved.
Patent Information
- Application Number
- CN202210321267.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-03-29
Smart Images

Figure CN114780656B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for standardizing address information. Background Art
[0002] Address-related information is involved in many industry scenarios, and the original address information often comes from user text information. Before this address information is used in model features and data processing, it needs to be standardized. One method for standardizing address information is to convert natural language into SQL query language, use this SQL query language to match it in the corresponding MySQL relational database, and apply traditional matching rules to obtain standardized address information.
[0003] SQL query language is a structured query language implemented based on the MySQL relational database. It is very simple to operate. Even if the user does not master the basics of SQL query writing, he or she can complete database query operations. In addition, relying on the rise of deep learning methods and the rapid development of natural language technology, SQL query language has further developed into a two-step NL2SQL query method.
[0004] However, when this two-step NL2SQL approach is applied to specific scenarios, it fails to model the table content and data types within specific vertical domains. This results in poor generalization adaptability, low recognition rates, and slow recognition speeds for some queries. Existing address standardization methods, which all rely on this two-step NL2SQL query approach, suffer from low accuracy, poor query performance, and a lack of scalability when dealing with relatively complex and highly concurrent address information, resulting in poor address standardization effectiveness. Summary of the Invention
[0005] The main purpose of the present invention is to propose an address information standardization method, device, equipment and medium, aiming to solve the standardization effect problems caused by low address information standardization accuracy, poor performance and lack of scalability.
[0006] To achieve the above object, the present invention provides an address information standardization method, which includes the following steps:
[0007] Get the original text of the address information;
[0008] Performing a candidate entity search on the original text to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match;
[0009] Based on a pre-created initialization algorithm model, a dynamic planning optimal entity path search is performed on the candidate entity to obtain a standardized result of the address information.
[0010] Preferably, the step of obtaining the original text of the address information includes:
[0011] Based on the original text of the address information, preprocessing the original text to obtain a preprocessed original text;
[0012] The pre-processing method includes one or more of full-width and half-width conversion, cleaning of meaningless special symbols, and special text processing.
[0013] Preferably, the step of searching the original text for candidate entities to obtain corresponding candidate entities includes:
[0014] Performing a Neo4j graph database query on the original text to obtain an address entity corresponding to the original text and a parent relationship corresponding to the address entity;
[0015] Performing regular expression matching on the original text to determine a subordinate relationship that does not exist in the address entity corresponding to the original text;
[0016] The address entity, the superior relationship of the address entity, and the subordinate relationship in which the address entity does not exist are uniformly fused to obtain a corresponding candidate entity.
[0017] Preferably, the step of querying the original text based on a Neo4j graph database to obtain an address entity corresponding to the original text and a parent relationship corresponding to the address entity includes:
[0018] Performing full word segmentation on the original text to obtain fully segmented text segments;
[0019] The text fragment is input into a data model of a Neo4j graph database, and the address entity corresponding to the text fragment and the parent relationship of the address entity in the Neo4j graph database are queried.
[0020] Preferably, the step of performing dynamic planning on the candidate entity to search for the optimal entity path based on the pre-created initialization algorithm model to obtain a standardized result of the address information includes:
[0021] Inputting the candidate entities into the initialization algorithm model to initialize the weight scores of the address entities in the candidate entities;
[0022] Based on the weight scores of the candidate entities, dynamically planning the optimal entity path search for the candidate entities to determine the candidate path;
[0023] Based on the candidate paths, a normalized result of the address information is determined.
[0024] Preferably, the step of performing dynamic planning optimal entity path search on the candidate entity based on the weight score of the candidate entity and determining the candidate path includes:
[0025] Performing a full path search on the candidate entity to obtain an address fragment corresponding to the candidate entity after the full path search;
[0026] Based on the address fragments, dynamic addition and subtraction planning is performed to obtain weight scores corresponding to the address fragments of the candidate paths;
[0027] Based on the weight scores, candidate paths whose weight scores meet a preset standard are determined.
[0028] Preferably, before the step of searching the original text for candidate entities to obtain corresponding candidate entities, the address information standardization method further includes creating a Neo4j graph database, specifically including:
[0029] Get the address information of the province, the city corresponding to the province, and the district corresponding to the city;
[0030] Processing the address information to obtain address data corresponding to the province, city, and district address information, wherein the data processing includes one or more of cleaning invalid data and fusing address nodes;
[0031] Import the address data of the province, city, and district into the Neo4j graph database through the built-in procedure function APOC;
[0032] Based on the address data, the nodes, attributes and edge relationships of the Neo4j graph database are planned and designed, and the corresponding Neo4j graph database is determined.
[0033] Preferably, before the step of performing a full-path address standardization search on the candidate entity based on the pre-created initialization algorithm model to obtain a standardized result of the address information, the address information standardization method further includes creating an initialization algorithm model, specifically including:
[0034] Obtaining address paths between address entities based on nodes, attributes, and edge relationships in the Neo4j graph database;
[0035] Performing weighted processing on the address entity in the initialization algorithm model according to the address path in the Neo4j graph database to obtain an initialization weight of the address entity;
[0036] According to the initialization weights of the address entities in the Neo4j graph database, addition and subtraction rules for dynamic programming are set to obtain an initialization algorithm model.
[0037] In addition, to achieve the above-mentioned purpose, the present invention further provides an address information standardization device, the address information standardization device comprising:
[0038] The acquisition module is used to obtain the original text of the address information;
[0039] A search module is used to search the original text for candidate entities to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match;
[0040] The determination module is used to perform a dynamic planning optimal entity path search on the candidate entity based on a pre-created initialization algorithm model to obtain a standardized result of the address information.
[0041] Preferably, the setting module is further used for:
[0042] Get the address information of the province, the city corresponding to the province, and the district corresponding to the city;
[0043] Processing the address information to obtain address data corresponding to the province, city, and district address information, wherein the data processing includes one or more of cleaning invalid data and fusing address nodes;
[0044] Import the address data of the province, city, and district into the Neo4j graph database through the built-in procedure function APOC;
[0045] Based on the address data, the nodes, attributes and edge relationships of the Neo4j graph database are planned and designed, and the corresponding Neo4j graph database is determined.
[0046] Preferably, the setting module is further used for:
[0047] Obtaining address paths between address entities based on nodes, attributes, and edge relationships in the Neo4j graph database;
[0048] Performing weighted processing on the address entity in the initialization algorithm model according to the address path in the Neo4j graph database to obtain an initialization weight of the address entity;
[0049] According to the initialization weights of the address entities in the Neo4j graph database, addition and subtraction rules for dynamic programming are set to obtain an initialization algorithm model.
[0050] Preferably, the acquisition module is further used for:
[0051] Preferably, the step of obtaining the original text of the address information includes:
[0052] Based on the original text of the address information, preprocessing the original text to obtain a preprocessed original text;
[0053] The pre-processing method includes one or more of full-width and half-width conversion, cleaning of meaningless special symbols, and special text processing.
[0054] Preferably, the search module is further configured to:
[0055] Performing a Neo4j graph database query on the original text to obtain an address entity corresponding to the original text and a parent relationship corresponding to the address entity;
[0056] Performing regular expression matching on the original text to determine a subordinate relationship that does not exist in the address entity corresponding to the original text;
[0057] The address entity, the superior relationship of the address entity, and the subordinate relationship in which the address entity does not exist are uniformly fused to obtain a corresponding candidate entity.
[0058] Preferably, the search module is further configured to:
[0059] Performing full word segmentation on the original text to obtain fully segmented text segments;
[0060] The text fragment is input into a data model of a Neo4j graph database, and the address entity corresponding to the text fragment and the parent relationship of the address entity in the Neo4j graph database are queried.
[0061] Preferably, the determination module is further configured to:
[0062] Inputting the candidate entities into the initialization algorithm model to initialize the weight scores of the address entities in the candidate entities;
[0063] Based on the weight scores of the candidate entities, dynamically planning the optimal entity path search for the candidate entities to determine the candidate path;
[0064] Based on the candidate paths, a normalized result of the address information is determined.
[0065] Preferably, the determination module is further configured to:
[0066] Performing a full path search on the candidate entity to obtain an address fragment corresponding to the candidate entity after the full path search;
[0067] Based on the address fragments, dynamic addition and subtraction planning is performed to obtain weight scores corresponding to the address fragments of the candidate paths;
[0068] Based on the weight scores, candidate paths whose weight scores meet a preset standard are determined.
[0069] In addition, to achieve the above-mentioned purpose, the present invention also provides an address information standardization device, which includes: a memory, a processor, and an address information standardization program stored on the memory and capable of running on the processor. When the address information standardization control program is executed by the processor, the steps of the address information standardization method described above are implemented.
[0070] In addition, to achieve the above-mentioned purpose, the present invention also provides a medium, which is a computer-readable storage medium, and the computer-readable storage medium stores an address information standardization program, and when the address information standardization program is executed by the processor, the steps of the address information standardization method described above are implemented.
[0071] The address information standardization method, apparatus, device and medium proposed in the present invention obtain the original text of the address information; perform a candidate entity search on the original text to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular matching; based on a pre-created initialization algorithm model, dynamically plan the optimal entity path search for the candidate entities to obtain the standardized result of the address information.
[0072] The present invention obtains corresponding candidate entities through database query and regular matching based on a graph database, thereby improving the scalability of standard addresses stored in the database, saving storage space for address data, and improving query efficiency of address data; based on a pre-created initialization algorithm model, a dynamic weighted entity path search is performed on the above-mentioned candidate entities, thereby improving the accuracy of address information standardization, achieving the effect of completing and correcting address information, and at the same time optimizing the algorithm effect of the initialization algorithm model, making the recognition effect of the initialization algorithm model faster and more flexible, solving the problems of poor scalability on the data side, low query efficiency, and low accuracy of address standardization on the model side, and optimizing the effect of address information standardization. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 Schematic diagram of the device structure of the hardware operating environment involved in the embodiment of address information standardization of the present invention;
[0074] Figure 2 This is a flow chart of a first embodiment of the address information standardization method of the present invention;
[0075] Figure 3 This is a flow chart of specific steps of address standardization in the first embodiment of the address information standardization method of the present invention;
[0076] Figure 4 This is a flow chart of a second embodiment of the address information standardization method of the present invention;
[0077] Figure 5 This is a sub-flow diagram of step S21 in the second embodiment of the address information standardization method of the present invention;
[0078] Figure 6 This is a schematic diagram of the structure of the Neo4j graph database in the second embodiment of the address information standardization method of the present invention;
[0079] Figure 7 Schematic diagram of the flow of the third embodiment of the address information standardization method of the present invention;
[0080] Figure 8 This is a sub-flow diagram of step S32 in the third embodiment of the address information standardization method of the present invention;
[0081] Figure 9 This is a flow chart of a fourth embodiment of the address information standardization method of the present invention;
[0082] Figure 10 Schematic diagram of the functional modules of the first embodiment of the address information standardization device of the present invention.
[0083] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0084] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0085] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0086] The device in the embodiment of the present invention may be a terminal or a server.
[0087] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0088] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0089] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an address information standardization program.
[0090] Among them, the operating system is a program that manages and controls address information standardization equipment and software resources, and supports the operation of network communication modules, user interface modules, address information standardization programs and other programs or software; the network communication module is used to manage and control the network interface 1002; the user interface module is used to manage and control the user interface 1003.
[0091] exist Figure 1 In the address information standardization device shown, the address information standardization device calls the address information standardization program stored in the memory 1005 through the processor 1001 and performs the operations in each embodiment of the following address information standardization method.
[0092] Based on the above hardware structure, a specific embodiment of the address information standardization method of the present invention is proposed.
[0093] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a method for standardizing address information according to the present invention. The method includes:
[0094] Step S10, obtaining the original text of the address information;
[0095] As an implementation method, the original text of the address information may be preprocessed to obtain a preprocessed original text;
[0096] The pre-processing method includes one or more of full-width and half-width conversion, cleaning of meaningless special symbols, and special text processing.
[0097] Acquire address information in natural language form from the user end, including: receiving text information from the user, receiving voice information from the user, and receiving picture information from the user, extracting address information from these text information, voice information, or picture information, and obtaining the address information to be identified.
[0098] In one embodiment, after acquiring address information in different forms, the address information needs to be preprocessed, wherein the preprocessing method includes one or more of full-width and half-width conversion, cleaning of meaningless special symbols, and special text processing.
[0099] Among them, full-width and half-width conversion is aimed at converting all numbers, letters, symbols, etc. in the text content we enter into full-width characters and half-width characters during the process of inputting characters using the Chinese input method, thereby realizing the mutual conversion between full-width characters and half-width character contents. Generally, the Chinese characters we commonly use are full-width characters, but full-width characters are not used in computer programs. Full-width characters are only used in text processing. The difference from full-width characters is mainly reflected in numbers, letters, punctuation marks, and special symbols, which are usually half-width characters.
[0100] The cleaning of meaningless special symbols and special text processing is convenient for removing non-regular meaningless characters such as Chinese characters, numbers, English characters and punctuation marks included in the address information. These meaningless characters need to be cleaned and processed through regular expressions to obtain address information data with a standard format.
[0101] In this embodiment, the address information to be identified obtained from the user end is preprocessed, wherein the preprocessing method includes one or more of full-width and half-width conversion, meaningless special symbol cleaning and special text processing. After preprocessing, the original text corresponding to the address information to be identified is obtained, and the address information of the original text is standardized to improve the accuracy of the standardization result.
[0102] In many industry scenarios, address-related information is involved, and often the original address information comes from user text information. These address text information from users are text information in the form of natural language.
[0103] With the widespread application of computers and the Internet, the amount of text information in the form of natural language that can be processed by computers has grown unprecedentedly. To analyze and study natural language, it is necessary to perform text mining, information extraction, and cross-language information processing on massive amounts of natural language information. With the construction of natural language corpora and the rise of corpus linguistics, the processing of large-scale real text has become the main strategic goal of natural language processing. In natural language processing, machine automatic learning methods are also increasingly used to acquire language knowledge.
[0104] In this embodiment, address information in the form of natural language is obtained from the user end, and the acquisition methods include: receiving text information from the user, receiving voice information from the user, and receiving picture information from the user. After receiving the address information in the form of natural language obtained in the above various forms, the original text for address standardization is processed.
[0105] Step S20: performing a candidate entity search on the original text to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match;
[0106] In the prior art, data query generally uses the SQL query method based on the MySQL relational database to convert natural language into SQL query language, and uses the SQL query language to query in the corresponding MySQL relational database to obtain corresponding query results.
[0107] In this embodiment, searching for candidate entities on the original text includes obtaining corresponding query matching results through a query method based on a graph database and regular matching.
[0108] Graph databases are non-relational databases, data management systems designed to efficiently store and query graph data using nodes and edges as storage units. Graph databases differ significantly from the aforementioned MySQL relational databases in their data storage, query, and data structure. Graph data structures directly store dependencies between nodes, while relational and other non-relational databases represent relationships indirectly. Graph databases store relationships as part of the data, allowing for labels, directions, and attributes. In contrast, other databases require runtime concretization for relationship queries. This is why graph databases offer significant performance advantages over other database types for relationship queries.
[0109] Regular expression matching is a method of searching and replacing matches that match a regular expression. Many existing programming languages support string operations using regular expressions. A regular expression is a logical formula for operating on strings (including common and special characters). It uses predefined specific characters and combinations of these characters to form a "regular string." This "regular string" is used to express string filtering logic. A regular expression is a text pattern that describes one or more strings to match when searching for text.
[0110] Step S30 : Based on the pre-created initialization algorithm model, a dynamic planning optimal entity path search is performed on the candidate entity to obtain a standardized result of the address information.
[0111] To implement weighted dynamic programming using an initialization algorithm model, the deep learning framework specifies a default weight initialization method when constructing the network. Alternatively, we can develop specialized weight initialization methods to achieve results with different rules. Whether the weights are properly initialized determines how close the entire initialization model algorithm is to the optimal solution and whether the direction is accurate. It also determines whether the initialization algorithm model will experience gradient explosion or vanishing, leading to training failures. It also determines how long it will take to train the initialization algorithm model to achieve the same results. Proper weight initialization ensures a more normal gradient for the model algorithm and makes it easier to reach the global optimal solution.
[0112] Reference Figure 3 , which is a specific step of address standardization in this embodiment. Based on a pre-created initialization algorithm model, the optimal entity path search is dynamically planned for the candidate entity, and the initialization algorithm model contains the weights corresponding to the candidate entities. The weighted initialization algorithm model is applied to dynamically plan the path for the candidate entity to obtain the standardized result corresponding to the candidate entity of the address information.
[0113] This embodiment obtains corresponding candidate entities through database query and regular matching based on a graph database, thereby improving the scalability of standard addresses stored in the database, saving storage space for address data, and improving query efficiency of address data; based on a pre-created initialization algorithm model, a dynamic weighted entity path search is performed on the above-mentioned candidate entities, thereby improving the accuracy of address information standardization, achieving the effect of completing and correcting address information, and at the same time optimizing the algorithm effect of the initialization algorithm model, making the recognition effect of the initialization algorithm model faster and more flexible.
[0114] Furthermore, based on the first embodiment of the address information standardization method of the present invention, a second embodiment of the address information standardization method of the present invention is proposed.
[0115] The difference between the third embodiment of the address information standardization method and the first embodiment of the address information standardization method is that in step S20, the original text is searched for candidate entities to obtain the corresponding candidate entity refinement, referring to Figure 4 , this step specifically includes:
[0116] Step S21: query the original text based on the Neo4j graph database to obtain the address entity corresponding to the original text and the parent relationship corresponding to the address entity;
[0117] In this embodiment, a database query based on the Neo4j graph database is performed on the original text of the above-mentioned address information, and the address entity corresponding to the above-mentioned original text is queried in the Neo4j graph database. Based on the above-mentioned original text, the parent relationship corresponding to the address entity is queried in parallel.
[0118] Reference Figure 5 , step S21 specifically includes:
[0119] Step a1, performing full word segmentation processing on the original text to obtain text segments after full word segmentation;
[0120] In one embodiment, full word segmentation processing is to perform all-round segmentation on the original text after pre-processing of the address information, and obtain text fragments corresponding to the original text obtained from each different segmentation method. For example, if the original text corresponding to the address information obtained is "Sichuan Chengdu", then after performing full word segmentation on the original text, the corresponding all-round text fragments obtained are "Si-Sichuan-Chengdu", "Sichuan-Chengdu-Chengdu", and "Sichuan-Chengdu-Sichuan Chengdu".
[0121] Step a2: input the text fragment into a data model of a Neo4j graph database, and query the Neo4j graph database for an address entity corresponding to the text fragment and a parent relationship of the address entity.
[0122] The most important sign of the big data era is the diversity of data types. Various unstructured data have gradually become the mainstream of enterprise data. The explosive growth of unstructured data has posed huge challenges to traditional databases, and the role of new data management tools has become increasingly prominent.
[0123] Among these new management tools, Hadoop and NoSQL are the two most critical categories. Among them, graph database is a type of NoSQL, that is, a non-relational database. It uses graph theory to store relationship information between entities. The most common is the relationship between people in social networks. This kind of relationship network is not well stored in traditional relational databases. Its query is complex, slow, and beyond expectations. The unique design of graph database just makes up for this shortcoming. Graph database is the abbreviation of graph database management system. It is a database that uses graphical models for query and uses nodes, edges, and attributes to represent and store data.
[0124] Common graph databases include Neo4j and FlockDB. The Neo4j graph database is a graph database implemented in Java and is fully ACID-compliant. The data in the Neo4j graph database is stored on the hardware disk in a format optimized for graph networks. The kernel of the Neo4j graph database is an extremely fast graph engine with all the features expected of database products, such as recovery, two-phase commit, and XA compliance.
[0125] In one embodiment, the text fragments after full word segmentation of the original text of the address information are obtained, and these text fragments are matched with the corresponding address entities in the Neo4j graph database, that is, the above text fragments are matched with the Neo4j graph database containing the address entity, wherein, with reference to Figure 6 For a Neo4j graph database containing address entities, matching is performed on the address entities and the relationships between the address entities stored according to the nodes, edges and attributes in the Neo4j graph database to obtain the corresponding address entities and their superior relationships.
[0126] Step S22, performing regular expression matching on the original text to determine a subordinate relationship that does not exist in the address entity corresponding to the original text;
[0127] Regular matching is a method of searching and replacing matches that match a regular expression. Many existing programming languages support string operations using regular expressions. A regular expression is a logical formula for operating on strings (including common and special characters). It uses pre-defined specific characters and combinations of these specific characters to form a "regular string". This "regular string" is used to express a filtering logic for strings. A regular expression is a text pattern that describes one or more strings to be matched when searching for text.
[0128] In one embodiment, the original text of the address information is matched using a regular expression capable of retrieving an address entity of the address information to obtain subordinate relationships that do not exist in the original text of the address information. For example, if the original text of the address information is "No. B, Street A, Shenzhen, Guangdong Province", the original text is matched using a regular matching rule containing a specific regular expression to obtain the subordinate relationship "No. B, Street A" that does not exist in the address entity "Shenzhen, Guangdong Province".
[0129] Step S23 : performing unified fusion processing on the address entity, the superior relationship of the address entity, and the subordinate relationship in which the address entity does not exist, to obtain a corresponding candidate entity.
[0130] The basic principle of unified information fusion processing is to make full use of sensor resources, and rationally control and use various sensors and manual observation information. Combine the complementary and redundant information of various sensors in space and time according to a certain optimization criterion or algorithm to produce a consistent interpretation and description of the observed object. The goal of unified information fusion is to decompose the manual observation information based on the detection information of each sensor. More effective information can be derived through the optimized combination of information.
[0131] In this embodiment, full use is made of the address entity information, including the address entity, the superior relationship of the address entity, and the subordinate relationship of the address entity that does not exist, which is screened in the graph database through Neo4j graph database query and regular matching, and the address entity information is unified and integrated based on a certain optimization criterion or algorithm combination to obtain candidate entity information that is more effective than the above-mentioned address entity information including the address entity, the superior relationship of the address entity, and the subordinate relationship of the address entity that does not exist.
[0132] In this embodiment, candidate entity search is performed on the original text of the address information based on Neo4j graph database query and regular matching, and the original text is fully segmented to obtain text fragments after all-round segmentation of the original text, thereby increasing the number of matching text fragments and improving the accuracy of the matching results to a certain extent; graph database query and regular matching are performed based on the all-round text fragments to obtain the corresponding candidate entities. In the process of targeting the data features of the standard address, the Neo4j graph database is used as the data storage basis, which improves the efficiency of address entity query and enhances the scalability of the data.
[0133] Furthermore, based on the first and second embodiments of the address information standardization method of the present invention, a third embodiment of the address information standardization method of the present invention is proposed.
[0134] The fourth embodiment of the address information standardization method is different from the first and second embodiments of the address information standardization method in that, in step S30, based on the pre-created initialization algorithm model, the optimal entity path search is dynamically planned for the candidate entity to obtain the refinement of the standardized result of the address information. Figure 7 , this step specifically includes:
[0135] Step S31: inputting the candidate entities into the initialization algorithm model to initialize the weight scores of the address entities in the candidate entities;
[0136] Step S32: Based on the weight scores of the candidate entities, dynamically planning the optimal entity path search for the candidate entities to determine the candidate path;
[0137] Step S33: Determine a normalized result of the address information based on the candidate path.
[0138] In this embodiment, after searching for candidate entities based on a graph database and regular matching, corresponding candidate entities are obtained, and the above-mentioned candidate entities are input into an address path search algorithm based on weighted dynamic programming to complete the standardized output of the original text.
[0139] The following describes each step in detail:
[0140] Step S31, inputting the candidate entities into the initialization algorithm model to initialize the weight scores of the address entities in the candidate entities;
[0141] Initialization is the process of assigning default values to variables and setting controls to their default states. It is a method of assigning initial values to data objects or variables. How to initialize depends on the programming language used and properties such as the storage type of the object to be initialized. The program structure used for initialization is called an initializer or initialization list.
[0142] In one embodiment, the candidate address entity is input into the initialization algorithm model, and the weight score of the above candidate address entity is initialized to obtain the province, city and district candidate address entity containing the weight score, and the weight score of the above province, city and district candidate address entity has been initialized by the algorithm in the initialization algorithm model.
[0143] Step S32, based on the weight scores of the candidate entities, performing dynamic planning optimal entity path search on the candidate entities to determine the candidate paths;
[0144] Dynamic programming algorithms are usually used to solve problems with certain optimal properties. The basic idea is to decompose the problem to be solved into several sub-problems, solve the sub-problems first, and then obtain the solution to the original problem from the solutions to these sub-problems. For problems that are suitable for dynamic programming, the sub-problems obtained after decomposition are often not independent of each other. If we can save the answers to the solved sub-problems and find the answers when needed, we can avoid a lot of repeated calculations and save time. We can use a table to record the answers to all solved sub-problems. Regardless of whether the sub-problem will be used in the future, as long as it has been calculated, its results will be filled in the table. This is the basic idea of dynamic programming.
[0145] Reference Figure 8 , step S32 specifically includes:
[0146] Step b1, performing a full path search on the candidate entity to obtain an address fragment corresponding to the candidate entity after the full path search;
[0147] In one embodiment, a full-path search is performed on the candidate entities obtained through graph database query and regular matching to obtain a full range of address fragments corresponding to the candidate entities.
[0148] Step b2: performing dynamic addition and subtraction planning based on the address fragments to obtain weight scores corresponding to the address fragments of the candidate paths;
[0149] In one embodiment, a dynamic planning optimal path entity search is performed based on the above-mentioned address segments, and each address segment has a different processing situation, as follows:
[0150] 1. If the address fragment of the candidate entity corresponds to an address entity, and the parent relationship of the candidate entity does not conflict with the predecessor entity of the address entity, then the weight of the candidate path is increased, the predecessor entity in the parent relationship of the candidate entity is completed, and the address fragment is stored in the candidate path;
[0151] 2. If the address fragment of the candidate entity corresponds to an address entity, but the parent relationship of the candidate entity conflicts with the predecessor entity of the address entity, then the address fragment is skipped directly;
[0152] 3. If the address fragment of the candidate entity does not correspond to any address entity and the address fragment is not a single word, skip the address fragment directly;
[0153] 4. If the address fragment of the candidate entity does not correspond to any address entity, but the address fragment is a single word, the weight of the candidate path containing the address fragment is reduced, and the address fragment containing the reduced weight is stored in the candidate path.
[0154] Among them, the superior relationship of the candidate entity is the superior relationship of the address entity stored in the graph database; the predecessor entity of the address entity is the previous level candidate entity in the superior relationship of the address fragment obtained after a full path search of the candidate entity; the weight of the candidate path is the weight score added to the address entity of the province, city and district in the weighted dynamic programming address path search algorithm.
[0155] Step b3: Based on the weight scores, determine candidate paths whose weight scores meet a preset standard.
[0156] In one embodiment, all candidate paths after the full search are looped through to obtain a weight score for each candidate entity, and a candidate path is determined based on the weight score. Specifically, the weight score is determined based on different processing conditions of the dynamic optimal path entity search for the address fragments. The weight score includes bonus points, deductions, and no bonus points. When the weight score of an address fragment does not reach a preset threshold, it is directly deleted in real time. When there are more bonus points than deductions, and the weight score of an address fragment reaches a preset threshold, the address fragment corresponding to the preset threshold is stored in the Neo4j graph database to obtain the corresponding candidate path.
[0157] Step S33: Determine a normalized result of the address information based on the candidate path.
[0158] In one embodiment, based on the candidate paths containing address fragments whose weight scores have reached a preset threshold, these address fragments are arranged according to the size of the weight scores, and the address fragments with the highest scores are extracted and spliced to obtain the corresponding address fragments with the highest weight scores, obtain the corresponding standardized address paths, and determine the standardized results of the user address information.
[0159] In this embodiment, the candidate entities obtained through Neo4j graph database query and regular matching candidate entity search are used to propose an address path search algorithm based on weighted dynamic programming for the data structure of standardized information, so as to improve the accuracy of address information standardization and achieve the effect of completing and correcting address information. A configurable weight system is introduced for address information and entity fragments with different levels, which can quickly and flexibly optimize the algorithm effect, thereby obtaining the candidate path corresponding to the address information, and determining the standardized result of the address information through the candidate path, thereby improving the accuracy of address information standardization and the efficiency of the standardization algorithm used in address information standardization.
[0160] Furthermore, based on the first, second and third embodiments of the address information standardization method of the present invention, a fourth embodiment of the address information standardization method of the present invention is proposed.
[0161] The fourth embodiment of the address information standardization method is different from the first, second, and third embodiments of the address information standardization method in that, before step S20, the address information standardization method further includes the creation of a Neo4j graph database and an initialization algorithm model. Figure 9 , this step specifically includes:
[0162] Step S201, obtaining the address information of the province, the city corresponding to the province, and the district corresponding to the city;
[0163] In one embodiment, the Neo4j graph database has fully covered the address information of provinces, cities corresponding to provinces, and districts corresponding to cities. The Neo4j graph database already contains the address information of all existing provinces, cities and districts in China, and based on the Neo4j graph database, it also stores the superior and subordinate relationships between the address information of all provinces, cities and districts.
[0164] Step S202: Process the address information to obtain address data corresponding to the province, city, and district address information;
[0165] Among them, the data processing method includes one or more of cleaning invalid data and fusing address nodes.
[0166] In one embodiment, address information data stored in a Neo4j graph database is obtained by one or more methods of cleaning invalid data and fusing address nodes, wherein cleaning invalid data includes checking data consistency, processing invalid values and missing values, etc., with the purpose of deleting duplicate information, correcting existing errors, and providing data consistency; fusing address nodes realizes efficient and intelligent fusion of data, realizes the sublimation from data to information and knowledge, meets the application needs of different types of users, and ensures the security and reliability of data through various security management methods.
[0167] Step S203, importing the address data of the province, city, and district into the Neo4j graph database through the built-in procedure function APOC;
[0168] APOC, or Awesome Procedures on Cypher, is considered the largest and most widely used extension library for the Neo4j graph database. It includes more than 450 standard procedures that provide utilities, transformations, graph updates, and other functions. Built-in procedure functions are well supported by APOC and are very easy to run as separate functions or include in Cypher queries.
[0169] In one embodiment, the cleaned address data is input into the Neo4j graph database through the built-in procedure function APOC to create a Neo4j graph database corresponding to the address information.
[0170] Step S204: Based on the address data, plan and design the nodes, attributes and edge relationships of the graph database, and determine the corresponding Neo4j graph database.
[0171] In one embodiment, the nodes, attributes, and edge relationships corresponding to the address entity in the Neo4j graph database are determined based on the address entity, the superior relationship of the address entity, and the subordinate relationship of the address entity in the address information, and based on these nodes, attributes, and edge relationships, a Neo4j graph database corresponding to the address information is created.
[0172] After creating the Neo4j graph database, the initialization algorithm model is also created, including:
[0173] Determine address paths between address entities based on nodes, attributes, and edge relationships in the Neo4j graph database;
[0174] Performing weighted processing on the address entity in the initialization algorithm model according to the address path in the Neo4j graph database to obtain an initialization weight of the address entity;
[0175] According to the initialization weights of the address entities in the Neo4j graph database, addition and subtraction rules for dynamic programming are set to obtain an initialization algorithm model.
[0176] It's worth explaining that the Neo4j graph database stores relationships between data as part of the data itself, allowing for the addition of labels, directions, and attributes. As a data management system designed for efficient storage and querying of graph data, the Neo4j graph database offers significant performance advantages over other database types in relational queries. Based on a pre-created initialization algorithm model, the optimal entity path search is dynamically planned for the candidate entities. This initialization algorithm model includes the weights corresponding to the candidate entities. This weighted initialization algorithm model is then used to dynamically plan paths for the candidate entities, yielding standardized results corresponding to the candidate entities in the address information.
[0177] In this embodiment, by constructing a data model of the Neo4j graph database corresponding to the address information and performing a full-path search on the obtained candidate entities based on a pre-created initialization algorithm model, and performing a graph database query on the original text of the address information obtained from the user, the query efficiency of the candidate entities in the query process and the scalability of the address information data for the Neo4j graph database are effectively improved, while reducing the storage space of the address information data and, to a certain extent, improving the accuracy of the candidate entity search query results.
[0178] The present invention also provides an address information standardization device. Figure 10 , the address information standardization device of the present invention comprises:
[0179] An acquisition module 10 is used to acquire the original text of the address information;
[0180] A search module 20 is configured to search the original text for candidate entities to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match;
[0181] The determination module 30 is configured to perform a dynamic planning optimal entity path search on the candidate entity based on a pre-created initialization algorithm model to obtain a standardized result of the address information.
[0182] In addition, the present invention also provides a computer-readable storage medium, which is preferably a computer-readable storage medium, storing an address information standardization program, which implements the steps of the address information standardization method described above when executed by a processor.
[0183] In the embodiments of the address information standardization device and medium of the present invention, all technical features of the above-mentioned embodiments of the address information standardization method are included, and the description and explanation content are basically the same as those of the above-mentioned embodiments of the address information standardization method, and will not be repeated here.
[0184] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0185] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0186] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0187] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for standardizing address information, characterized in that: The address information standardization method comprises the following steps: Get the original text of the address information; Performing a candidate entity search on the original text to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match; Based on a pre-created initialization algorithm model, a dynamic planning optimal entity path search is performed on the candidate entity to obtain a standardized result of the address information; the step of obtaining the original text of the address information includes: Based on the original text of the address information, preprocessing the original text to obtain a preprocessed original text; The pre-processing method includes one or more of full-width and half-width conversion, meaningless special symbol cleaning, and special text processing; The step of searching the original text for candidate entities to obtain corresponding candidate entities includes: Performing a Neo4j graph database query on the original text to obtain an address entity corresponding to the original text and a parent relationship corresponding to the address entity; Performing regular expression matching on the original text to determine a subordinate relationship that does not exist in the address entity corresponding to the original text; Performing unified fusion processing on the address entity, the superior relationship of the address entity, and the subordinate relationship of the address entity that does not exist to obtain a corresponding candidate entity; The step of performing dynamic planning on the candidate entity to search for the optimal entity path based on the pre-created initialization algorithm model to obtain a standardized result of the address information includes: Inputting the candidate entities into the initialization algorithm model to initialize the weight scores of the address entities in the candidate entities; Based on the weight scores of the candidate entities, dynamically planning the optimal entity path search for the candidate entities to determine the candidate path; Determining a standardized result of the address information based on the candidate path; The step of performing dynamic planning to search for an optimal entity path for the candidate entity based on the weight score of the candidate entity and determining the candidate path includes: Performing a full path search on the candidate entity to obtain an address fragment corresponding to the candidate entity after the full path search; Based on the address fragments, dynamic addition and subtraction planning is performed to obtain weight scores corresponding to the address fragments of the candidate paths; Based on the weight scores, candidate paths whose weight scores meet a preset standard are determined.
2. The method for standardizing address information according to claim 1, wherein: The step of querying the original text based on the Neo4j graph database to obtain the address entity corresponding to the original text and the parent relationship corresponding to the address entity includes: Performing full word segmentation on the original text to obtain fully segmented text segments; The text fragment is input into a data model of a Neo4j graph database, and the address entity corresponding to the text fragment and the parent relationship of the address entity in the Neo4j graph database are queried.
3. The method for standardizing address information according to claim 1, wherein: Before the step of searching the original text for candidate entities to obtain corresponding candidate entities, the address information standardization method further includes creating a Neo4j graph database, specifically including: Get the address information of the province, the city corresponding to the province, and the district corresponding to the city; Processing the address information to obtain address data corresponding to the province, city, and district address information, wherein the data processing includes one or more of cleaning invalid data and fusing address nodes; Import the address data of the province, city, and district into the Neo4j graph database through the built-in procedure function APOC; Based on the address data, the nodes, attributes and edge relationships of the Neo4j graph database are planned and designed, and the corresponding Neo4j graph database is determined.
4. The method for standardizing address information according to claim 1, wherein: Before the step of performing a full-path address standardization search on the candidate entity based on the pre-created initialization algorithm model to obtain a standardized result of the address information, the address information standardization method further includes creating an initialization algorithm model, specifically including: Determine address paths between address entities based on nodes, attributes, and edge relationships in the Neo4j graph database; Performing weighted processing on the address entity in the initialization algorithm model according to the address path in the Neo4j graph database to obtain an initialization weight of the address entity; According to the initialization weights of the address entities in the Neo4j graph database, addition and subtraction rules for dynamic programming are set to obtain an initialization algorithm model.
5. An address information standardization device, characterized in that: The address information standardization device includes: The acquisition module is used to obtain the original text of the address information; A search module is used to search the original text for candidate entities to obtain corresponding candidate entities, wherein the candidate entity search includes one or more of a graph database query and a regular expression match; A determination module, configured to perform a dynamic planning optimal entity path search on the candidate entity based on a pre-created initialization algorithm model to obtain a standardized result of the address information; The search module is further configured to query the original text based on a Neo4j graph database to obtain an address entity corresponding to the original text and a superior relationship corresponding to the address entity; perform regular expression matching on the original text to determine a subordinate relationship that does not exist with the address entity corresponding to the original text; and perform unified fusion processing on the address entity, the superior relationship of the address entity, and the subordinate relationship that does not exist with the address entity to obtain a corresponding candidate entity; The determination module is further used to input the candidate entity into the initialization algorithm model to initialize the weight score of the address entity in the candidate entity; based on the weight score of the candidate entity, dynamically plan the optimal entity path search for the candidate entity to determine the candidate path; based on the candidate path, determine the standardized result of the address information; wherein, based on the weight score of the candidate entity, dynamically plan the optimal entity path search for the candidate entity to determine the candidate path includes: performing a full path search on the candidate entity to obtain the address fragment corresponding to the candidate entity after the full path search; based on the address fragment, perform dynamic addition and subtraction planning to obtain the weight score corresponding to the address fragment of the candidate path; based on the weight score, determine the candidate path whose weight score meets the preset standard.
6. An address information standardization device, characterized in that: The address information standardization device includes: a memory, a processor, and an address information standardization program stored in the memory and executable on the processor. When the address information standardization program is executed by the processor, the steps of the address information standardization method according to any one of claims 1 to 4 are implemented.
7. A medium, which is a computer-readable storage medium, characterized in that: The computer-readable storage medium stores an address information standardization program, which implements the steps of the address information standardization method according to any one of claims 1 to 4 when executed by a processor.
Citation Information
Patent Citations
Fuzzy matching-based Chinese geo-code determination method
CN101719128A