Merchant matching method and device
By using a multi-layered filtering and classification model based on semantic feature words, the problem of differential processing in the merchant matching process is solved, improving the accuracy and efficiency of merchant matching and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NETSUNION CLEARING CORP
- Filing Date
- 2024-11-18
- Publication Date
- 2026-05-19
AI Technical Summary
Existing merchant matching methods cannot differentiate the merchant matching process, resulting in low accuracy and efficiency, high cost and difficulty, especially with massive amounts of merchant data, leading to reduced accuracy.
Based on the semantic feature words of the target merchants, relevant candidate merchants are searched. Through multi-layer filtering and classification models, target candidate pairs are selected. The classification model is trained based on positive and negative samples formed by semantic feature words to achieve differentiated processing.
It improves the accuracy and efficiency of merchant matching, reduces processing difficulty and cost, and achieves efficient matching of massive amounts of merchant data through the combination of multi-layer filtering and classification models.
Smart Images

Figure CN122065037A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a merchant matching method and apparatus. Background Technology
[0002] In payment clearing and settlement, transaction data can originate from various transaction channels (acquiring institutions). These channels can transmit merchant information via transaction messages, resulting in a massive accumulation of merchant entities. Among these numerous merchant entities, many merchants may belong to the same merchant entity. Accurately and quickly matching multiple merchants pairwise to identify which merchants belong to the same merchant entity is crucial for business analysis and processing.
[0003] In transaction clearing scenarios, the same merchant entity may generate various differentiated merchant information across different transaction channels. This information is inconsistent in quality, diverse in origin, highly varied, and relatively homogeneous in data type. Existing merchant matching methods rely on accurate merchant information; therefore, a decline in data quality or a reduction in data dimensions will lead to a decrease in matching accuracy. Furthermore, existing methods cannot handle differentiated processing during the matching process, resulting in low accuracy and efficiency, as well as high cost and difficulty.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This specification provides a merchant matching method and apparatus to address the problems of existing technologies being unable to differentiate the merchant matching process, resulting in low accuracy and efficiency, and high cost and difficulty in merchant matching.
[0006] Firstly, embodiments of this specification provide a merchant matching method, which includes:
[0007] Based on the semantic feature words of the target merchant, search for multiple candidate merchants related to the semantic feature words, and each of the multiple candidate merchants and the target merchant form multiple initial candidate pairs of the target merchant.
[0008] Each initial candidate pair among the plurality of initial candidate pairs is subjected to multi-level filtering processing, so as to select multiple candidate pairs to be processed by the classification model from the plurality of initial candidate pairs based on the results of the multi-level filtering processing.
[0009] The text similarity features of each candidate pair in the multiple candidate pairings are processed using a classification model to obtain multiple classification results. The classification model is trained based on positive and negative samples formed by the semantic feature words.
[0010] Based on the multiple classification results, a target candidate pair is determined among the multiple candidate pairs, and the target candidate merchant in the target candidate pair is matched with the target merchant.
[0011] In some embodiments, the method further includes:
[0012] Extract merchant information from the target merchant, segment the merchant information to obtain multiple semantic feature words of different types;
[0013] Accordingly, the step of searching for multiple candidate merchants related to the semantic feature words of the target merchant includes:
[0014] Based on the aforementioned multiple different types of semantic feature words, establish target index information;
[0015] Based on the target index information, search for multiple candidate merchants related to the multiple different types of semantic feature words.
[0016] In some embodiments, the segmentation of the merchant information yields multiple different types of semantic feature words, including:
[0017] The merchant information is segmented according to a preset semantic structure segmentation rule to obtain multiple semantic feature words of different types. The preset semantic structure segmentation rule includes segmenting the merchant information into several consecutive semantic feature words of different types with the goal of the total segmentation probability being greater than a preset total probability threshold.
[0018] In some embodiments, the multi-layer filtering process for each initial candidate pair among the plurality of initial candidate pairs includes:
[0019] Perform full name matching on the initial candidate pairs and determine whether the full name matching result is a successful match.
[0020] If not, perform semantic structure feature matching on the initial candidate pairings and determine whether the semantic structure feature matching result is a successful match.
[0021] If not, determine whether the key features in the semantic structure features of the initial candidate pairings conflict;
[0022] If not, perform a full-text match on the initial candidate matches and determine whether the full-text match result is a successful match.
[0023] If not, use the initial candidate pairing as the candidate pairing.
[0024] In some embodiments, the method further includes:
[0025] When the full-text matching result is determined to be a successful match, the initial candidate pairing is used as the target candidate pairing.
[0026] In some embodiments, the text similarity features include at least one of the following: the maximum length and the minimum length of merchant names in candidate pairs, the ratio of the minimum length to the maximum length, the length of the longest common subsequence of merchant names in candidate pairs, the ratio of the longest common subsequence length to the maximum length, the ratio of the longest common subsequence length to the minimum length, the business similarity of candidate pairs, the abbreviation similarity of candidate pairs, the additional information similarity of candidate pairs, and the organization type similarity of candidate pairs.
[0027] In some embodiments, the classification model is trained based on positive and negative samples formed from the semantic feature words, including:
[0028] The semantic feature words are transformed to generate multiple approximate merchant names that are similar to the merchant information of the target merchant, which are used as a positive sample set.
[0029] Randomly sample the semantic feature words and extract multiple differentiated merchant names that differ from the merchant information of the target merchant as a negative sample set.
[0030] The classification model is obtained by training a random forest model based on the positive sample set and the negative sample set.
[0031] In some embodiments, the method further includes:
[0032] When the classification result indicates that the candidate pairings do not match, the similarity features of transaction fluctuations of each candidate pairing among the multiple candidate pairs are obtained;
[0033] The text similarity features and transaction fluctuation similarity features of each candidate pair in the multiple candidate pairings are processed using a target regression model to obtain the regression results of each candidate pairing. The target regression model is trained based on the sample data corresponding to the text similarity features and the transaction fluctuation similarity features.
[0034] Based on the regression results, a similarity score is determined for each candidate pair.
[0035] Based on the similarity score, each candidate pair is sorted in descending order to select the first target candidate pair from the descending sort results. The ranking of the first target candidate pair is greater than a preset ranking threshold, and the first target candidate merchant in the first target candidate pair is approximately matched with the target merchant.
[0036] Secondly, embodiments of this specification also provide a merchant matching device, which includes:
[0037] The search module is used to search for multiple candidate merchants related to the semantic feature words of the target merchant. Each candidate merchant in the multiple candidate merchants forms multiple initial candidate pairs with the target merchant.
[0038] A multi-layer filtering module is used to perform multi-layer filtering on each of the multiple initial candidate pairs, so as to select multiple candidate pairs to be processed by the classification model from the multiple initial candidate pairs according to the results of the multi-layer filtering.
[0039] The classification module is used to process the text similarity features of each candidate pair in the multiple candidate pairings using a classification model to obtain multiple classification results. The classification model is trained based on positive and negative samples formed by the semantic feature words.
[0040] The matching module is used to determine the target candidate pair among the multiple candidate pairs based on the multiple classification results, wherein the target candidate merchant in the target candidate pair is matched with the target merchant.
[0041] Thirdly, embodiments of this specification also provide a computer device, including a memory, a processor, and a computer program / instructions stored in the memory, wherein the processor executes the computer program / instructions to implement the steps of the merchant matching method described above.
[0042] Fourthly, embodiments of this specification also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the merchant matching method described above.
[0043] Fifthly, embodiments of this specification also provide a computer program product, wherein when the computer program / instructions are executed by a processor, the steps of the above-described merchant matching method are implemented.
[0044] This specification provides a merchant matching method and apparatus. First, based on the semantic feature words of the target merchant, multiple candidate merchants related to the semantic feature words are searched. Each of these candidate merchants forms multiple initial candidate pairs with the target merchant. Then, multi-layer filtering is performed on each of the initial candidate pairs to filter out multiple candidate pairs for processing by a classification model based on the multi-layer filtering results. Next, the text similarity features of each candidate pair are processed using a classification model to obtain multiple classification results. The classification model is trained based on positive and negative samples formed from the semantic feature words. Finally, based on the multiple classification results, a target candidate pair is determined, and the target candidate merchant in the target candidate pair matches the target merchant. In this specification, based on the semantic feature words of the target merchant, multiple semantically related candidate merchants can be accurately searched, thus accurately forming multiple initial candidate pairs for the target merchant. By performing multi-layer filtering on each of the initial candidate pairs, differentiated processing can be achieved, improving the filtering effect and reducing the filtering difficulty and cost. By inputting the text similarity features of multiple candidate pairs selected through multi-layer filtering into the classification model, the amount of input data can be reduced, thus improving the model's processing speed. The classification model is trained based on positive and negative samples formed from semantic feature words, resulting in a more differentiated and interpretable model that effectively suppresses noise for multi-dimensional features, achieving optimal results. Through the classification results of each candidate pair, the target candidate pair can be determined, enabling precise and efficient selection of target merchants matching the target merchant. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0046] Figure 1 This is a flowchart illustrating a merchant matching method provided in an embodiment of this specification;
[0047] Figure 2 This is a schematic diagram of the process for obtaining semantic feature words provided in the embodiments of this specification;
[0048] Figure 3 This is a schematic diagram of the process for obtaining similar characteristics of trading fluctuations provided in the embodiments of this specification;
[0049] Figure 4 This is a schematic diagram of the process for obtaining multiple candidate merchants provided in the embodiments of this specification;
[0050] Figure 5 This is a schematic diagram of the multi-layer filtration process provided in the embodiments of this specification;
[0051] Figure 6 This is a schematic diagram of the processing flow of the classification model and the target regression model provided in the embodiments of this specification;
[0052] Figure 7 This is a schematic diagram illustrating the structural composition of a merchant matching device provided in an embodiment of this specification;
[0053] Figure 8 This is a schematic diagram of the structural composition of the electronic device provided in the embodiments of this specification. Detailed Implementation
[0054] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0055] In payment clearing and settlement, transaction data can come from different transaction channels (acquiring institutions). These institutions can transmit merchant information through transaction messages, thus accumulating a massive number of merchant entities. Among these massive numbers of merchant entities, many merchants may belong to the same merchant entity. Accurately and quickly matching multiple merchants pairwise to identify which merchants belong to the same merchant entity is of great significance for business analysis and processing.
[0056] In transaction clearing scenarios, the same merchant entity may generate various differentiated merchant information across different transaction channels. This information is inconsistent in quality, diverse in origin, highly varied, and relatively homogeneous in data type. Existing merchant matching methods rely on accurate merchant information; therefore, a decline in data quality or a reduction in data dimensionality will lead to a decrease in the accuracy of merchant matching. Furthermore, existing merchant matching methods lack portability and applicability when dealing with datasets of relatively simple types.
[0057] For example, some solutions extract features based on merchant names and then use experience or machine learning to obtain a model or rule. This approach may have good optimization results for merchant datasets with similar data sources and specifications and small textual differences. However, it will severely degrade for massive merchant datasets with wide sources, large specifications, and varying quality, resulting in models with poor accuracy and transferability.
[0058] Some solutions match merchants based on text features or string matching using plain text processing, but these methods also have limitations. For example, the longest common subsequence feature is highly sensitive to changes in the order of parts of the merchant names.
[0059] Some solutions have been further improved by pre-training on business data to form word vectors, which, combined with deep learning, may be more versatile. However, this method relies on a large amount of manually labeled data, has high requirements for sample quality and technical environment, high investment costs, great difficulty in implementation, and generally poor results.
[0060] None of the above solutions can differentiate between different situations, break down the matching process into more steps, improve the effectiveness of each step, and reduce the difficulty and cost of each method. Merchant matching has low accuracy and efficiency, and is costly and difficult.
[0061] To address the aforementioned problems and their root causes in existing methods, this application proposes a merchant matching method and apparatus. This method differentiates the merchant matching process by breaking it down into more processing steps (e.g., multi-layer filtering, classification modeling), improving the effectiveness of each step while reducing its complexity and cost. Furthermore, it transforms the semantic features of the target merchant into more features, resulting in a more interpretable and differentiated classification model with better processing performance.
[0062] It should be noted that the user-related information (such as merchant information) and data involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by the relevant parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, and necessary confidentiality measures have been taken. They do not violate public order and good morals, and corresponding operation entry points are provided for users or relevant parties to choose to authorize or refuse.
[0063] Figure 1This is a flowchart illustrating a merchant matching method provided in an embodiment of this specification. While this specification provides method operation steps or apparatus structures as shown in the following embodiments or figures, based on conventional or non-inventive methods, the method or apparatus may include more or fewer operation steps or module units after partial merging. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure shown in the embodiments or figures of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed processing or server cluster implementation environment). For specific implementation, please refer to... Figure 1 As shown, the method may include the following:
[0064] S101: Based on the semantic feature words of the target merchant, search for multiple candidate merchants related to the semantic feature words, and each candidate merchant in the multiple candidate merchants forms multiple initial candidate pairs of the target merchant with the target merchant.
[0065] In some embodiments, to perform pairwise matching of merchants from massive merchant data and filter out two merchants belonging to the same merchant entity, a merchant to be matched can be first identified as the target merchant. Then, based on the semantic feature words of the target merchant, multiple candidate merchants related to the semantic feature words of the target merchant are searched. Each candidate merchant in the multiple candidate merchants can be combined with the target merchant to form multiple initial candidate pairs (multiple initial candidate pairs can form an initial candidate pair set). Each initial candidate pair in the multiple initial candidate pairs can be, for example, target merchant 1 and candidate merchant 2, target merchant 1 and candidate merchant 3, target merchant 1 and candidate merchant 4, etc. Finally, the candidate merchants that match the target merchant in the multiple initial candidate pairs can be filtered out. The candidate merchants that match the target merchant in the target candidate pairs can be called target candidate merchants. There can be multiple target merchants in the massive merchant data. The merchant matching method provided in this application can be used to filter out the target candidate merchants that match each target merchant, thereby realizing pairwise matching of merchants in massive merchant data.
[0066] In this context, "merchant" can refer to a transaction participant in online payment business that acts as the payee in the payment process, or it can be referred to as a business object.
[0067] A merchant entity is the smallest unit of information used to distinguish different merchants. There are two ways to determine a merchant entity. For example, for merchants reported in transfer and clearing transactions, in addition to their name, they also have identifying information such as merchant code and transaction channel. This information uniquely identifies a merchant entity. For instance, many transactions may have merchants named "XXX" but with different identifying information; they can be considered not to be the same merchant entity (e.g., different stores, branches, etc.). If the merchant comes from a standard entity database, then it generally has a unified credit code, which also uniquely identifies a merchant entity.
[0068] A merchant entity is an entity and organization in a standard entity database that corresponds to a merchant. Generally, one merchant corresponds to only one merchant entity, while one merchant entity may correspond to multiple merchants.
[0069] In some embodiments, prior to S101 above, the following may be included in a specific implementation:
[0070] Extract merchant information from the target merchant, segment the merchant information to obtain multiple semantic feature words of different types;
[0071] Accordingly, the process in S101 above, which involves searching for multiple candidate merchants related to the semantic feature words of the target merchant, may, in specific implementation, include:
[0072] Based on the aforementioned multiple different types of semantic feature words, establish target index information;
[0073] Based on the target index information, search for multiple candidate merchants related to the multiple different types of semantic feature words.
[0074] In some embodiments, the above-described segmentation of the merchant information to obtain multiple semantic feature words of different types may include, in specific implementation:
[0075] The merchant information is segmented according to a preset semantic structure segmentation rule to obtain multiple semantic feature words of different types. The preset semantic structure segmentation rule includes segmenting the merchant information into several consecutive semantic feature words of different types with the goal of the total segmentation probability being greater than a preset total probability threshold.
[0076] In some embodiments, the merchant information may include the merchant name, which can be extracted from the transaction message and the names of enterprises, individuals, and organizations obtained from an external entity database. Then, the merchant information can be segmented according to a preset semantic structure segmentation rule to obtain multiple different types of semantic feature words. These different types of semantic feature words can be used to build target index information, so as to quickly search for multiple candidate merchants related to the semantic feature words of the target merchant based on the target index information. That is, all candidate merchants that may be related to the target merchant can be queried based on the target index information.
[0077] Specifically, the aforementioned preset semantic structure segmentation rule can be understood as follows: with the goal of maximizing the total probability of segmentation (i.e., greater than the preset total probability threshold), the merchant information is split or segmented into several consecutive semantic feature words of different types.
[0078] Among them, the different types of semantic feature words (or different structural types or different semantic structural types) can include, in turn: geographical location, brand name, business category name, entity type name (such as specialty store or limited company), business district information, suffix or parenthetical supplementary information (such as chain store or branch).
[0079] In actual business names, not all of the above semantic structure types may be present; one or more may be missing, but the general positional relationship remains unchanged (as shown above). For example, the first word in a business name is unlikely to be "Limited Company," but is very likely a geographical location or brand name. The order of different structural features is also constrained. We consider the semantic structure words in a business name from left to right as a word sequence. In this sequence, the appearance of a type A structural word followed by a type B structural word is defined as "A shifts to B." If there is a lot of content after the entity name, it is likely a business district address or the address of a branch or subsidiary. If the business name begins with a geographical location, it is highly likely to be followed by a brand or business name, and less likely by the entity name itself.
[0080] Based on this theory, statistical analysis of existing sample sets yields the transition probability P(B|A) of a type A structural word followed by a type B structural word. Furthermore, the probability of a type A structural word appearing at the beginning of a merchant's name is P(A). Combining this with word segmentation algorithms, the goal is to maximize the total probability by splitting the merchant's name into several consecutive structural feature words of different types (i.e., splitting or segmenting the merchant information into several consecutive semantic feature words of different types with the objective of maximizing the total probability of segmentation). If a merchant's name is sequentially divided into four different feature parts (ABCD), then the probability of this segmentation result is:
[0081] P = P(A)P(B|A)*P(C|A)*P(D|B)
[0082] That is, we need to obtain the maximum probability of P. If a certain type is not extracted, an empty string can be used as an identifier. The segmentation probability is maximized when the positional relationship of the semantic structure types after segmentation best matches the actual positional relationship.
[0083] By obtaining the semantic feature words of the target merchants, a good data foundation can be provided for subsequent tasks such as building target index information to search for multiple related candidate merchants and training classification models.
[0084] Specifically, the target index information mentioned above can be an index table built based on an inverted index. Because semantic structure words have strong directional characteristics, tools like search engines are not necessary. Instead, a database with batch join capabilities (such as Hive) can be used to store index records for batch searches. For example, an inverted index can be built using multiple different types of semantic feature words, and then an index table (target index information) can be created in Hive or other relational databases. The index table can then be used for queries, achieving better search results at a lower cost. Alternatively, the target index information can be Elasticsearch, HBase, or more specialized search engine components. Queries can be performed based on Elasticsearch or HBase, which offer high accuracy but are slightly more expensive. The type of target index information can be determined based on actual needs; this specification does not impose specific limitations on this.
[0085] By establishing target index information, we can efficiently and accurately search for all candidate merchants that may be related to multiple different types of semantic feature words, thereby accurately forming initial candidate pairs and laying the foundation for pairwise matching of merchants.
[0086] S102: Perform multi-level filtering on each of the multiple initial candidate pairs to select multiple candidate pairs to be processed by the classification model based on the results of the multi-level filtering.
[0087] In some embodiments, after forming multiple initial candidate pairs (initial candidate pair set) of target merchants, the initial candidate pairs in the multiple initial candidate pairs can be matched layer by layer in a funnel manner (i.e., the multi-layer filtering process mentioned above). Each layer can filter out most candidate merchants, thereby making the subsequent matching and screening more targeted and efficient, while reducing the subsequent processing cost and processing difficulty.
[0088] It should be noted that multi-level filtering of each initial candidate pair can be performed on a single machine in a point-to-point manner (i.e., multi-level filtering is performed on each initial candidate pair sequentially), or it can be performed in a distributed parallel manner by relying on massive data batch processing computing frameworks that support UDF functions, such as Hive or Spark (i.e., multi-level filtering is performed on each initial candidate pair simultaneously). This specification does not make specific limitations on this.
[0089] In some embodiments, the multi-layer filtering process performed on each initial candidate pair among the plurality of initial candidate pairs in S102 above may, in specific implementation, include:
[0090] Perform full name matching on the initial candidate pairs and determine whether the full name matching result is a successful match.
[0091] If not, perform semantic structure feature matching on the initial candidate pairings and determine whether the semantic structure feature matching result is a successful match.
[0092] If not, determine whether the key features in the semantic structure features of the initial candidate pairings conflict;
[0093] If not, perform a full-text match on the initial candidate matches and determine whether the full-text match result is a successful match.
[0094] If not, use the initial candidate pairing as the candidate pairing.
[0095] In some embodiments, after determining whether the full-text matching result is a successful match, the specific implementation may further include:
[0096] When the full-text matching result is determined to be a successful match, the initial candidate pairing is used as the target candidate pairing.
[0097] In some embodiments, the multi-layered filtering process described above may include full name matching (first-layer filtering), semantic feature structure matching (second-layer filtering), key feature conflict determination (third-layer filtering), and full-text matching (fourth-layer filtering). If full name matching fails, semantic structure feature matching can be performed. If semantic structure feature matching fails, key feature conflict determination can be performed. If key features do not conflict, full-text matching can be performed. If full-text matching still fails, candidate pairs can be filtered out and processed further in subsequent classification and target regression models. Through multi-layered filtering, differentiated processing of the merchant matching process can be achieved, decomposing the matching process into more processing steps, reducing the processing difficulty and cost of each step, and improving the processing effect of each step. Simultaneously, it can reduce the amount of data input to the classification model, thereby effectively improving the model's processing speed.
[0098] Specifically, full name matching can be understood as follows: if the target merchant and the candidate merchant in the initial candidate pair are both full names of the merchant, and their full names are the same, or one name is a prefix of the other name, and the shortest name length is not less than a preset value (e.g., 10), then the full name matching result is considered a successful match; otherwise, the full name matching result is considered a failed match. When the full name matching result is a successful match, the initial candidate pair can be used as the target candidate pair, meaning that the target merchant and the candidate merchant in the initial candidate pair belong to the same merchant entity.
[0099] Semantic feature structure matching can be understood as: analyzing whether the semantic structure features (semantic structure elements) of the initial candidate pairings are consistent. If they are consistent, the semantic feature structure matching result is considered a successful match. Otherwise, the semantic feature structure matching result is considered a failed match. When the semantic feature structure matching result is a successful match, the initial candidate pairing can be used as the target candidate pairing, meaning that the target merchant and the candidate merchant in the initial candidate pairing belong to the same merchant entity. For example, in semantic feature structure matching, the target merchant name is "Chengdu, Q County, C Province Cable Factory" and the candidate merchant name is "Abbreviation of C Province, Q County Cable Factory". Although their full names do not match, their semantic structure feature elements are both "Chengdu, Q County (belonging to Q City), cable, factory". Therefore, their semantic structure features are completely matched.
[0100] The key feature conflict determination can be understood as: judging whether feature words such as geographical location, trademark, and business type conflict. If they conflict, the initial candidate pair is considered to be completely mismatched, meaning that the target merchant and the candidate merchant in the initial candidate pair do not belong to the same merchant entity. For example, "W Mobile Phone Store" and "W Tobacco and Alcohol Store"—the two business type feature words "mobile phone" and "tobacco and alcohol" can be extracted and are different, so it can be determined that these two merchants are completely different. "W Store in City A" and "W Store in City B" have different geographical locations. "P Beverage Shop (Branch 1)" and "P Beverage Shop (Branch 2)" have different business districts.
[0101] If the key features are determined to be non-conflicting (i.e., there is undetermined data, meaning there are initial candidate pairs awaiting further matching), then full-text matching is required. Full-text matching can refer to matching the entire text after removing non-duplicative information. Specifically, if one merchant has geographical information and another does not, the geographical information can be removed. If, after removing the geographical information, both are still at least 10 characters long and the full text matches, then a match is considered, meaning the target merchant and the candidate merchant belong to the same merchant entity. In this case, the initial candidate pairs that pass the full-text matching can be used as target candidate pairs, and the target candidate merchant in the target candidate pair matches the target merchant. Otherwise, if the full-text matching result is a failure (i.e., there is still undetermined data), the subsequent classification model and target regression model can be used for processing. In this case, the initial candidate pairs that fail the full-text matching can be used as candidate pairs (which can be multiple) to be processed by the classification model. Before being processed by the classification model, the text similarity features of each candidate pair can be obtained. Among them, the multiple candidate pairs to be processed by the classification model are candidate pairs that are still undetermined whether they match the target merchant and need to be further processed using subsequent classification models and target regression models.
[0102] For example, multiple initial candidate pairs are: Target Merchant 1 and Candidate Merchant 2 (Initial Candidate Pair 1), Target Merchant 1 and Candidate Merchant 3 (Initial Candidate Pair 2), Target Merchant 1 and Candidate Merchant 4 (Initial Candidate Pair 3), Target Merchant 1 and Candidate Merchant 5 (Initial Candidate Pair 4), and Target Merchant 1 and Candidate Merchant N (Initial Candidate Pair N). After multi-level filtering of each initial candidate pair, the initial candidate pairs that fail to match in the full-text matching result are: Target Merchant 1 and Candidate Merchant 2 (Initial Candidate Pair 1 = Candidate Pair 1, abbreviated as 12), Target Merchant 1 and Candidate Merchant 3 (Initial Candidate Pair 2 = Candidate Pair 2, abbreviated as 13), and Target Merchant 1 and Candidate Merchant 4 (Initial Candidate Pair 3 = Candidate Pair 3, abbreviated as 14). These can be considered as multiple candidate pairs. Correspondingly, text similarity features of 12, 13, and 14 can be obtained. Subsequently, the text similarity features of 12 can be input into the classification model to obtain the classification result of 12, the text similarity features of 13 can be input into the classification model to obtain the classification result of 13, and the text similarity features of 14 can be input into the classification model to obtain the classification result of 14.
[0103] In some embodiments, the text similarity features described above may include at least one of the following: the maximum length and the minimum length of merchant names in candidate pairs, the ratio of the minimum length to the maximum length, the length of the longest common subsequence of merchant names in candidate pairs, the ratio of the longest common subsequence length to the maximum length, the ratio of the longest common subsequence length to the minimum length, the business similarity of candidate pairs, the abbreviation similarity of candidate pairs, the additional information similarity of candidate pairs, and the organization type similarity of candidate pairs.
[0104] In some embodiments, the similarity between the target merchant and the candidate merchant in the candidate pair can be analyzed from multiple feature dimensions. These multiple feature dimensions constitute the text similarity features mentioned above. The multiple feature dimensions can be as follows:
[0105] (1) Merchant length comparison feature: In order to reduce the impact of order differences, candidate pairings can be compared (e.g.:
[0106] The maximum length of the names of target merchant 1 and candidate merchant 2 is taken as x1, and the ratio of shorter merchant names to longer merchant names is taken as x2. The longer the merchant name, the easier it is to abbreviate. On the contrary, the shorter the merchant name, the greater the difference may be represented by one or two words.
[0107] (2) Longest common subsequence comparison features: the length of the longest common subsequence x3, and the ratio of this length to the total length of the names of target merchant 1 and candidate merchant 2 x4 and x5 (since one of target merchant 1 and candidate merchant 2 has the longest length and the other has the shortest length, x4 and x5 are the ratio of the longest common subsequence length to the longest length and the ratio of the longest common subsequence length to the shortest length).
[0108] The longest common subsequence (LCS) is the sequence of the most matched letters from left to right between two strings, where non-consecutive characters are allowed but their order remains unchanged. For example, the longest common subsequence of abcdefd and ecbcefq is bcef.
[0109] (3) Structural element similarity features: For each structural element of the same type, calculate a similarity score s between 0 and 1.0. The specific calculation formula is as follows:
[0110] Based on the edit distance similarity l (0~1.0), a weighted average is applied. When the longest text length of the structural elements corresponding to the target merchant 1 and the candidate merchant 2 is greater than 4, s = 1.0 - (1.0 - l) * 2 (l > 0.5) and s = 0 (l < 0.5); when the text length is less than or equal to 4, the similarity s = 1.
[0111] Based on the above algorithm, the business similarity of candidate pairs (x6), the abbreviation similarity of candidate pairs (x7), the additional information similarity of candidate pairs (x8), and the organization type similarity of candidate pairs (x9) can be calculated respectively.
[0112] It should be noted that, in addition to the edit distance algorithm mentioned above, other text similarity calculation methods (such as cosine similarity and simple common words) can also be used to calculate x1 to x9, and this specification does not make specific limitations on them.
[0113] S103: The text similarity features of each candidate pair in the multiple candidate pairings are processed using a classification model to obtain multiple classification results. The classification model is trained based on the positive and negative samples formed by the semantic feature words.
[0114] In some embodiments, the classification model in S103 above is trained based on the positive and negative samples formed by the semantic feature words, and in specific implementation, it may include:
[0115] The semantic feature words are transformed to generate multiple approximate merchant names that are similar to the target merchant, which are used as a positive sample set.
[0116] Randomly sample the semantic feature words and extract multiple differentiated merchant names that differ from the target merchant as a negative sample set;
[0117] A random forest model is trained based on the positive sample set and the negative sample set. When the training error is less than a preset error threshold, the classification model is obtained.
[0118] In some embodiments, more features can be formed based on semantic feature words, which makes up for the lack of feature information expression in existing solutions to the greatest extent, enriches feature information, improves generalization ability and model quality, fully solves the problem of feature degradation caused by internal order differences in merchant names, and also solves the problem of judgment that the size of merchant text differences and the size of actual semantic differences are not necessarily related.
[0119] Specifically, semantic feature words can be transformed to generate multiple approximate merchant names that are similar to the target merchant's information, serving as a positive sample set. Semantic feature words can then be randomly sampled to extract multiple differentiated merchant names that differ from the target merchant's information, serving as a negative sample set. Finally, a random forest model can be trained using a semi-supervised classification method based on the positive and negative sample sets. The classification model is obtained when the training error is less than a preset error threshold (this threshold can be set according to actual needs and is not specifically limited in this specification). Otherwise, the random forest model is trained using a semi-supervised classification method until the training error is less than the preset error threshold. Transformation processing includes, for example, assuming the target merchant's information (merchant name) contains geographical information, various equivalent fine-tunings can be made to this geographical information, such as using abbreviations instead of the full name, omitting parts of the place name, etc. For example, CQ can be transformed into C Province Q, the abbreviation of C Province Q County, C Province Q City Q County, etc. For example, terms like "branch office" and "branch store" in the merchant name can be replaced, or other common modifiers can be added. Multiple similar merchant names generated after this transformation essentially belong to the same target merchant and are similar to the target merchant's name. These multiple differentiated merchant names can differ from the target merchant's name; for example, "A City W Mobile Phone Store, A City E Mobile Phone Store" can be extracted as multiple differentiated merchant names, which do not necessarily belong to the same target merchant.
[0120] In terms of model selection, the random forest model was chosen because decision tree-based models are more in line with the decision intuition of binary classification using different dimensional features (the aforementioned text similarity features x1 to x9) used in the human case, and have strong interpretability. At the same time, since there are many feature dimensions, the meaning of each dimension is quite different, and the feature effects are uneven, the random forest can effectively target multi-dimensional features, suppress noise, and obtain the optimal results.
[0121] In model training, a semi-supervised approach is adopted, which can solve the problem of difficult positive sample labeling. Due to the large number of samples in this case, but the low proportion of actually matching merchants (i.e., positive samples), selecting positive samples is like finding a needle in a haystack; manual screening would be inefficient and costly. However, selecting negative samples is relatively easier; random sampling can be used to meet the requirements of dispersion and representation coverage. To solve the problem of obtaining positive samples, a batch of merchant names can be randomly sampled, and their semantic structural feature words can be transformed according to semantic similarity rules to automatically generate more equivalent merchant names as positive samples. Transformation processing includes, for example, if a merchant name contains geographical information, various equivalent fine-tunings can be made to this geographical information, such as using abbreviations instead of the full name, omitting parts of the place name, etc. Using this method, an average of more than 5 approximate merchant names can be generated based on one merchant, thereby expanding the positive sample set. Similarly, for negative samples, some less common discrepancies can also be automatically generated as a supplement to randomly selected discrepancies. This automatic generation method utilizes people's more comprehensive prior knowledge of similar merchants, has a stronger ability to express differences, and enhances the generalization ability of training samples. It is more effective than labeling models through small sample pre-training in traditional semi-supervised learning.
[0122] By employing semi-supervised learning and self-generated samples, the problems of low data quality and high manual annotation costs can be addressed. Decomposing and transforming the semantic structural elements of merchant names to generate matching positive and negative samples can effectively improve the performance of semi-supervised learning, thereby enabling accurate training of the aforementioned classification model.
[0123] S104: Based on the multiple classification results, determine the target candidate pair among the multiple candidate pairs, and the target candidate merchant in the target candidate pair matches the target merchant.
[0124] In some embodiments, the classification result in S104 above may include a first value or a second value, wherein the first value indicates that the candidate pairing matches and the second value indicates that the candidate pairing does not match.
[0125] Accordingly, in S104 above, determining the target candidate pair among the multiple candidate pairs based on the multiple classification results can, in specific implementation, include:
[0126] Determine whether a first value exists among multiple classification results;
[0127] If so, the candidate pair corresponding to the classification result when taking the first value is taken as the target candidate pair.
[0128] In some embodiments, after determining whether a first value exists among multiple classification results, the specific implementation may further include:
[0129] When the classification result indicates that the candidate pairings do not match, the similarity features of transaction fluctuations of each candidate pairing among the multiple candidate pairs are obtained;
[0130] The text similarity features and transaction fluctuation similarity features of each candidate pair in the multiple candidate pairings are processed using a target regression model to obtain the regression results of each candidate pairing. The target regression model is trained based on the sample data corresponding to the text similarity features and the transaction fluctuation similarity features.
[0131] Based on the regression results, a similarity score is determined for each candidate pair.
[0132] Based on the similarity score, each candidate pair is sorted in descending order to select the first target candidate pair from the descending sort results. The ranking of the first target candidate pair is greater than a preset ranking threshold, and the first target candidate merchant in the first target candidate pair is approximately matched with the target merchant.
[0133] In some embodiments, the text similarity features x1 to x9 of each candidate pair can be input into the classification model to obtain multiple classification results. Then, it is determined whether there is a first value (e.g., 1) among the multiple classification results. If there is a classification result with the first value, the candidate pair corresponding to the classification result with the first value can be considered to be a match, and the candidate pair can be used as the target candidate pair. The target candidate merchant in the target candidate pair matches the target merchant and belongs to the same merchant entity.
[0134] If a first value does not exist (e.g., all are assigned a second value, such as 0), then the candidate pairings corresponding to the classification results of the second value are considered mismatched. In this case, the classification result is "candidate pairing mismatch." The transaction fluctuation similarity features of each candidate pair can then be obtained. A target regression model can be used to process the transaction fluctuation similarity features and text similarity features of each candidate pair to obtain the regression results. Based on the regression results, a similarity score for each candidate pair is determined. Then, based on the similarity scores, the candidate pairs are sorted in descending order. From the descending order, the candidate pairs with the highest ranking (i.e., ranking greater than a preset ranking threshold, which can be set according to actual needs, not specifically limited in this specification) are selected as the first target candidate pair. The first target candidate merchant in the first target candidate pair is approximately or possibly a match to the target merchant. Using the above method, even when text similarity features do not match, a first target candidate merchant that is approximately or possibly a match to the target merchant can be further selected.
[0135] For example: if the text similarity features of candidate pair 12 are input into the classification model and the classification result is 0 (no match), the text similarity features of candidate pair 13 are input into the classification model and the classification result is 1 (match), and the text similarity features of candidate pair 14 are input into the classification model and the classification result is 0 (no match), then candidate pair 13 is taken as the target candidate pair. The transaction fluctuation similarity features of candidate pairs 12 and 14 corresponding to the classification result when the first value is not taken (the second value is taken) are obtained. The text similarity features and transaction fluctuation similarity features of 12 and 14 are processed using the target regression model. The target regression model outputs a regression result of 0.667 for 12 and 0.435 for 14. Therefore, the similarity score of 12 is greater than that of 14, and the ranking of 12 is greater than that of 14. 12 can be taken as the first target candidate pair, meaning the first target candidate merchant 2 is a candidate merchant that is approximately matched with target merchant 1.
[0136] The trading volatility similarity features can include daily trading volatility similarity features x10 and weekly trading volatility similarity features x11 for candidate pairs.
[0137] Among them, the daily trading volatility similarity feature x10 can be calculated based on the Pearson correlation coefficient of the daily (24-hour) trading volatility feature vector, and the weekly trading volatility similarity feature x11 can be calculated based on the Pearson correlation coefficient of the weekly (7-day) trading volatility feature vector.
[0138] The daily (24-hour) trading volatility characteristic vector can be calculated using the following formula:
[0139]
[0140] Where i represents the transactions during the i-th time period within a natural day (from 0:00 to 59:59), and y ij This represents the transaction situation in the i-th time period on day j. We take the data from n consecutive days and average it, where n is at least 30.
[0141] The weekly (7-day) trading volatility feature vector can be calculated using the following formula:
[0142]
[0143] Wherein, variable x i x represents the number of transactions on day i from Monday to Sunday. ij To represent the number of transactions on day i in week j, we can select data from the most recent n weeks (usually data from the most recent quarter), and then average them to obtain x. i (The above is the calculation method for feature superposition).
[0144] It should be noted that not all merchants have transaction characteristics. For example, merchants from the standard entity database do not have transaction data. Secondly, some merchants obtained from transaction messages may be discarded because their transaction volume is too low, resulting in weak representativeness of their characteristics. Most merchants' transactions exhibit certain periodic fluctuations between Monday and Sunday and between 0:00 and 24:00 each day. Accordingly, weekly (7-day) and daily (24-hour) transaction fluctuation feature vectors can be calculated.
[0145] It should be noted that the above objective regression model, which handles transaction fluctuation similarity features and text similarity features, assumes that all merchants exhibit transaction fluctuation features (x). i y i In the case where some merchants lack transaction fluctuation characteristics (i.e., lack similar transaction fluctuation characteristics), the text similarity features x1 to x9 of each candidate pair can be processed using a target regression model when a first value is not available. If similar transaction fluctuation characteristics exist, x1 to x11 can be processed using a target regression model.
[0146] The aforementioned target regression model can also be trained using semi-supervised learning. Training samples can be sample data corresponding to text similarity features and transaction volatility similarity features. Specifically, scoring sample data or rating sample data can be obtained based on the sample data corresponding to text similarity features and transaction volatility similarity features. Then, a logistic regression model can be trained using semi-supervised learning based on the scoring sample data or rating sample data. If the training accuracy is low or the training error is large, the rating sample data can be corrected by removing values with large deviations. Finally, the target regression model can be trained, allowing for accurate and efficient similarity scoring based on the trained target regression model.
[0147] By sorting each candidate pair in descending order, subsequent processing can prioritize merchants with higher scores and rankings above a certain threshold (i.e., the first target candidate merchants mentioned above), greatly reducing the computational complexity and manual costs of subsequent processing.
[0148] In some embodiments, when a target merchant matches a target candidate merchant, the target merchant and the target candidate merchant can be merged into one merchant.
[0149] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. For details, please refer to the foregoing descriptions of the relevant processing embodiments; they will not be repeated here.
[0150] The foregoing description of this method is for illustrative purposes only and describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than those shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0151] In a specific implementation scenario, the merchant matching method provided in this manual can be used to perform pairwise matching of merchants from massive amounts of merchant data.
[0152] Before implementation, please refer to Figure 2 As shown, the process of obtaining semantic feature words for different types of merchants can include the following steps:
[0153] S21: Extract merchant name.
[0154] Specifically, the merchant name of the target merchant can be extracted from the transaction message, and the names of enterprises, individuals, and organizations can be obtained from the external entity database.
[0155] S22: Merchant name analysis + semantic parsing.
[0156] Specifically, the merchant information can be segmented according to the preset semantic structure segmentation rules to obtain multiple different types of semantic feature words. The different types of semantic feature words (or different structure types or different semantic structure types) may include, in turn: geographical location, brand name, business category name, entity type name (such as specialty store or limited company), business district information, suffix or parenthetical supplementary information (such as chain store or branch).
[0157] The preset semantic structure segmentation rule aims to maximize the total segmentation probability by splitting or segmenting merchant information into several consecutive semantic feature words of different types. The total probability can be determined by the following formula:
[0158] P = P(A)P(B|A)*P(C|A)*P(D|B)
[0159] Before implementation, please refer to Figure 3 As shown, the process of obtaining similar fluctuation characteristics in merchant transactions may include the following steps:
[0160] S31: Obtain the daily trading volatility feature vector and the weekly trading volatility feature vector.
[0161] Specifically, the daily trading volatility feature vector can be calculated using the following formula:
[0162]
[0163] Where i represents the transactions during the i-th time period within a natural day (from 0:00 to 59:59), and y ij This represents the transaction situation in the i-th time period on day j. We take the data from n consecutive days and average it, where n is at least 30.
[0164] The weekly trading volatility feature vector can be calculated using the following formula:
[0165]
[0166] Wherein, variable x i x represents the number of transactions on day i from Monday to Sunday. ij To represent the number of transactions on day i in week j, we can select data from the most recent n weeks (usually data from the most recent quarter), and then average them to obtain x. i (The above is the calculation method for feature superposition).
[0167] S32: Based on the Pearson correlation coefficient, calculate the daily trading volatility feature vector and the weekly trading volatility feature vector respectively to obtain the daily trading volatility similarity feature and the weekly trading volatility similarity feature.
[0168] For specific implementation, please refer to Figure 4 As shown, the process of obtaining multiple candidate merchants may include the following steps:
[0169] S41: Extract semantic feature words from a massive number of target merchants and establish a semantic feature word index library.
[0170] Specifically, the aforementioned semantic feature word index library is equivalent to the aforementioned target index information.
[0171] S42: Index lookup.
[0172] Specifically, index lookup is equivalent to searching for multiple candidate merchants related to the multiple different types of semantic feature words based on the target index information, as described above.
[0173] S43: A large number of candidate merchants related to the target merchant form the initial candidate pairing set for each target merchant.
[0174] For specific implementation, please refer to Figure 5 As shown, taking the initial candidate pair (target merchant 1 and candidate merchant 2) as an example, the multi-layer filtering process for this initial candidate pair is explained, which may include the following:
[0175] Step 1: Perform full name matching between target merchant 1 and candidate merchant 2.
[0176] Determine whether the full name matching result is a successful match. If yes, identify that target merchant 1 and candidate merchant 2 belong to the same merchant entity (result 1). If no, proceed to step 2 for merchants that failed to match in step 1.
[0177] Step 2: Perform semantic structure feature matching of merchant names between target merchant 1 and candidate merchant 2.
[0178] Determine whether the semantic structure feature matching result is a successful match. If yes, identify that target merchant 1 and candidate merchant 2 belong to the same merchant entity (result 1). If no, determine whether the key features in the semantic structure features conflict.
[0179] If yes, directly determine that target merchant 1 and candidate merchant 2 do not match and do not belong to the same merchant entity (result 2). If no, merchants that failed to match in step 2 proceed to step 3.
[0180] Step 3: Full-text matching excluding geographic information, the specific method is as follows:
[0181] If one merchant has geographical information and the other does not, the geographical information can be removed. If, after removing the geographical information, both merchants still have at least 10 characters in length and the full text matches, then a match is considered, and the result is entered as result 1, which means that the target merchant 1 and the candidate merchant 2 are identified as belonging to the same merchant entity.
[0182] Data that is still undetermined in step 3 will be processed in result 3 (i.e., the information of target merchant 1 and candidate merchant 2 will be sent to the second stage for processing).
[0183] Specifically, the second stage of processing can include classification model and target regression model processing.
[0184] In the first stage of processing, the two merchants to be matched will eventually have three types of results. Only result 3 will allow the two input merchants to enter the second stage, thus greatly reducing the amount of data entering the second stage.
[0185] The full name matching rules are as follows: if a name is the full name of a merchant in the standard entity database and both full names are the same, then a match is considered; or if a name is a prefix of another name and the shortest name is not less than 10 characters long, then a match is considered.
[0186] The semantic structure feature matching rule is as follows: based on the semantic structure features of the merchant name, a one-to-one match is performed. If the match is completely consistent, the result is considered a match, proceed to result 1, and the processing ends.
[0187] If the key attribute features in the structural features, such as geographical location, trademark, business type, etc., are different, then it is determined that there is no match at all, resulting in result 2, and the processing ends.
[0188] The full-text matching rule after excluding geographic information is as follows: If one merchant has geographic information and another does not, the geographic information can be removed. If, after removing the geographic information, both merchants still have a length of at least 10 characters and the full text matches, then the match is considered complete and result 1 is entered.
[0189] For specific implementation, please refer to Figure 6 As shown, continuing with the example of target merchant 1 and candidate merchant 2, the processing flow of the classification model and target regression model (second stage processing) can include the following:
[0190] Step 1: Calculate the text similarity features and transaction fluctuation similarity features between target merchant 1 and candidate merchant 2. The text similarity features include the maximum length of the merchant name as x1, the merchant name length ratio as x2, the longest common subsequence (LCS) length of the merchant name as x3, the LCS ratio as x4 and x5, the merchant business similarity as x6, the merchant abbreviation similarity as x7, the merchant additional information similarity as x8, and the merchant organization type similarity as x9. The transaction fluctuation similarity features include the daily (24-hour) transaction fluctuation similarity features as x10 and the weekly (7-day) transaction fluctuation similarity features as x11.
[0191] Step 2: Input the text similarity features x1 to x9 into the classification model and determine whether they match.
[0192] If a match is found, then target merchant 1 and candidate merchant 2 are merged (result 1, which is the same as...). Figure 5 If the result is different from step 1, proceed to step 3 of the subsequent processing.
[0193] Step 3: For unmatched merchants, perform a similarity score based on logistic regression.
[0194] Using a semi-supervised trained logistic regression model (i.e., the target regression model mentioned above), the overall similarity between target merchant 1 and candidate merchant 2 is scored between 0 and 1. The results are then saved. Note that since some merchants do not have the two features of transaction similarity, we need to train two models using x1~x11 and x1~x9 respectively to handle these two cases.
[0195] Specifically, if there are transaction similarity features, x1 to x11 are processed based on the above target regression model; if there are no transaction similarity features, x1 to x9 are processed based on the above target regression model.
[0196] Step 4: Sort all merchants by similarity score and filter them based on threshold and ranking.
[0197] After we have clearly determined that most of the massive input merchant set is a match or impossible match through two matching processes, a total of 5 matching methods and 6 steps, there will still be tens of millions of merchant candidate pairs whose match status is uncertain. Step 3 provides a score for these pairs. We sort these candidate pairs in descending order according to their scores, forming Result 2 (i.e., filtering out a portion of merchants that are suspected of being related for further processing). Subsequent processing can prioritize merchants with higher scores and rankings above a certain threshold, greatly reducing the computational complexity and manual costs of subsequent processing.
[0198] The above methods can achieve the following technical effects:
[0199] (1) By analyzing the semantic structure of merchants, different semantic elements in merchant names are extracted more accurately and comprehensively, which makes up for the shortcomings in feature information expression in the publicly available solutions to the greatest extent, enriches the feature information, improves the generalization ability, and improves the quality of the model. For example, the analysis of the semantic structure of merchants fully solves the problem of LCS feature degradation caused by the internal order difference of merchant names, and also solves the problem that the magnitude of the difference in merchant text is not necessarily related to the magnitude of the actual semantic difference.
[0200] (2) Fully utilize rule matching across multiple steps to effectively segment different merchant situations. In specific scenarios, leverage expert experience to solve appropriate problems and improve the quality of data input to the model through filtering. For example, using judgment based on all or part of a merchant's name can filter out most merchants at a low cost. More accurate semantic structure features can be used directly with rules to achieve further filtering, reducing the complexity and scale of model training and object recognition.
[0201] (3) By using semi-supervised learning and sample self-generation, the problems of low data quality and high cost of manual annotation are also solved.
[0202] In other words, the above solution can solve the identification and matching problem under various differences in the performance of different merchant entities. When faced with massive amounts of merchant data, lack of other prior judgment conditions, and low-quality and chaotic data, as long as there is still some semantic or transaction behavior information, this solution can be used to obtain a certain matching effect.
[0203] Although this specification provides the following examples or appendices Figure 7The method or apparatus structure shown may include more or fewer combined operational steps or module units based on conventional or non-inventive methods. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure shown in the embodiments or drawings of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or drawings (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed processing or server cluster implementation environment). Based on the above-described merchant matching method, this specification also proposes an embodiment of a merchant matching apparatus. Figure 7 As shown, the device may specifically include the following modules:
[0204] The search module 701 can be used to search for multiple candidate merchants related to the semantic feature words of the target merchant, and each candidate merchant in the multiple candidate merchants and the target merchant form multiple initial candidate pairs of the target merchant.
[0205] The multi-layer filtering module 702 can be used to perform multi-layer filtering on each of the multiple initial candidate pairs, so as to filter multiple candidate pairs to be processed by the classification model from the multiple initial candidate pairs according to the multi-layer filtering results.
[0206] The classification module 703 can be used to process the text similarity features of each candidate pair in the multiple candidate pairings using a classification model to obtain multiple classification results. The classification model is trained based on the positive and negative samples formed by the semantic feature words.
[0207] The matching module 704 can be used to determine the target candidate pair among the multiple candidate pairs based on the multiple classification results, wherein the target candidate merchant in the target candidate pair is matched with the target merchant.
[0208] In some embodiments, before the search module 701 described above, it can be used to extract merchant information of the target merchant, segment the merchant information to obtain multiple semantic feature words of different types; correspondingly, the search module 701 can be used to establish target index information based on the multiple semantic feature words of different types; and search for multiple candidate merchants related to the multiple semantic feature words of different types according to the target index information.
[0209] In some embodiments, before the search module 701 described above, it can also be used to segment the merchant information according to a preset semantic structure segmentation rule to obtain multiple semantic feature words of different types. The preset semantic structure segmentation rule includes segmenting the merchant information into several consecutive semantic feature words of different types with the goal of the total segmentation probability being greater than a preset total probability threshold.
[0210] In some embodiments, the multi-layer filtering module 702 can be specifically used to perform full name matching on the initial candidate pairings and determine whether the full name matching result is a successful match; if not, perform semantic structure feature matching on the initial candidate pairings and determine whether the semantic structure feature matching result is a successful match; if not, determine whether the key features in the semantic structure features of the initial candidate pairings conflict; if not, perform full text matching on the initial candidate pairings and determine whether the full text matching result is a successful match; if not, use the initial candidate pairings as candidate pairings.
[0211] In some embodiments, the multi-layer filtering module 702 described above can also be used to use the initial candidate pairing as the target candidate pairing when the full-text matching result is determined to be a successful match.
[0212] In some embodiments, the text similarity features in the classification module 703 may include at least one of the following: the maximum length and the minimum length of the merchant name in the candidate pair, the ratio of the minimum length to the maximum length, the length of the longest common subsequence of the merchant names in the candidate pair, the ratio of the longest common subsequence length to the maximum length, the ratio of the longest common subsequence length to the minimum length, the business similarity of the candidate pair, the abbreviation similarity of the candidate pair, the additional information similarity of the candidate pair, and the organization type similarity of the candidate pair.
[0213] In some embodiments, the classification module 703 can be specifically used to transform the semantic feature words to generate multiple approximate merchant names that are similar to the merchant information of the target merchant, as a positive sample set; to randomly sample the semantic feature words and extract multiple differentiated merchant names that differ from the merchant information of the target merchant, as a negative sample set; and to train a random forest model based on the positive sample set and the negative sample set to obtain the classification model.
[0214] In some embodiments, the matching module 704 may further be used to: obtain the transaction fluctuation similarity features of each candidate pair among the plurality of candidate pairs when the classification result is that the candidate pair does not match; process the text similarity features and transaction fluctuation similarity features of each candidate pair among the plurality of candidate pairs using a target regression model to obtain the regression result of each candidate pair, wherein the target regression model is trained based on the sample data corresponding to the text similarity features and the transaction fluctuation similarity features; determine the similarity score of each candidate pair based on the regression result; sort each candidate pair in descending order based on the similarity score to select a first target candidate pair from the descending order results, wherein the ranking of the first target candidate pair is greater than a preset ranking threshold, and the first target candidate merchant in the first target candidate pair is approximately matched with the target merchant.
[0215] As can be seen from the above, the merchant matching device provided in the embodiments of this specification can perform differentiated processing for different situations, decompose the matching process into more processing steps, narrow the target scope of each step, make it more focused, improve the effect of each step, and reduce the difficulty and cost of each step. At the same time, it also extracts more meaningful features from the data to improve the model performance. For example, based on the semantic structure of merchants, it extracts more features than existing solutions; and it also introduces transaction data into the features to make up for the lack of static information dimensions.
[0216] This specification also provides an electronic device based on the above-described merchant matching method, including a processor and a memory for storing processor-executable programs / instructions. Specifically, the processor can perform the following steps according to the program / instructions: based on the semantic feature words of the target merchant, search for multiple candidate merchants related to the semantic feature words; each candidate merchant in the multiple candidate merchants forms multiple initial candidate pairs with the target merchant; perform multi-layer filtering on each initial candidate pair in the multiple initial candidate pairs, so as to filter multiple candidate pairs to be processed by a classification model from the multiple initial candidate pairs according to the multi-layer filtering results; use a classification model to process the text similarity features of each candidate pair in the multiple candidate pairs to obtain multiple classification results; the classification model is trained based on positive and negative samples formed by the semantic feature words; determine the target candidate pair among the multiple candidate pairs according to the multiple classification results, and match the target candidate merchant in the target candidate pair with the target merchant.
[0217] To execute the above instructions more accurately, please refer to... Figure 8As shown in the embodiments of this specification, another specific electronic device is also provided, wherein the electronic device includes a network communication port 801, a processor 802, and a memory 803. The above structures are connected by internal cables so that the various structures can perform specific data interaction.
[0218] Specifically, the network communication port 801 can be used to search for multiple candidate merchants related to the semantic feature words of the target merchant, and each of the multiple candidate merchants and the target merchant forms multiple initial candidate pairs of the target merchant.
[0219] The processor 802 is specifically configured to perform multi-layer filtering on each of the plurality of initial candidate pairs, so as to filter multiple candidate pairs to be processed by the classification model from the plurality of initial candidate pairs according to the multi-layer filtering results; to process the text similarity features of each candidate pair in the plurality of candidate pairs using the classification model to obtain multiple classification results, wherein the classification model is trained based on positive and negative samples formed by the semantic feature words; and to determine the target candidate pair in the plurality of candidate pairs according to the multiple classification results, wherein the target candidate merchant in the target candidate pair matches the target merchant.
[0220] The memory 803 can be used to store the corresponding instruction program.
[0221] In this embodiment, the network communication port 801 can be a virtual port bound to different communication protocols, thereby enabling the sending or receiving of different data. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. Furthermore, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM or CDMA; it can also be a Wi-Fi chip; or it can be a Bluetooth chip.
[0222] In this embodiment, the processor 802 can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. This specification is not limiting.
[0223] In this embodiment, the memory 803 may include multiple layers. In a digital system, anything that can store binary data can be a memory. In an integrated circuit, a circuit with storage function but no physical form is also called a memory, such as RAM, FIFO, etc. In a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0224] This specification also provides a computer storage medium based on the above-described merchant matching method. The computer storage medium stores a computer program / instruction that, when executed, performs the following: based on the semantic feature words of the target merchant, searches for multiple candidate merchants related to the semantic feature words; each candidate merchant in the multiple candidate merchants forms multiple initial candidate pairs with the target merchant; performs multi-layer filtering on each initial candidate pair in the multiple initial candidate pairs to filter multiple candidate pairs to be processed by a classification model based on the multi-layer filtering results; processes the text similarity features of each candidate pair in the multiple candidate pairs using a classification model to obtain multiple classification results; the classification model is trained based on positive and negative samples formed by the semantic feature words; and determines the target candidate pair in the multiple candidate pairs based on the multiple classification results, and matches the target candidate merchant in the target candidate pair with the target merchant.
[0225] In this embodiment, the storage medium includes, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), cache, hard disk drive (HDD), or memory card. The memory can be used to store computer program instructions. The network communication unit can be an interface configured according to standards specified in the communication protocol for network connection communication.
[0226] In this embodiment, the specific functions and effects implemented by the program instructions stored in the computer storage medium can be explained in comparison with other implementation methods, and will not be repeated here.
[0227] This specification also provides a computer program product based on the above-described merchant matching method, including a non-transitory computer-readable storage medium storing a computer program / instructions operable to cause a computer to perform the following steps: based on the semantic feature words of the target merchant, searching for multiple candidate merchants related to the semantic feature words, each of the multiple candidate merchants forming multiple initial candidate pairs of the target merchant with the target merchant; performing multi-level filtering on each of the multiple initial candidate pairs to filter multiple candidate pairs to be processed by a classification model based on the multi-level filtering results; processing the text similarity features of each of the multiple candidate pairs using a classification model to obtain multiple classification results, the classification model being trained based on positive and negative samples formed by the semantic feature words; determining the target candidate pair among the multiple candidate pairs based on the multiple classification results, the target candidate merchant in the target candidate pair being matched with the target merchant.
[0228] While this specification provides the steps of operation for the methods described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or client product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. The terms "first," "second," etc., are used to denote names and do not indicate any particular order.
[0229] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0230] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0231] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this specification can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of this specification can essentially be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of this specification.
[0232] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. This specification can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.
[0233] Although this specification has been described by way of examples, those skilled in the art will recognize that many variations of this specification are possible without departing from its spirit, and it is intended that the appended claims cover such variations without departing from the spirit of this specification.
Claims
1. A merchant matching method, characterized in that, include: Based on the semantic feature words of the target merchant, search for multiple candidate merchants related to the semantic feature words, and each of the multiple candidate merchants and the target merchant form multiple initial candidate pairs of the target merchant. Each initial candidate pair among the plurality of initial candidate pairs is subjected to multi-level filtering processing, so as to select multiple candidate pairs to be processed by the classification model from the plurality of initial candidate pairs based on the results of the multi-level filtering processing. The text similarity features of each candidate pair in the multiple candidate pairings are processed using a classification model to obtain multiple classification results. The classification model is trained based on positive and negative samples formed by the semantic feature words. Based on the multiple classification results, a target candidate pair is determined among the multiple candidate pairs, and the target candidate merchant in the target candidate pair is matched with the target merchant.
2. The method according to claim 1, characterized in that, The method further includes: Extract merchant information from the target merchant, segment the merchant information to obtain multiple semantic feature words of different types; Accordingly, the step of searching for multiple candidate merchants related to the semantic feature words of the target merchant includes: Based on the aforementioned multiple different types of semantic feature words, establish target index information; Based on the target index information, search for multiple candidate merchants related to the multiple different types of semantic feature words.
3. The method according to claim 2, characterized in that, The merchant information is segmented to obtain multiple different types of semantic feature words, including: The merchant information is segmented according to a preset semantic structure segmentation rule to obtain multiple semantic feature words of different types. The preset semantic structure segmentation rule includes segmenting the merchant information into several consecutive semantic feature words of different types with the goal of the total segmentation probability being greater than a preset total probability threshold.
4. The method according to claim 1, characterized in that, The step of performing multi-layer filtering on each of the multiple initial candidate pairs includes: Perform full name matching on the initial candidate pairs and determine whether the full name matching result is a successful match. If not, perform semantic structure feature matching on the initial candidate pairings and determine whether the semantic structure feature matching result is a successful match. If not, determine whether the key features in the semantic structure features of the initial candidate pairings conflict; If not, perform a full-text match on the initial candidate matches and determine whether the full-text match result is a successful match. If not, use the initial candidate pairing as the candidate pairing.
5. The method according to claim 4, characterized in that, The method further includes: When the full-text matching result is determined to be a successful match, the initial candidate pairing is used as the target candidate pairing.
6. The method according to claim 1, characterized in that, The text similarity features include at least one of the following: the maximum length and the minimum length of merchant names in candidate pairs, the ratio of the minimum length to the maximum length, the length of the longest common subsequence of merchant names in candidate pairs, the ratio of the longest common subsequence length to the maximum length, the ratio of the longest common subsequence length to the minimum length, the business similarity of candidate pairs, the abbreviation similarity of candidate pairs, the additional information similarity of candidate pairs, and the organization type similarity of candidate pairs.
7. The method according to claim 1, characterized in that, The classification model is trained based on positive and negative samples formed from the semantic feature words, including: The semantic feature words are transformed to generate multiple approximate merchant names that are similar to the merchant information of the target merchant, which are used as a positive sample set. Randomly sample the semantic feature words and extract multiple differentiated merchant names that differ from the merchant information of the target merchant as a negative sample set. The classification model is obtained by training a random forest model based on the positive sample set and the negative sample set.
8. The method according to claim 1, characterized in that, The method further includes: When the classification result indicates that the candidate pairings do not match, the similarity features of transaction fluctuations of each candidate pairing among the multiple candidate pairs are obtained; The text similarity features and transaction fluctuation similarity features of each candidate pair in the multiple candidate pairings are processed using a target regression model to obtain the regression results of each candidate pairing. The target regression model is trained based on the sample data corresponding to the text similarity features and the transaction fluctuation similarity features. Based on the regression results, a similarity score is determined for each candidate pair. Based on the similarity score, each candidate pair is sorted in descending order to select the first target candidate pair from the descending sort results. The ranking of the first target candidate pair is greater than a preset ranking threshold, and the first target candidate merchant in the first target candidate pair is approximately matched with the target merchant.
9. A merchant matching device, characterized in that, include: The search module is used to search for multiple candidate merchants related to the semantic feature words of the target merchant. Each candidate merchant in the multiple candidate merchants forms multiple initial candidate pairs with the target merchant. A multi-layer filtering module is used to perform multi-layer filtering on each of the multiple initial candidate pairs, so as to select multiple candidate pairs to be processed by the classification model from the multiple initial candidate pairs according to the results of the multi-layer filtering. The classification module is used to process the text similarity features of each candidate pair in the multiple candidate pairings using a classification model to obtain multiple classification results. The classification model is trained based on positive and negative samples formed by the semantic feature words. The matching module is used to determine the target candidate pair among the multiple candidate pairs based on the multiple classification results, wherein the target candidate merchant in the target candidate pair is matched with the target merchant.
10. A computer device, comprising a memory, a processor, and computer programs / instructions stored in the memory, characterized in that, The processor executes the computer program / instructions to implement the steps of the method according to any one of claims 1 to 8.