Address matching method, apparatus, device, medium and product
By using a character-level address matching method and leveraging word segmentation and address node library matching techniques, the accuracy of address matching is improved, thus solving the problem of insufficient address parsing precision.
Patent Information
- Application Number
- CN202411918538.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2044-12-24
AI Technical Summary
In existing technologies, address segmentation during address resolution is not accurate enough, resulting in low accuracy of address matching results.
Address matching is performed at the character level. Address character sequences are obtained through word segmentation, and address node matching is performed in combination with a pre-set address node library. The node matching degree of the effective matching sequence is calculated, and candidate address node links are constructed to determine the final matching result.
It improves the accuracy of address matching results and solves the problems of insufficient address resolution accuracy and node matching accuracy.
Smart Images

Figure CN119848164B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer technology, and particularly relate to an address matching method, device, equipment, medium and product. BACKGROUND
[0002] In the field of logistics business, a Chinese address filled by a user is associated to a specific city, district, street and community through an address positioning algorithm, so as to help a logistics company to perform automatic address verification and route planning.
[0003] However, in the process of implementing the present application, it is found that at least the following technical problems exist in the prior art: in the process of address resolution on an address to be queried, the accuracy of address segment division is not high enough, thereby affecting the accuracy of the address matching result. SUMMARY
[0004] Embodiments of the present application provide an address matching method, device, equipment, medium and product, which can perform address matching based on word granularity, analyze and process address nodes in a more fine-grained manner, and improve the accuracy of the address matching result.
[0005] In a first aspect, embodiments of the present application provide an address matching method, which comprises:
[0006] In response to an address matching event, an address to be matched associated with the address matching event is acquired, and the address to be matched is processed for word segmentation in a word segmentation unit to obtain a corresponding address word sequence;
[0007] An address node matching is performed on each word in the address word sequence in a preset address node library, to obtain an address node containing any one word in the address word sequence;
[0008] According to a first position of the word in the address word sequence and a second position of the word in the corresponding address node, an effective matching sequence in the address node that matches the address word sequence is determined;
[0009] According to an importance score of the word in the effective matching sequence, a node matching degree of the address node corresponding to the effective matching sequence is determined; wherein the importance score is an importance analysis result of the word in the effective matching sequence based on address corpus in the preset address node library;
[0010] According to the node matching degree and a corresponding node address level attribute, a candidate address node link is constructed, and a link matching evaluation result is calculated;
[0011] A target address node link is determined according to the link matching evaluation result, and an address composed of the target address node link is taken as an address matching result of the address to be matched.
[0012] In a second aspect, the embodiments of the present application further provide an address matching device, which comprises:
[0013] A to-be-matched address processing module is configured to, in response to an address matching event, acquire a to-be-matched address associated with the address matching event, and perform word segmentation processing on the to-be-matched address in a word segmentation unit to obtain a corresponding address word sequence.
[0014] An address node matching module is configured to perform address node matching on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence.
[0015] A first address node matching analysis module is configured to determine an effective matching sequence in the address node matched with the address word sequence according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node.
[0016] A second address node matching analysis module is configured to determine a node matching degree of the address node corresponding to the effective matching sequence according to an importance score of the word in the effective matching sequence, wherein the importance score is an importance analysis result of the word in the effective matching sequence determined based on an address corpus in the preset address node library.
[0017] An address node link analysis module is configured to construct a candidate address node link and calculate a link matching evaluation result according to the node matching degree and a corresponding node address level attribute.
[0018] A target address matching result determination module is configured to determine a target address node link according to the link matching evaluation result, and determine an address composed of the target address node link as an address matching result of the to-be-matched address.
[0019] In a third aspect, the embodiments of the present application further provide a computer device, which comprises:
[0020] One or more processors;
[0021] A memory configured to store one or more programs;
[0022] When the one or more programs are executed by the one or more processors, the one or more processors implement the address matching method provided by any of the embodiments of the present application.
[0023] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the address matching method provided by any of the embodiments of the present application.
[0024] In a fifth aspect, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the address matching method provided by any of the embodiments of the present disclosure.
[0025] The embodiments of the above invention have the following advantages or beneficial effects:
[0026] In the embodiments of the present invention, in response to an address matching event, a to-be-matched address associated with the address matching event is obtained, and the to-be-matched address is processed by word segmentation to obtain a corresponding address word sequence in a word segmentation unit; an address node matching is performed on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence; according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node, an effective matching sequence in the address node matched with the address word sequence is determined; according to an importance score of the word in the effective matching sequence, a node matching degree of the address node corresponding to the effective matching sequence is determined; wherein the importance score is an importance analysis result of the word in the effective matching sequence based on an address corpus in the preset address node library; according to the node matching degree and a corresponding node address level attribute, a candidate address node link is constructed, and a link matching evaluation result is calculated; according to the link matching evaluation result, a target address node link is determined, and an address composed of the target address node link is taken as an address matching result of the to-be-matched address. The technical scheme of the present invention solves the problems that the correctness of address resolution in the current address matching process is not high enough and the calculation of node matching degree is not accurate enough, can perform address matching based on word granularity, analyzes and processes address nodes in a more fine-grained manner, can find the most matched link with the address, and improves the accuracy of the address matching result. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is a flowchart of an address matching method provided by an embodiment of the present invention;
[0028] Figure 2 is a flowchart of an address matching method provided by an embodiment of the present invention;
[0029] Figure 3 is a schematic diagram of a matching word list structure provided by an embodiment of the present invention;
[0030] Figure 4 is a schematic diagram of an order constraint of a matching word provided by an embodiment of the present invention;
[0031] Figure 5 is a schematic diagram of an effective matching sequence provided by an embodiment of the present invention;
[0032] Figure 6 is a flowchart of an address matching method provided by an embodiment of the present invention;
[0033] Figure 7 is a flow chart of an address matching method provided by an embodiment of the present application;
[0034] Figure 8 is a representation of an inverted index list of an address corpus provided by an embodiment of the present application;
[0035] Figure 9 is an address input exception correction diagram provided by an embodiment of the present application;
[0036] Figure 10 is a structural diagram of an address matching device provided by an embodiment of the present application;
[0037] Figure 11 is a structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the drawings, but not all the structures.
[0039] Figure 1 is a flow chart of an address matching method provided by an embodiment of the present application, and the embodiment can be applicable to the scenario of determining a logistics address in the logistics field. The method can be executed by an address matching device, which can be realized by software and / or hardware, and integrated in a computer device with application development function.
[0040] As shown in Figure 1 , the address matching method of the embodiment includes the following steps:
[0041] S110, in response to an address matching event, obtaining a to-be-matched address associated with the address matching event, and performing word segmentation processing on the to-be-matched address in a word segmentation unit to obtain a corresponding address word sequence.
[0042] The address matching event can be an event occurring in any business scenario that needs address matching analysis. For example, identifying an address after a logistics order generation event occurs, or confirming an address and navigating in an article distribution event. The address information contained in the address matching event is the to-be-matched address associated with the address matching event.
[0043] In the embodiment, the to-be-matched address is processed by word segmentation to obtain a corresponding address word sequence, which is processed by address segment division in word granularity, and thus the text analysis process of the address is not needed, and the accuracy of subsequent address matching can be avoided from being affected by analysis errors. For example, the to-be-matched address is "Xingfu Li community", which can be processed by word segmentation to obtain an address word sequence of "Xing", "Fu", "Li", "Xiao", and "Qu", corresponding to 5 words.
[0044] Before the address word segmentation processing, the to-be-matched address can be formatted according to a preset address format requirement, so that the format of the to-be-matched address is the same as that of the address corpus in the address corpus, thereby improving the efficiency of address recognition and matching.
[0045] Specifically, the words in the address text are divided into 4 categories, including Chinese characters, numbers represented by 0-9, English words represented by a-z and A-Z, and connecting words represented by various punctuation marks. The formatting process can include Chinese number formatting, which converts Chinese numbers in the address into Arabic numbers. For example, "Shiwu" is converted into "15", and "Sanshisi" is converted into "34". The formatting process can include English character formatting, which converts the uppercase letters in the English word into lowercase. For example, "Good" is converted into "good", and "Zoo" is converted into "zoo". The formatting process can include connecting character formatting, which classifies all non-Chinese characters, non-numbers, and non-English characters as connecting words, and represents them with "-".
[0046] S120, performing address node matching for each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence.
[0047] The preset address node library includes existing address texts and other address corpora. The address corpus can be represented in the form of an address node, and each address node can be an address segment. In addition, each address node contains an address level attribute information, and the address level attribute corresponds to a geographical level of the address, such as province, city, district, street / township, community, point of interest, building, etc.
[0048] It can be understood that the serial number or identifier of the address node is used to distinguish different address nodes, and does not represent the address level thereof.
[0049] The address node matching can be performed on each word in the address word sequence in the preset address node library, and the address node containing any word in the address word sequence can be obtained. For example, the words in the address word sequence "Xing", "Fu", "Li", "Xiao" and "Qu" can be matched to a plurality of address nodes containing the word "Xing", a plurality of address nodes containing the word "Fu", a plurality of address nodes containing the word "Li", a plurality of address nodes containing the word "Xiao" and a plurality of address nodes containing the word "Qu". Different word sequences can be matched to the same address node or different address nodes.
[0050] In S130, the effective matching sequence in the address node matched with the address word sequence is determined according to the first position of the word in the address word sequence and the second position of the word in the corresponding address node.
[0051] In the embodiment, the address node can be sorted according to the address node, and the number of words in each address node matched with the address word sequence of the to-be-matched address and the corresponding position can be determined. The sequence position of the word in the address word sequence is recorded as the first position, and the sequence position of the word in the address node is recorded as the second position. It can be understood that when a word appears in a plurality of address nodes, there can be a plurality of second positions. The first position and the second position of the word in the address word sequence relative to a determined address node are determined.
[0052] The more the number of words in the address word sequence matched with the words in the address node, the higher the corresponding matching degree. When there are two or more words in an address node that are the same as the words in the address word sequence, the position order of the words in the address word sequence matched with the address node can be analyzed to determine whether it is an effective match. If the relative position relationship of the second positions of the plurality of words in the address word sequence matched with the address node is different from the relative position relationship of the first positions of the plurality of words, it means that the corresponding address node is an invalid matching address node, and if the same can be confirmed as an effective matching node. Therefore, some invalid matching results can be filtered out.
[0053] Further, the sequence containing the matched words can be extracted from the effective matching node as an effective matching sequence.
[0054] In S140, the node matching degree of the address node corresponding to the effective matching sequence is determined according to the importance score of the word in the effective matching sequence.
[0055] The importance score is an importance analysis result of the word in the effective matching sequence determined based on an address corpus in a preset address node library. For example, in the preset address node library constructed based on the inverted index, the inverse document frequency (IDF) of the word is used to express the importance of the word in the corpus.
[0056] The importance scores of all the words in the effective matching sequence are superimposed to obtain the node matching degree of the address node corresponding to the effective matching sequence.
[0057] S150, constructing a candidate address node link according to the node matching degree and the corresponding node address level attribute, and calculating a link matching evaluation result.
[0058] The node address level attribute can indicate a geographical level corresponding to the address node, such as a province, a city, a district, a street, a community, and a neighborhood. The address node can be a geographical entity corresponding to the address level. The candidate address node links can be obtained by combining the address nodes in the address level order based on the node address level attributes of the address nodes.
[0059] Then, the sum of the node matching degrees of each address node in the candidate address node link is taken as the link matching evaluation result.
[0060] S160, determining a target address node link according to the link matching evaluation result, and taking the address composed of the target address node link as the address matching result of the address to be matched.
[0061] The links can be sorted based on the link matching evaluation result. Based on the sorting result, the target address node link can be determined. For example, the link with the highest matching degree, or the link composed of the address nodes in the top N links with the highest matching degrees is the target address node link. Further, the address composed of the target address node link can be taken as the address matching result of the address to be matched.
[0062] The technical scheme of the embodiment is: in response to an address matching event, an address to be matched associated with the address matching event is acquired, and the address to be matched is processed by word segmentation to obtain a corresponding address word sequence; an address node matching is performed on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence; a valid matching sequence in the address node matched with the address word sequence is determined according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node; a node matching degree of the address node corresponding to the valid matching sequence is determined according to an importance score of the word in the valid matching sequence; wherein the importance score is an importance analysis result of the word in the valid matching sequence based on address corpus in the preset address node library; a candidate address node link is constructed according to the node matching degree and a corresponding node address level attribute, and a link matching evaluation result is calculated; a target address node link is determined according to the link matching evaluation result, and an address formed by the target address node link is taken as an address matching result of the address to be matched. The technical scheme solves the problems that the correctness of address resolution in the current address matching process is not high enough and the calculation of the node matching degree is not accurate enough, can perform address matching based on word granularity, analyzes and processes the address node in a more fine-grained manner, can find the most matched link with the address, and improves the accuracy of the address matching result.
[0063] Figure 2 The flowchart of the address matching method provided by the embodiment is of the same inventive concept as the address matching method in the above embodiment, and further describes the process of determining the valid matching sequence. The method can be executed by an address matching device, which can be realized by software and / or hardware and integrated in a computer device with application development function.
[0064] As shown in Figure 2 , the address matching method of the embodiment includes the following steps:
[0065] S210, in response to an address matching event, an address to be matched associated with the address matching event is acquired, and the address to be matched is processed by word segmentation to obtain a corresponding address word sequence.
[0066] Suppose that the address to be matched is represented as cleanAddress. After the address cleanAddress is segmented, an address word sequence address.wordList composed of address.length words is obtained. The kth(0≤k<address.length) word is represented as address.word k .
[0067] S220, performing address node matching for each word in the address word sequence in the preset address node library to obtain an address node containing any word in the address word sequence.
[0068] That is, taking address.word k as a keyword, the address node containing address.word k is searched in the inverted index of the preset address node library.
[0069] S230, for each address node, constructing a matching word list, wherein the list elements in the matching word list are used to represent the first position and the second position of the word existing in the address word sequence and the address node at the same time.
[0070] Taking each address node as an analysis object, a matching word list is constructed, that is, each word k that hits the address node is found, and the hit result is organized in units of address nodes to obtain all hit sequences node.hitLis on each node.
[0071] The matching word list can refer to the structure content shown in Figure 3 . Each node corresponds to a matching word list (hitList). Each list element (hit) in hitList is represented as <k, j>. That is, address.word k = node.word j , indicating that the kth word of the address hits the jth word of the node (node.hit = <k, j>).
[0072] Wherein, the serial number k represents the first position of the matched word address.word k in the address word sequence, and j represents the second position of the matched word address.word k in the address node.
[0073] Figure 3 In the above table, address.length = 13, of which 12 words hit different positions of words on node1-node5, address.word7 does not hit any node, and address.word5 hits node3 and node5 at the same time.
[0074] S240, checking the consistency of the first relative position relationship between the first positions corresponding to any two list elements in the matching word list and the second relative position relationship between the second positions corresponding to the any two list elements.
[0075] The consistency of the first relative position relationship between the first positions and the second relative position relationship between the corresponding second positions represents the consistency of the order between the address words in the address word sequence and the order of the address text in the address node to which the match arrives. In the address matching process, the order constraint between the hits of the address on the node must be met to confirm the valid node matching result.
[0076] In the judgment, the judgment of the position order can be based on the k and j values of each list element (hit).
[0077] For example, for any two hits in the node.hitList m and hit n , and hit m .k<hit n .k. If hit m .j<hit n .j, define hit m and hit n to meet the order constraint, denoted as order(hit m ,hit n )=true; if hit m .j≥hit n .j, define hit m and hit n to not meet the order constraint, denoted as order(hit m ,hit n )=false. The order constraint requires that if the position of hit m in the address is before the position of hit n , then the position of hit m in the node must also be before the position of hit n .
[0078] S250, the list elements corresponding to the first relative position relationship and the second position relationship that pass the consistency check correspond to the words as valid matching words, and the valid matching sequence in the corresponding address node that matches the address word sequence is determined based on the valid matching words.
[0079] For example, cleanAddress = "Happiness South Village", node1.cleanName = "Happiness South Village", node2.cleanName = "Xiaonan Street", then address.word2 = "South", address.word4 = "Xiao", node1.word2 = "South", node1.word3 = "Xiao", node2.word2 = "South", node2.word1 = "Xiao", then order (South, Xiao) = true in node1, and order (South, Xiao) = false in node2, as shown in FIG. 8. "South" and "Xiao" in node1 are valid matching words. Figure 4
[0080] After determining the valid matching words, the longest matching sequence composed of the most matching words satisfying the order constraint in the address node can be found as the valid matching sequence. Specifically, for the address node containing valid matching words, each valid matching word can be taken as a first sequence element of a matching sequence; then, according to the order corresponding to the second position of each valid matching word, the sequence element following each first sequence element can be determined from the valid matching words other than the valid matching word corresponding to the first sequence element, to obtain at least one matching sequence and the corresponding sequence length; and the matching sequence corresponding to the longest sequence length in the sequence length is taken as the valid matching sequence.
[0081] For example, the valid matching sequence is denoted as node.matchHitList. The logic of finding node.matchHitList from node.hitList can be described as follows.
[0082] For each hit in node.hitList, all hits satisfying the order constraint with the hit are denoted as hit.followHitList = {followHit | followHit e hitList, order (hit, followHit) = true}, and the length of the valid matching sequence starting with the hit is denoted as hit.matchSize. Then for each hit, 0 or 1 nextHit satisfying the following three conditions can be found in hitList, satisfying hit.matchSize = nextHit.matchSize + 1.
[0083] 1). nextHit e hit.followHitList.
[0084] 2). nextHit.matchSize = max followHit∈hit.followHitList followHit.matchSize.
[0085] 3) For cases where otherHit∈hit.followHitList, otherHit≠nextHit, and otherHit.matchSize=nextHit.matchSize, otherHit.j>nextHit.j is required.
[0086] Based on the above conditions, we can recursively calculate the `hit.matchSize` and `hit.nextHit`, and `matchHit0` for each hit. If there is more than one hit with the largest `matchSize`, we take the one with the largest `hit.k` as `matchHit0`. Subsequent hits in `node.matchHitList` can then be recursively constructed.
[0087] matchHit1=matchHit0.nextHit, matchHit2=matchHit1.nextHit, matchHit3=matchHit2.nextHit,…, matchHit t Among them, matchHit t This is called a Terminal Hit, which satisfies the matchHit condition. t .nextHit = null.
[0088] like Figure 5 As shown, the query address hit three levels of nodes, with each line representing a node. i A hit in `.hitList`. A solid colored line represents a valid hit in `node.matchHitList`, while a dashed black line represents an invalid hit.
[0089] S260. Based on the importance score of the words in the valid matching sequence, determine the node matching degree of the address node corresponding to the valid matching sequence.
[0090] Among them, the importance score is the result of importance analysis of words in the effective matching sequence based on the address corpus in the preset address node library.
[0091] S270. Based on the node matching degree and the corresponding node address level attribute, construct candidate address node links and calculate the link matching evaluation result.
[0092] S280. Determine the target address node link based on the link matching evaluation result, and use the address composed of the target address node link as the address matching result of the address to be matched.
[0093] The technical scheme of the embodiment is: in response to an address matching event, a to-be-matched address associated with the address matching event is acquired, and the to-be-matched address is processed by word segmentation to obtain a corresponding address word sequence in a word segmentation unit; address node matching is performed on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence; for each address node, a matching word list is constructed, wherein a list element in the matching word list is used to represent a first position and a second position of a word existing in the address word sequence and the address node at the same time; consistency of a first relative position relationship between the first positions corresponding to any two list elements in the matching word list and a second relative position relationship between the second positions corresponding to the any two list elements is verified; a word corresponding to a list element corresponding to the first relative position relationship and the second position relationship that pass the consistency verification is taken as an effective matching word, and an effective matching sequence in the corresponding address node that matches the address word sequence is determined based on the effective matching word; a node matching degree of the address node corresponding to the effective matching sequence is determined according to an importance score of the word in the effective matching sequence; wherein the importance score is an importance analysis result of the word in the effective matching sequence determined based on address corpus in the preset address node library; a candidate address node link is constructed according to the node matching degree and a corresponding node address level attribute, and a link matching evaluation result is calculated; a target address node link is determined according to the link matching evaluation result, and an address formed by the target address node link is taken as an address matching result of the to-be-matched address. The technical scheme solves the problems that the correctness of address resolution in the current address matching process is not high enough and the calculation of the node matching degree is not accurate enough, can perform address matching based on a word granularity, analyzes and processes address nodes in a more fine-grained manner, can find a link that matches the address most, and improves the accuracy of the address matching result.
[0094] Figure 6 The flowchart of the address matching method provided by the embodiment of the application, the embodiment and the address matching method in the above embodiment belong to the same inventive concept, and further illustrate the process of calculating the node matching degree. The method can be executed by an address matching device, and the device can be realized in a software and / or hardware manner and integrated in a computer device with application development functions.
[0095] As shown in Figure 6 , the address matching method of the embodiment includes the following steps:
[0096] S310, in response to an address matching event, a to-be-matched address associated with the address matching event is acquired, and the to-be-matched address is processed by word segmentation to obtain a corresponding address word sequence in a word segmentation unit.
[0097] S320, address node matching is performed on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence.
[0098] S330, determining, according to the first position of the word in the address word sequence in the address word sequence and the second position in the corresponding address node, an effective matching sequence in the address node matching the address word sequence.
[0099] S340, calculating the sum of the first importance scores of each effective matching word in the effective matching sequence relative to all address corpora in the preset address node library.
[0100] The first importance score of the effective matching word relative to all address corpora in the preset address node library can be the inverse document frequency of the inverted index of each word in the preset address node library, which is represented by the formula . Wherein, T is the total number of nodes containing the corresponding word, and T_word is the word frequency.
[0101] The present application takes the IDF value of the word as the score of the word, that is, word.score=word.idf.
[0102] The sum of the first importance scores is the result of superimposing the inverse document frequency of each word in the effective matching sequence.
[0103] S350, calculating the sum of the second importance scores of each effective matching word in the effective matching sequence relative to the corresponding address node.
[0104] In order to express the importance of the word in a single node, the concept of activation is proposed, that is, the second importance score of the effective matching word relative to the corresponding address node.
[0105] The activation of the jth word in the node node is represented as word j .active=word j .score÷node.score. From the formula, the activation of the same word to different nodes is inversely proportional to node.score, assuming that node1.cleanName="Happy Community" and node2.cleanName="Xiaozhuang Village", the word "Xiao" is node1.word2 and node2.word0 respectively, when node1.score>node2.score, node1.word2.active<node2.word0.active, that is, the importance of "Xiao" in node2 is higher than that in node1.
[0106] The sum of the second importance scores is obtained by superimposing the activation of each effective matching word in the effective matching sequence relative to the corresponding address node.
[0107] S360, multiplying the sum of the first importance scores and the sum of the second importance scores, as the node matching degree of the address node corresponding to the effective matching sequence.
[0108] The product of the sum of the activation degrees of all matching words in the node.matchHitList and the sum of the scores is defined as the matching score node.matchScore of the node, which is formally expressed as follows:
[0109]
[0110] Because the score of a word word.score represents the importance of the word in the corpus, and the activation degree of the word to the node word.active represents the importance of the word in the node, the matching score calculation mechanism takes into account the global and local importance of the word, and more accurately expresses the difference in matching degree between different levels of nodes.
[0111] In a preferred embodiment, before determining the node matching degree of the address node corresponding to the effective matching sequence, the relative positional relationship of the two adjacent effective matching words in the address word sequence and the relative positional relationship in the corresponding address node can be used to determine the address input abnormality in the address to be matched; the effective matching sequence is corrected according to the address input abnormality. Further, the node matching degree of the corresponding address node is calculated based on the corrected effective matching sequence.
[0112] The address input abnormality includes address misspelling, address abbreviation, and address omission, etc. For different abnormal conditions, the misspelled word (not matched) in the address can be corrected to a matching word, and the abbreviated or omitted word in the address can be supplemented.
[0113] The identification of the address input abnormality can be performed according to the relative positional relationship of the two adjacent effective matching words in the address word sequence and the relative positional relationship in the corresponding address node.
[0114] For example, if the relative positional relationship of the two adjacent effective matching words in the address word sequence is the adjacent positional relationship, and the relative positional relationship of the two adjacent effective matching words in the corresponding address node is the positional relationship with an interval, it is determined that the address input abnormality is the address abbreviation abnormality.
[0115] If the relative position relationship of the two adjacent valid matching words in the address word sequence and the relative position relationship of the two adjacent valid matching words in the corresponding address node are both interval position relationships, the first pinyin of the interval position in the word sequence corresponding to the address word sequence and the second pinyin of the interval position in the word corresponding to the address node are identified; in the case that the pinyin identification result indicates that the first pinyin and the second pinyin are the same, it is determined that the address input abnormality is an address miswriting abnormality.
[0116] In addition, if the relative position relationship of the two adjacent valid matching words in the address word sequence and the relative position relationship of the two adjacent valid matching words in the corresponding address node are both adjacent position relationships, whether an address omission abnormality occurs is determined according to the relative positions of the valid matching sequence in the address word sequence and the address node.
[0117] S370, constructing a candidate address node link according to the node matching degree and the corresponding node address level attribute, and calculating a link matching evaluation result.
[0118] S380, determining a target address node link according to the link matching evaluation result, and taking the address composed of the target address node link as the address matching result of the to-be-matched address.
[0119] The technical scheme of the embodiment, in response to an address matching event, acquires a to-be-matched address associated with the address matching event, and performs word segmentation processing on the to-be-matched address to obtain a corresponding address word sequence in a word segmentation unit; performs address node matching on each word in the address word sequence in a preset address node library to obtain an address node containing any one word in the address word sequence; determines a valid matching sequence in the address node matched with the address word sequence according to the first position of the word in the address word sequence and the second position of the word in the corresponding address node; calculates the sum of the first importance scores of each valid matching word in the valid matching sequence relative to all address corpora in the preset address node library; calculates the sum of the second importance scores of each valid matching word in the valid matching sequence relative to the corresponding address node; takes the product of the sum of the first importance scores and the sum of the second importance scores as the node matching degree of the address node corresponding to the valid matching sequence; constructs a candidate address node link according to the node matching degree and the corresponding node address level attribute, and calculates a link matching evaluation result; determines a target address node link according to the link matching evaluation result, and takes the address composed of the target address node link as the address matching result of the to-be-matched address. The technical scheme of the present application solves the problems that the correctness of address resolution in the current address matching process is not high enough and the calculation of node matching degree is not accurate enough, can perform address matching based on word granularity, analyzes and processes address nodes more granularly, can find the most matched link with the address, and improves the accuracy of the address matching result.
[0120] Figure 7 A flow chart of an address matching method according to an embodiment of the present application is provided, which belongs to the same inventive concept as the address matching method in the above embodiment, and further illustrates the process of determining the valid matching sequence. The method can be executed by an address matching device, which can be implemented in software and / or hardware, and integrated into a computer device with application development function.
[0121] As shown in Figure 7 , the address matching method according to the embodiment comprises the following steps:
[0122] S410, each address segment in the address corpus in the preset address node library is taken as an address node, and an inverted index of each word in the address node is constructed.
[0123] Specifically, each address segment can be represented as node.cleanName. node.cleanName is divided into node.length words node.wordList, and the jth (0≤j<node.length) word in the node node is represented as node.word j <node,j>. The position of a word in different level nodes is represented as word.nodeList={<node i ,j>|0≤i<T,0≤j<node i .length}, and T is the total number of nodes.
[0124] For example, node1.cleanName="Tubridge pluss community 2 period" is segmented to obtain node1.wordList={"Tubridge", "pluss", "community", "2", "period"}; and node2.cleanName="Beida Street No. 2 Courtyard" is segmented to obtain node2.wordList={"Beida", "Street", "No.", "2", "Courtyard"}. "2" is the 5th word in node1 and the 3rd word in node2, and thus "2".nodeList={<node1,5>,<node2,3>}.
[0125] In addition, the number of nodes containing word is referred to as the word frequency of word, denoted as T word . For example, if the names of 1000 nodes all contain "community", the word frequency of "community" is equal to 1000.
[0126] The word word is taken as key, and word.nodeList is taken as value, and stored in a Hash table, so as to obtain the inverted index of the level nodes, as shown in Figure 8The inverted index can quickly find all nodes containing the word according to the word.
[0127] S420, calculate the inverse document frequency of each word according to the inverted index, and take the inverse document frequency as the first importance score of the corresponding word relative to the preset address node library.
[0128] In natural language processing, the importance of a word in a corpus is expressed by the inverse document frequency (IDF), which is represented by the formula , where T is the total number of nodes, T word is the word frequency. The present application takes the IDF value of word as the score of the word, i.e. word.score = word.idf; and takes the sum of the scores of all words in a node as the node score
[0129] S430, calculate the sum of the first importance scores of all words in each address node to obtain the corresponding address node score, and take the ratio of the first importance score of each word to the address node score as the second importance score of each word in the address node relative to the address node.
[0130] To express the importance of a word in a single node, the present application proposes the concept of activation, which is represented by the formula j .active = word j .score ÷ node.score. From the formula, it can be seen that the activation of the same word in different nodes is inversely proportional to node.score. Let node1.cleanName = "Happy Community" and node2.cleanName = "Xiaozhuang Village", and let "Xiao" be node1.word2 and node2.word0, respectively. When node1.score > node2.score, node1.word2.active < node2.word0.active, i.e. the importance of "Xiao" in node2 is higher than that in node1.
[0131] Through the above scoring strategy, the importance of a word in the entire corpus and in a single node is defined, which plays a key role in subsequent calculation of the matching degree between the address cleanAddress and the node name node.cleanName.
[0132] S440, in response to an address matching event, obtaining a to-be-matched address associated with the address matching event, and performing word segmentation processing on the to-be-matched address to obtain a corresponding address word sequence.
[0133] S450, performing address node matching for each word in the address word sequence in the preset address node library to obtain an address node containing any word in the address word sequence.
[0134] Taking each word in the address word sequence as a search keyword respectively, searching in the word.nodeList corresponding to the keyword, the address node containing the search keyword can be determined.
[0135] S460, determining an effective matching sequence in the address node matched with the address word sequence according to the first position of the word in the address word sequence and the second position of the word in the corresponding address node.
[0136] S470, determining an address input abnormality according to the relative position relationship of two adjacent effective matching words in the effective matching sequence in the address word sequence and the relative position relationship of the two adjacent effective matching words in the corresponding address node; and correcting the effective matching sequence according to the address input abnormality.
[0137] Specifically, according to the analysis of the relative position relationship of two adjacent effective matching words in the effective matching sequence in the address word sequence and the relative position relationship of the two adjacent effective matching words in the corresponding address node, if the relative position relationship of the two adjacent effective matching words in the address word sequence is a position relationship with a gap, and the relative position relationship of the two adjacent effective matching words in the corresponding address node is also a position relationship with a gap, the position of the gap in the first pinyin of the corresponding word in the address word sequence and the position of the gap in the second pinyin of the corresponding word in the address node are identified; in the case that the pinyin recognition result indicates that the first pinyin and the second pinyin are the same, the address input abnormality is determined to be an address miswriting abnormality.
[0138] For two hits in node.matchHitList m and hit m+1 , if hit m+1 .j-hit m .j>1, it means that there is a gap (Gap) in node.cleanName between the two hits that is not matched; if hit m+1 .k-hit m .k>1, it means that there is a gap (Gap) in the address cleanAddress between the two hits that is not matched.
[0139] When hit m .k-hit m+1 .k=hit m .j-hit m+1j>1, which means that the gap size of the two hits in node.cleanName and cleanAddress is equal, which is likely to be caused by homophonic and different forms of characters. At this time, for each pair of characters address.word k and node.word j According to the pinyin matching, if address.word k .pinyin=node.word j .pinyin, it means that the kth character in the address and the jth character in the node are homophonic and different forms of characters. Because in the address landing scenario, the case of homophonic and different forms of characters is very common, the present application inserts hit=<k,j> into the corresponding position of node.matchHitList to enhance the hit rate of the address to the node. As shown in Figure 9 (1), the solid line represents the hit identified based on address.word k =node.word j , and the dashed line represents the hit identified based on address.word k .pinyin=node.word j .pinyin.
[0140] In addition, the character granularity-based matching method can well support matching to the correct hierarchical node when the address is abbreviated or omitted, as shown in Figure 9 (2) and (3). When the relative position relationship of the two adjacent valid matching characters in the address character sequence is adjacent, and the relative position relationship of the two adjacent valid matching characters in the corresponding address node is a position relationship with an interval, it is determined that the address input is abnormal. In addition, when the relative position relationship of the two adjacent valid matching characters in the address character sequence and in the corresponding address node is adjacent, it can be determined according to the relative position of the valid matching sequence in the address character sequence and in the address node whether the address is omitted, such as whether there are other characters at the tail or front of the valid matching sequence.
[0141] S480, determining the node matching degree of the address node corresponding to the valid matching sequence according to the importance score of the characters in the corrected valid matching sequence.
[0142] The importance score is the importance analysis result of the characters in the valid matching sequence determined based on the address corpus in the preset address node library.
[0143] S490, according to the node matching degree and the corresponding node address level attribute, constructing a candidate address node link, and calculating a link matching evaluation result; according to the link matching evaluation result, determining a target address node link, and taking an address composed of the target address node link as an address matching result of the address to be matched.
[0144] After calculating the matching score node.matchScore of each hit node, a link needs to be constructed according to the ownership relationship of the level node in definition 1. For example, as shown in FIG. 2, the address cleanAddress hits node1 (Xicheng District), node2 (Deseng Street), and node3 (6puankangbei Community). On the geographical level tree, node2 is a node under node1, and node3 is a node under node2, so a matching link link = <node1, node2, node3> can be constructed. Figure 4 If nodeb is an ancestor node of nodea, it is expressed as nodea.isAncestorOf(nodeb) = true. This ancestor relationship is transitive, for example, node1.isAncestorOf(node2) = true, node2.isAncestorOf(node3) = true, so node1.isAncestorOf(node3) = true.
[0145] In this embodiment, the link score node.linkScore of a node is equal to the sum of the matching scores of the current node and all ancestor nodes thereof, for example, as shown in FIG. 2, node1.linkScore = node1.matchScore, node2.linkScore = node1.matchScore + node2.matchScore, and node3.linkScore = node1.matchScore + node2.matchScore + node3.matchScore. Figure 8
[0146] The link score of a node not only considers the matching degree of the query address to the node, but also considers the matching degree to the ancestor nodes thereof, so the link score of the node can better represent the matching degree of the node to the entire query address. In this embodiment, all level nodes are sorted according to the link score node.linkScore from large to small, and then the first k nodes are taken, so that the k level nodes most matched with the query address are obtained.
[0147] The technical solution of this embodiment takes each address fragment in the address corpus in the preset address node library as an address node and constructs an inverted index for each character in the address node; calculates the inverse document frequency (IVF) of each character based on the IVF, and uses the IVF as the first importance score of the corresponding character relative to the preset address node library; calculates the sum of the first importance scores of all characters in each address node to obtain the corresponding address node score, and uses the ratio of the first importance score of each character to the address node score as the second importance score of each character in the address node relative to the address node; responds to an address matching event, obtains the address to be matched associated with the address matching event, and performs word segmentation on the address to be matched using characters as the word segmentation unit to obtain the corresponding address character sequence; performs address node matching for each character in the address character sequence in the preset address node library to obtain an address character sequence containing any character in the address character sequence. The invention involves identifying a single-word address node. Based on the first position of a word in the address word sequence and its second position in the corresponding address node, a valid matching sequence is determined within the address node. Anomalies in the address input of the target address are identified based on the relative positions of two adjacent valid matching words in the address word sequence and their corresponding address nodes. The valid matching sequence is then corrected according to these anomalies. The node matching degree of the address node corresponding to the corrected valid matching sequence is determined based on the importance score of the words in the corrected valid matching sequence. Candidate address node links are constructed based on the node matching degree and the corresponding node address hierarchy attribute, and the link matching evaluation result is calculated. The target address node link is determined based on the link matching evaluation result, and the address formed by the target address node link is used as the address matching result for the target address. This invention solves the problems of insufficient accuracy in address parsing and imprecise calculation of node matching degree in current address matching processes. It allows for address matching at the word level, providing finer-grained analysis and processing of address nodes, finding the most matching link, and improving the accuracy of address matching results.
[0148] Figure 10 This is a schematic diagram of an address matching device provided in an embodiment of the present invention. This embodiment can be applied to scenarios in the logistics field for determining logistics addresses or planning delivery routes. The address matching device can be implemented by software and / or hardware and integrated into a computer terminal device with application development capabilities.
[0149] like Figure 10 The address matching device shown includes: a module 510 for processing addresses to be matched, a module 520 for matching addresses, a module 530 for analyzing first address nodes, a module 540 for analyzing second address nodes, a module 550 for analyzing address nodes link, and a module 560 for determining the target address matching result.
[0150] The address matching event response module 510 is configured to, in response to an address matching event, acquire a to-be-matched address associated with the address matching event, and perform word segmentation processing on the to-be-matched address in word units to obtain a corresponding address word sequence. The address node matching module 520 is configured to perform address node matching on each word in the address word sequence in a preset address node library to obtain an address node containing any one word in the address word sequence. The first address node matching analysis module 530 is configured to determine an effective matching sequence in the address node that matches the address word sequence according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node. The second address node matching analysis module 540 is configured to determine a node matching degree of the address node corresponding to the effective matching sequence according to an importance score of the word in the effective matching sequence. The importance score is an importance analysis result of the word in the effective matching sequence determined based on address corpus in the preset address node library. The address node link analysis module 550 is configured to construct a candidate address node link according to the node matching degree and a corresponding node address level attribute, and calculate a link matching evaluation result. The target address matching result determination module 560 is configured to determine a target address node link according to the link matching evaluation result, and take an address composed of the target address node link as an address matching result of the to-be-matched address.
[0151] The technical scheme of the embodiment is configured to, in response to an address matching event, acquire a to-be-matched address associated with the address matching event, and perform word segmentation processing on the to-be-matched address in word units to obtain a corresponding address word sequence. The address node matching module 520 is configured to perform address node matching on each word in the address word sequence in a preset address node library to obtain an address node containing any one word in the address word sequence. The first address node matching analysis module 530 is configured to determine an effective matching sequence in the address node that matches the address word sequence according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node. The second address node matching analysis module 540 is configured to determine a node matching degree of the address node corresponding to the effective matching sequence according to an importance score of the word in the effective matching sequence. The importance score is an importance analysis result of the word in the effective matching sequence determined based on address corpus in the preset address node library. The address node link analysis module 550 is configured to construct a candidate address node link according to the node matching degree and a corresponding node address level attribute, and calculate a link matching evaluation result. The target address matching result determination module 560 is configured to determine a target address node link according to the link matching evaluation result, and take an address composed of the target address node link as an address matching result of the to-be-matched address.
[0152] In an optional implementation, the first address node matching analysis module 530 is specifically configured to:
[0153] For each address node, a matching word list is constructed, wherein a list element in the matching word list is used to represent the first position and the second position of a word existing in both the address word sequence and the address node;
[0154] The consistency between the first relative position relationship between the first positions corresponding to any two list elements in the matching word list and the second relative position relationship between the second positions corresponding to the any two list elements is verified;
[0155] The word corresponding to the list element corresponding to the first relative position relationship and the second position relationship that pass the consistency verification is taken as an effective matching word, and an effective matching sequence matching the address word sequence in the corresponding address node is determined based on the effective matching word.
[0156] In an optional implementation, the first address node matching analysis module 530 is further specifically configured to:
[0157] Each effective matching word is taken as a first sequence element of a matching sequence;
[0158] According to the order corresponding to the second position of each effective matching word, sequence elements after each first sequence element are determined in the effective matching words other than the effective matching word corresponding to the first sequence element, to obtain at least one matching sequence and a corresponding sequence length;
[0159] The matching sequence corresponding to the longest sequence length in the sequence length is taken as the effective matching sequence.
[0160] In an optional implementation, the second address node matching analysis module 540 is specifically configured to:
[0161] The sum of the first importance scores of each effective matching word in the effective matching sequence relative to all address corpora in the preset address node library is calculated;
[0162] The sum of the second importance scores of each effective matching word in the effective matching sequence relative to the corresponding address node is calculated;
[0163] The product of the sum of the first importance scores and the sum of the second importance scores is taken as the node matching degree of the address node corresponding to the effective matching sequence.
[0164] In an optional implementation, the address matching device further comprises an address anomaly identification and correction module, configured to:
[0165] Before determining the node matching degree of the address node corresponding to the valid matching sequence, according to the relative position relationship of the two adjacent valid matching words in the valid matching sequence in the address word sequence and the relative position relationship in the corresponding address node, the address input abnormality in the to-be-matched address is determined.
[0166] According to the address input abnormality, the valid matching sequence is modified.
[0167] In an optional embodiment, the address abnormality identification and modification module can be used for:
[0168] If the relative position relationship of the two adjacent valid matching words in the address word sequence is the adjacent position relationship, and the relative position relationship of the two adjacent valid matching words in the corresponding address node is the position relationship with interval, it is determined that the address input abnormality is the address abbreviation abnormality.
[0169] In an optional embodiment, the address abnormality identification and modification module can be used for:
[0170] If the relative position relationship of the two adjacent valid matching words in the address word sequence is the position relationship with interval, and the relative position relationship of the two adjacent valid matching words in the corresponding address node is the position relationship with interval, the interval position in the first pinyin of the word corresponding to the address word sequence and the interval position in the second pinyin of the word corresponding to the address node are identified.
[0171] In the case that the pinyin recognition result indicates that the first pinyin and the second pinyin are the same, it is determined that the address input abnormality is the address miswriting abnormality.
[0172] In an optional embodiment, the address abnormality identification and modification module can be used for:
[0173] If the relative position relationship of the two adjacent valid matching words in the valid matching sequence in the address word sequence and the relative position relationship in the corresponding address node are both adjacent position relationships, whether the address omission abnormality occurs is determined according to the relative position of the valid matching sequence in the address word sequence and the address node.
[0174] In an optional embodiment, the address node link analysis module 550 is specifically used for:
[0175] According to the node address level attribute of each address node, at least one candidate address node link is constructed;
[0176] The node matching degrees of each address node in the candidate address node link are superimposed to obtain a node matching degree sum, and the node matching degree sum is taken as a link matching evaluation result of the corresponding candidate address node link.
[0177] In an alternative embodiment, the address corpus importance analysis module is configured to:
[0178] determine the importance score of each word in the address node based on the address corpus in the preset address node library;
[0179] The determination process of the importance score specifically comprises:
[0180] each address segment in the address corpus in the preset address node library is taken as an address node, and an inverted index of each word in the address node is constructed;
[0181] the inverse document frequency of each word is calculated according to the inverted index, and the inverse document frequency is taken as the first importance score of the corresponding word relative to the preset address node library;
[0182] the sum of the first importance scores of all words in each address node is calculated to obtain the address node score, and the ratio of the first importance score of each word to the address node score is taken as the second importance score of each word in the address node relative to the address node.
[0183] The address matching device provided by the embodiments of the present application can execute the address matching method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method.
[0184] Figure 11 A structural schematic diagram of a computer device provided by the embodiments of the present application is shown. Figure 11 A block diagram of an exemplary computer device 12 suitable for implementing embodiments of the present application is shown. Figure 11 The computer device 12 shown is merely an example, and should not bring any limitation to the functions and use range of the embodiments of the present application. The computer device 12 can be any terminal device with computing capability, such as a smart controller, a server, a mobile phone, and the like.
[0185] As shown in Figure 11 The computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 can include but are not limited to one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components, including the system memory 28 and the processing unit 16.
[0186] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0187] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0188] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 11 Not shown; usually referred to as a "hard drive"). Although Figure 11 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0189] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0190] Computer device 12 can also communicate with one or more external devices 14 such as a keyboard, a pointing device, a display 24, etc.; one or more devices that enable a user to interact with computer device 12; and / or any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface(s) 22. Still yet, computer device 12 can communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via network adapter 20. As depicted, network adapter 20 communicates with the other components of computer device 12 via bus 18. It should be appreciated that although not shown, other hardware and / or software modules could be used in conjunction with computer device 12. Examples, include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc. Figure 11
[0191] Processing unit 16 performs various function applications and data processing by running programs stored in system memory 28, such as implementing the address matching method provided by the present embodiment, which includes:
[0192] In response to an address matching event, obtaining a to-be-matched address associated with the address matching event, and performing word segmentation on the to-be-matched address in word units to obtain a corresponding address word sequence;
[0193] Performing address node matching on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence;
[0194] Determining an effective matching sequence in the address node matched with the address word sequence according to a first position of the word in the address word sequence and a second position of the word in the corresponding address node;
[0195] Determining a node matching degree of the address node corresponding to the effective matching sequence according to an importance score of the word in the effective matching sequence; wherein the importance score is an importance analysis result of the word in the effective matching sequence based on an address corpus in the preset address node library;
[0196] Constructing a candidate address node link according to the node matching degree and a corresponding node address level attribute, and calculating a link matching evaluation result;
[0197] Determining a target address node link according to the link matching evaluation result, and taking an address composed of the target address node link as an address matching result of the to-be-matched address.
[0198] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the address matching method provided by any embodiment of the present application, and the method comprises the following steps:
[0199] In response to the address matching event, a to-be-matched address associated with the address matching event is acquired, and the to-be-matched address is processed by word segmentation to obtain a corresponding address word sequence in a word segmentation unit;
[0200] Address node matching is performed on each word in the address word sequence in a preset address node library to obtain an address node containing any word in the address word sequence;
[0201] According to a first position of the word in the address word sequence and a second position of the word in the corresponding address node, an effective matching sequence in the address node matched with the address word sequence is determined;
[0202] According to an importance score of the word in the effective matching sequence, a node matching degree of the address node corresponding to the effective matching sequence is determined; wherein the importance score is an importance analysis result of the word in the effective matching sequence based on address corpus in the preset address node library;
[0203] According to the node matching degree and a corresponding node address level attribute, a candidate address node link is constructed, and a link matching evaluation result is calculated;
[0204] According to the link matching evaluation result, a target address node link is determined, and an address composed of the target address node link is taken as an address matching result of the to-be-matched address.
[0205] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of the computer readable storage medium include: an electrical connection having one or more conductive wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.
[0206] A computer readable signal medium can include a propagated data signal with computer executable prograrn code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that can be
[0207] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0208] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0209] Those skilled in the art will appreciate that the modules or steps of the application described above can be implemented in a general purpose computer, and they can be centralized in a single computer or distributed over a network of multiple computers, and optionally, they can be implemented by computer executable program code, which can be stored in a storage device and executed by a computer, or they can be made into individual integrated circuit modules, or a plurality of modules or steps can be made into a single integrated circuit module. Thus, the present application is not limited to any particular combination of hardware and software.
[0210] The embodiments of the present disclosure further provide a computer program product, comprising a computer program which, when executed by a processor, implements the address matching method provided in any one of the embodiments of the present disclosure.
[0211] Computer program products can be written in any of various programming languages, including an object oriented programming language such as Java, Smalltalk, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0212] It is to be understood that the above description is a non-limiting example of the application, and that the application is not limited to the particular examples disclosed. Various alterations, modifications, and improvements will occur to those skilled in the art upon the reading of the foregoing description. It is intended to embrace all such alterations, modifications, and improvements in the scope of the application which falls within the spirit and scope of the appended claims. Although specific embodiments of the application have been described in detail, those skilled in the art will appreciate that various modifications to the above-described embodiments can be made without departing from the spirit and scope of the application. Accordingly, the scope of the application is not intended to be limited to the specific embodiments described herein, but rather only by the claims which follow.
Claims
1. An address matching method, characterized in that, include: In response to an address matching event, the address to be matched associated with the address matching event is obtained, and the address to be matched is segmented into words to obtain the corresponding address word sequence. For each word in the address word sequence, perform address node matching in a preset address node library to obtain an address node that contains any one word in the address word sequence; Based on the first position of a word in the address word sequence and its second position in the corresponding address node, a valid matching sequence in the address node that matches the address word sequence is determined. Based on the importance score of the words in the effective matching sequence, the node matching degree of the address node corresponding to the effective matching sequence is determined; wherein, the importance score is the importance analysis result of the words in the effective matching sequence determined based on the address corpus in the preset address node library; Based on the node matching degree and the corresponding node address hierarchy attribute, candidate address node links are constructed, and link matching evaluation results are calculated. The target address node link is determined based on the link matching evaluation result, and the address composed of the target address node link is used as the address matching result of the address to be matched.
2. The method according to claim 1, characterized in that, The step of determining a valid matching sequence in the address node that matches the address word sequence based on the first position of a word in the address word sequence and the second position of a word in the corresponding address node includes: For each address node, a matching word list is constructed, wherein the list elements in the matching word list are used to represent the first position and the second position of the word that exists simultaneously in the address word sequence and the address node; Verify the consistency between the first relative position relationship between any two list elements in the matching word list and the second relative position relationship between the corresponding second positions; The words corresponding to the list elements of the first relative positional relationship and the second positional relationship that have passed the consistency check are taken as valid matching words, and the valid matching sequence in the corresponding address node that matches the address word sequence is determined based on the valid matching words.
3. The method according to claim 2, characterized in that, The step of determining the valid matching sequence in the corresponding address node that matches the address word sequence based on the valid matching word includes: Each of the aforementioned valid matching words is taken as the first sequence element of a matching sequence; According to the order corresponding to the second position of each of the valid matching words, among the valid matching words other than the valid matching word corresponding to the first sequence element, determine the sequence element after each of the first sequence elements to obtain at least one matching sequence and the corresponding sequence length; The matching sequence corresponding to the longest sequence length among the sequence lengths is taken as the valid matching sequence.
4. The method according to claim 1, characterized in that, The step of determining the node matching degree of the address node corresponding to the valid matching sequence based on the importance score of the words in the valid matching sequence includes: Calculate the sum of the first importance scores of each valid matching word in the valid matching sequence relative to all address corpora in the preset address node library; Calculate the sum of the second importance scores of each valid matching word in the valid matching sequence relative to the corresponding address node; The product of the sum of the first importance scores and the sum of the second importance scores is taken as the node matching degree of the address node corresponding to the valid matching sequence.
5. The method according to claim 4, characterized in that, Before determining the node matching degree of the address node corresponding to the valid matching sequence, the method further includes: Based on the relative positional relationship of two adjacent valid matching words in the address word sequence and their relative positional relationship in the corresponding address node, the address input anomaly in the address to be matched is determined; Based on the abnormal address input, the valid matching sequence is corrected.
6. The method according to claim 5, characterized in that, The step of determining address input anomalies in the address to be matched based on the relative positional relationship of two adjacent valid matching words in the address word sequence and their relative positional relationship in the corresponding address node includes: If the relative positions of two adjacent valid matching words in the address word sequence are adjacent, and the relative positions of two adjacent valid matching words in the corresponding address node are spaced out, the address input anomaly is determined to be an address abbreviation anomaly.
7. The method according to claim 6, characterized in that, The step of determining the address input anomaly in the address to be matched based on the relative positional relationship of two adjacent valid matching words in the address word sequence and their relative positional relationship in the corresponding address node further includes: If the relative positional relationship of the two adjacent valid matching words in the address word sequence is a positional relationship with a gap, and the relative positional relationship of the two adjacent valid matching words in the corresponding address node is a positional relationship with a gap, identify the position of the gap in the first pinyin of the word corresponding to the address word sequence and the position of the gap in the second pinyin of the word corresponding to the address node; If the pinyin recognition result indicates that the first pinyin is the same as the second pinyin, the address input anomaly is determined to be an address miswriting anomaly.
8. The method according to claim 6, characterized in that, The process of determining address input anomalies in the address to be matched further includes: If the relative positions of two adjacent valid matching words in the valid matching sequence are both adjacent in the address word sequence and in the corresponding address node, it is determined whether an address abbreviation anomaly has occurred based on the relative positions of the valid matching sequence in the address word sequence and the address node.
9. The method according to claim 1, characterized in that, The node matching degree and the corresponding node address hierarchy attribute are used to construct candidate address node links, and the link matching evaluation result is calculated, including: Based on the node address hierarchy attribute of each address node, at least one candidate address node link is constructed; The node matching degree corresponding to each address node in the candidate address node link is summed to obtain the total node matching degree, and the total node matching degree is used as the link matching evaluation result of the corresponding candidate address node link.
10. The method according to any one of claims 1-9, characterized in that, The process of determining the importance score includes: Each address fragment in the address corpus in the preset address node library is taken as an address node, and an inverted index is constructed for each word in the address node; The inverse document frequency of each word is calculated based on the inverted index, and the inverse document frequency is used as the first importance score of the corresponding word relative to the preset address node library. Calculate the sum of the first importance scores corresponding to all words in each address node to obtain the corresponding address node score, and use the ratio of the first importance score of each word to the address node score as the second importance score of each word in the address node relative to the address node.
11. An address matching device, configured on a client, characterized in that, include: The address to be matched processing module is used to respond to an address matching event, obtain the address to be matched associated with the address matching event, and perform word segmentation processing on the address to be matched using characters as the word segmentation unit to obtain the corresponding address character sequence; The address node matching module is used to perform address node matching in a preset address node library for each word in the address word sequence to obtain an address node that contains any one word in the address word sequence. The first address node matching analysis module is used to determine a valid matching sequence in the address node that matches the address word sequence based on the first position of the word in the address word sequence and the second position of the word in the corresponding address node. The second address node matching analysis module is used to determine the node matching degree of the address node corresponding to the effective matching sequence based on the importance score of the words in the effective matching sequence; wherein, the importance score is the importance analysis result of the words in the effective matching sequence determined based on the address corpus in the preset address node library; The address node link analysis module is used to construct candidate address node links based on the node matching degree and the corresponding node address level attributes, and to calculate the link matching evaluation result. The target address matching result determination module is used to determine the target address node link based on the link matching evaluation result, and use the address composed of the target address node link as the address matching result of the address to be matched.
12. A computer device, characterized in that, The computer device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the address matching method as described in any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the address matching method as described in any one of claims 1-10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the address matching method as described in any one of claims 1-10.
Citation Information
Patent Citations
Address matching algorithm based on deep learning model
CN111881677A
Address text processing method and device
CN114638217A