Merchant classification methods, model training methods, devices, media and program products
By fusing features from merchant network topology and individual data, the problem of low accuracy of manual rules was solved, thus improving the accuracy of merchant classification.
Patent Information
- Application Number
- CN202510621841.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2026-11-17
AI Technical Summary
Manually written rules have low accuracy, resulting in low accuracy in merchant classification, and they are difficult to classify effectively when faced with complex and ever-changing merchant data.
Structural features are determined based on the merchant network topology, and semantic extraction from individual data is combined with feature fusion before being input into a machine learning model for merchant classification.
It improves the accuracy of merchant classification and can effectively handle complex and ever-changing merchant data.
Smart Images

Figure CN123115990A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a merchant classification method, model training method, apparatus, medium and program product. Background Technology
[0002] Merchant classification is crucial for accurate market analysis, risk assessment, and business decision-making. For example, in business decision-making scenarios, high-quality merchants can receive more traffic support and marketing resources, while risky merchants can be subject to enhanced supervision and risk warnings.
[0003] Currently, merchants are primarily categorized using a series of manually written rules. Specifically, these rules allow for keyword matching and grammatical analysis of text data such as merchant names, registration information, business scope, and user reviews to identify merchant categories. For example, a rule might specify particular industry keywords, such as "catering," "retail," or "manufacturing," corresponding to the industry type of a merchant. Based on this, the rule can be used to perform industry keyword matching and grammatical analysis on text data such as merchant names and business scopes to identify the merchant's industry category. Similarly, a rule might specify particular business registration types, such as "limited liability company" or "individual business," corresponding to the legal entity form of a merchant. Based on this, the rule can be used to perform business registration type matching and grammatical analysis on text data such as registration information to identify the legal entity form of a merchant.
[0004] However, manually written rules are inherently inaccurate, resulting in low accuracy in merchant classification; in fact, manually written rules may be unable to classify merchants when faced with complex and ever-changing merchant data. Summary of the Invention
[0005] This application provides a merchant classification method, model training method, device, medium, and program product, which can improve the accuracy of merchant classification; at the same time, it can also achieve merchant classification in the face of complex and ever-changing merchant data.
[0006] In a first aspect, embodiments of this application provide a merchant classification method, comprising: determining the structural features of a first merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges; performing semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant; performing feature fusion on the structural features and individual features of the first merchant to obtain the fused features of the first merchant; and inputting the fused features of the first merchant into a target machine learning model to classify the first merchant.
[0007] Secondly, embodiments of this application provide a model training method, including: determining the structural features of a sixth merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges; performing semantic extraction on the individual data of the sixth merchant to obtain the individual features of the sixth merchant; performing feature fusion on the structural features and individual features of the sixth merchant to obtain the fused features of the sixth merchant; and training a target machine learning model based on the fused features of the sixth merchant.
[0008] Thirdly, embodiments of this application provide a merchant classification device, comprising: a determination module, a semantic extraction module, a feature fusion module, and a classification module; wherein, the determination module is used to determine the structural features of a first merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges; the semantic extraction module is used to perform semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant; the feature fusion module is used to fuse the structural features and individual features of the first merchant to obtain the fused features of the first merchant; and the classification module is used to input the fused features of the first merchant into a target machine learning model to classify the first merchant.
[0009] In some implementations, the apparatus further includes an acquisition module and a generation module, wherein, before the determining module determines the structural characteristics of the first merchant based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, the acquisition module is used to acquire at least one type of relationship data among the equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the merchants; the generation module is used to generate the merchant network topology based on at least one type of relationship data among the equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation data, and competition relationship data among the merchants.
[0010] In some implementations, the generation module is specifically used to generate a corresponding merchant network topology based on each of at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants.
[0011] In some implementations, the generation module is specifically used to: generate a corresponding undirected graph of merchant relationships based on each of at least two of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants; and merge the undirected graphs of merchant relationships corresponding to at least two relationship data to obtain the merchant network topology.
[0012] In some implementations, the generation module is specifically used to: if at least one undirected graph of merchant relationships corresponding to at least two relational data items contains an edge between the second merchant and the third merchant, then construct an edge between the second merchant and the third merchant in the merchant network topology; if none of the undirected graphs of merchant relationships corresponding to at least two relational data items contain an edge between the fourth merchant and the fifth merchant, then do not construct an edge between the fourth merchant and the fifth merchant in the merchant network topology.
[0013] In some implementations, the generation module is further configured to: if at least one undirected graph of merchant relationships corresponding to at least two relation data items contains an edge between the second merchant and the third merchant, then perform a weighted summation of the weights corresponding to the edge between the second merchant and the third merchant in the undirected graph of merchant relationships corresponding to at least two relation data items to obtain the weights corresponding to the edge between the second merchant and the third merchant in the merchant network topology.
[0014] In some implementations, the determining module is specifically used to: determine multiple initial structural features of the first merchant based on the merchant network topology; and perform feature fusion on the multiple initial structural features of the first merchant to obtain the target structural features of the first merchant.
[0015] In some implementation methods, the semantic extraction module is specifically used to: input the individual data of the first merchant into multiple large language models to obtain multiple initial individual features of the first merchant; and fuse the multiple initial individual features of the first merchant to obtain the target individual features of the first merchant.
[0016] In some implementation methods, the feature fusion module is specifically used to: concatenate the structural features and individual features of the first merchant to obtain the initial fused features of the first merchant; and reduce the dimensionality of the initial fused features of the first merchant to obtain the target fused features of the first merchant.
[0017] In some implementation methods, the feature fusion module is specifically used to: determine the weights of the structural features and individual features of the first merchant based on a genetic algorithm or a particle swarm optimization algorithm; and perform a weighted summation of the structural features and individual features of the first merchant based on the weights of the structural features and individual features of the first merchant to obtain the fused features of the first merchant.
[0018] Fourthly, embodiments of this application provide a model training apparatus, comprising: a determination module, a semantic extraction module, a feature fusion module, and a training module; wherein, the determination module is used to determine the structural features of a sixth merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges; the semantic extraction module is used to perform semantic extraction on the individual data of the sixth merchant to obtain the individual features of the sixth merchant; the feature fusion module is used to perform feature fusion on the structural features and individual features of the sixth merchant to obtain the fused features of the sixth merchant; and the training module is used to train a target machine learning model based on the fused features of the sixth merchant.
[0019] In some implementations, the training module is specifically used to: calculate the cross-entropy loss and regularization loss of the target machine learning model based on the fusion features of the sixth merchant; calculate the weighted summation loss of the cross-entropy loss and regularization loss; and train the target machine learning model based on the weighted summation loss.
[0020] Fifthly, embodiments of this application provide an electronic device, including: a processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to perform the methods as described in the first to second aspects or their respective implementations.
[0021] In a sixth aspect, embodiments of this application provide a computer-readable storage medium for storing a computer program that causes a computer to perform the methods described in the first to second aspects or their respective implementations.
[0022] In a seventh aspect, embodiments of this application provide a computer program product including computer program instructions that cause a computer to perform the methods as described in the first to second aspects or their respective implementations.
[0023] Eighthly, embodiments of this application provide a computer program that causes a computer to perform the methods described in the first to second aspects or their respective implementations.
[0024] The technical solution provided in this application allows for better characterization of merchants within the overall merchant network topology due to the structural characteristics of merchants and the inclusion of semantic information in individual merchant data by the fused characteristics obtained from both. This improves the accuracy of merchant classification. Furthermore, the merchant network topology is characterized by its wide coverage and ease of updating, enabling merchant classification even with complex and ever-changing merchant data. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0026] Figure 1 This is a schematic diagram of a system architecture according to an embodiment of this application;
[0027] Figure 2 A flowchart illustrating a merchant classification method provided in this application embodiment;
[0028] Figure 3 A schematic diagram illustrating the fusion of an undirected graph of merchant relationships provided in an embodiment of this application;
[0029] Figure 4 A schematic diagram illustrating the fusion of an undirected graph of merchant relationships provided in another embodiment of this application;
[0030] Figure 5 A schematic diagram of the fusion of an undirected graph of merchant relationships provided in another embodiment of this application;
[0031] Figure 6 A schematic diagram of a merchant network topology provided for an embodiment of this application;
[0032] Figure 7 A schematic diagram of another merchant network topology provided in an embodiment of this application;
[0033] Figure 8 A flowchart illustrating another merchant classification method provided in this application embodiment;
[0034] Figure 9 A flowchart illustrating a model training method provided in this application embodiment;
[0035] Figure 10 A schematic diagram of a merchant sorting device 1000 provided in an embodiment of this application;
[0036] Figure 11 A schematic diagram of a model training device 1100 provided in an embodiment of this application;
[0037] Figure 12 This is a schematic block diagram of the electronic device 1200 provided in the embodiments of this application. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0040] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0041] Before introducing the technical solution of this application, the relevant knowledge of this application will be explained below:
[0042] I. Network topology, also known as network structure, refers to the arrangement and structure of nodes (such as devices, merchants, computers, etc.) and edges (such as connections, relationships, communication links, etc.) in a network. It describes the connection relationships between the various components of the network.
[0043] II. An undirected graph is a graph in which the edges have no direction. In an undirected graph, if there exists an edge connecting vertex A and vertex B, then this edge indicates that there is a relationship between A and B, and this relationship is bidirectional, that is, going from A to B and going from B to A are equivalent.
[0044] Third, a directed graph is a graph in which the edges have a direction. In a directed graph, if there exists an edge pointing from vertex A to vertex B, then this edge represents a directed relationship between A and B.
[0045] IV. A machine learning model is a mathematical model that learns patterns from data through algorithms and is used for tasks such as prediction, classification, and clustering. It is a core component of machine learning, capable of automatically extracting features from data and making decisions.
[0046] V. Neural Network Models are a class of computational models inspired by biological neural networks. They process and learn information by mimicking the way neurons and synaptic connections in the human brain. A neural network model consists of multiple layers, including input layers, hidden layers, and output layers. Layers are connected by weights, and non-linear characteristics are introduced through activation functions.
[0047] VI. Deep Learning Models are machine learning models based on artificial neural networks that can learn complex feature representations from data through multiple layers of nonlinear transformations. It is a subfield of machine learning, particularly well-suited for processing high-dimensional data (such as images, text, and speech).
[0048] 7. The Multilayer Perceptron (MLP) is an early form of neural network. It is a feedforward neural network consisting of multiple layers, including an input layer, one or more hidden layers, and an output layer. MLPs introduce nonlinearity by using nonlinear activation functions in the hidden layers, enabling them to learn complex representations of the input data.
[0049] 8. Large language models refer to AI models that use massive training data and have hundreds of millions or even trillions of parameters. These large models are trained on massive amounts of text data and are able to understand and generate natural language, performing various language tasks such as text classification, sentiment analysis, machine translation, and text generation.
[0050] 9. Large Language Model Embedding (LLM embedding): Based on the low-dimensional vector representation generated by the large-scale language model (LLM), it can convert text or other data into a vector form with semantic information.
[0051] The technical problems to be solved, the inventive concept and the system architecture of the embodiments of this application will be described below:
[0052] As mentioned above, manually written rules are inherently inaccurate, leading to low accuracy in merchant classification. Furthermore, manually written rules may be unable to classify merchants effectively when faced with complex and ever-changing merchant data.
[0053] To address the aforementioned technical problems, this application proposes a merchant classification method, comprising: determining the structural features of a first merchant based on a merchant network topology with each merchant as a node and the relationships between merchants as edges; performing semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant; fusing the structural features and individual features of the first merchant to obtain the fused features of the first merchant; and inputting the fused features of the first merchant into a target machine learning model to classify the first merchant. Since the structural features of a merchant can effectively characterize the merchant's properties within the entire merchant network topology, and the individual features of a merchant contain the semantic information of the merchant's individual data, classifying merchants based on the fused features obtained from both can improve the accuracy of merchant classification. Furthermore, because the merchant network topology has broad coverage and is easy to update, it can also achieve merchant classification even with complex and ever-changing merchant data.
[0054] In some possible implementations, the system architecture of embodiments of this application is as follows: Figure 1 As shown.
[0055] Figure 1 This is a schematic diagram of a system architecture involved in an embodiment of this application, such as... Figure 1 As shown, the system architecture includes at least one data source 110 and an electronic device 120. Each data source 110 and electronic device 120 can be directly or indirectly connected via wired or wireless communication.
[0056] It should be understood that at least one data source 110 includes, but is not limited to, at least one of the following: enterprise registration information database, e-commerce platform transaction record database, enterprise archive database of the Administration for Industry and Commerce, enterprise credit report database of financial institutions, and enterprise promotional material database on the Internet.
[0057] It should be understood that the diversity of data sources ensures the availability of comprehensive merchant data, covering various aspects such as the merchant's basic attributes, business activities, financial status, and market reputation.
[0058] In some feasible implementations, for any given merchant, the merchant data includes, but is not limited to, the merchant's relationship data and individual data.
[0059] It should be understood that merchant relationship data refers to data on the connections and interactions between merchants. This includes, but is not limited to: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperative relationship data, and competitive relationship data.
[0060] It should be understood that equity relationship data refers to information related to one merchant's ownership or control over another merchant. For example, equity relationship data includes the number of shares held and the percentage of shares held.
[0061] It should be understood that transaction relationship data refers to information related to commercial transactions between two merchants. For example, transaction relationship data includes transaction amount, number of transactions, etc.
[0062] It should be understood that supply chain upstream and downstream relationship data refers to information related to the flow of products or services in the supply chain. For example, supply chain upstream and downstream relationship data includes merchant A being an upstream merchant of merchant B or merchant B being a downstream merchant of merchant A.
[0063] Partnership data refers to information related to partnerships established between multiple merchants for a common goal or project. For example, partnership data includes the partnership between merchant A and merchant B.
[0064] Competitive relationship data refers to information related to the competitive relationships between different merchants in order to compete for customers, market share, or resources. For example, competitive relationship data includes the competitive relationship between merchant A and merchant B.
[0065] It should be understood that individual merchant data refers to data related to a single merchant, including, but not limited to: merchant name, merchant business scope, merchant registration information, and user review information.
[0066] In some implementations, electronic device 120 can obtain merchant data from at least one data source 110, generate a merchant network topology with each merchant as a node and the relationships between each merchant as edges based on the relational data in this merchant data, further determine the structural features of the first merchant based on the merchant network topology, perform semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant, perform feature fusion on the structural features and individual features of the first merchant to obtain the fused features of the first merchant, and input the fused features of the first merchant into a target machine learning model to classify the first merchant.
[0067] In some implementable manners, after the electronic device 120 acquires the merchant data of each merchant from at least one data source 110, it may first perform cleaning and preprocessing operations on these merchant data, then perform standardization and normalization processing on data from different data sources, so that the data from different data sources have a unified format and dimension, and finally establish a data index and association mechanism to associate and integrate the data about the same merchant in different data sources, so as to form complete merchant data. On this basis, the electronic device 120 can generate a merchant network topology based on the relationship data of the complete merchant data, and the personal data used subsequently also comes from the complete merchant data.
[0068] In some implementable manners, the cleaning performed by the electronic device 120 on the merchant data includes, but is not limited to: removing noise (i.e., invalid information) in the merchant data, such as duplicate records, data items with format errors, data values that are obviously illogical, and the like.
[0069] In some implementable manners, the preprocessing operations performed by the electronic device 120 on the merchant data include, but are not limited to: performing processing such as word segmentation and stop word removal on individual data in the merchant data, to facilitate subsequent analysis and processing. For example, common natural language processing tools, such as Natural Language Toolkit (NLTK), jieba and the like, can be used to perform word segmentation processing on the description text of the merchant's business scope, remove stop words such as "de", "shi", "zai", etc., to obtain a word segmentation sequence with actual semantics.
[0070] In some implementable manners, the standardization of data from different data sources performed by the electronic device 120 includes: the electronic device 120 unifies the data from different data sources into the same unit. For example, the date format is unified as "YYYY-MM-DD", and the amount data is unified as Renminbi Yuan.
[0071] In some implementable manners, the normalization of data from different data sources performed by the electronic device 120 includes: the electronic device 120 maps the data of different data sources to a specific interval, such as [0, 1], so that data of different features can be treated fairly in subsequent calculations, and analysis deviations caused by differences in data dimensions can be avoided.
[0072] In some implementable manners, the electronic device 120 establishes a data index and association mechanism to associate and integrate the data about the same merchant in different data sources to form complete merchant data, including: the electronic device 120 uses the unique merchant identifier as the primary key to merge the data items scattered in each data source, ensuring that the data of each merchant is complete and accurate, and providing a solid data foundation for subsequent merchant network topology construction and individual feature generation.
[0073] In some possible implementations, the merchant identifier may be a business registration number, a unified social credit code, etc., but is not limited to these.
[0074] In some possible implementations, electronic device 120 may be a terminal device, server, edge device, cloud platform, etc., but is not limited to these.
[0075] In some implementations, the electronic device 120 may be equipped with a display device to show the merchant's network topology, etc.
[0076] It should be understood that display devices are also called monitors, displays, touch screens, etc., and touch screens are also called touch screens, touch panels, etc.
[0077] In some possible implementations, the terminal device can be a desktop computer, laptop computer, tablet computer, smartphone, intelligent robot, etc., but is not limited to these.
[0078] In some implementations, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0079] It should be noted that, Figure 1 This is merely a schematic diagram of a system architecture provided in this application embodiment; the system architecture involved in this application embodiment is not limited to... Figure 1 The system architecture shown, for example, the system architecture involved in the embodiments of this application may also include other electronic devices, which can obtain merchant classification results from electronic device 110 and perform market analysis, risk assessment, business decisions, etc. based on the merchant classification results.
[0080] The technical solution of this application will be described in detail below:
[0081] Figure 2 A flowchart illustrating a merchant classification method provided in this application embodiment. This method can be executed by electronic devices such as terminal devices, servers, edge devices, and cloud platforms, but is not limited to these. Figure 2 As shown, the method may include:
[0082] S210: Based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, determine the structural characteristics of the first merchant.
[0083] It should be understood that the number of merchant network topologies can be one or more, and the edges of the merchant network topologies can be weighted or unweighted, depending on how the merchant network topologies are generated. The generation method of the merchant network topologies will be explained below:
[0084] In some feasible implementations, before determining the structural characteristics of the first merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges, the electronic device can acquire at least one of the following relationship data among the merchants: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data; and generate the merchant network topology based on at least one of the following relationship data among the merchants: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data.
[0085] It should be understood that explanations regarding equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data can be found above, and will not be repeated in this application embodiment.
[0086] In some possible implementations, the electronic device acquires at least one type of relationship data among various merchants, including equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data. This includes: the electronic device can acquire at least one type of relationship data among various merchants from at least one data source. Based on this, the electronic device generates a merchant network topology based on at least one type of relationship data among various merchants, including: the electronic device can directly generate a merchant network topology based on at least one type of relationship data among various merchants acquired from at least one data source.
[0087] In some possible implementations, the electronic device acquires at least one type of relationship data among various merchants, including equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data. This includes: the electronic device can acquire at least one type of relationship data among various merchants from at least one data source. Based on this, the electronic device generates a merchant network topology based on at least one type of relationship data among various merchants, including equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data. This includes: the electronic device first cleans the at least one type of relationship data; then, it standardizes and normalizes the relationship data from different data sources, so that the relationship data from different data sources has a unified format and dimension; finally, the cleaned, standardized, and normalized relationship data generates the merchant network topology.
[0088] It should be understood that the methods for cleaning, standardizing and normalizing data can be found above, and will not be repeated in the embodiments of this application.
[0089] As described above, after the electronic device obtains merchant data from at least one data source, it can first clean and preprocess this merchant data. Then, it can standardize and normalize the data from different data sources, ensuring that the data from different data sources has a unified format and dimension. Finally, it can establish a data index and association mechanism to associate and integrate data about the same merchant from different data sources, forming complete merchant data. Based on this, in some feasible implementations, the electronic device obtains at least one type of relationship data among the following: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data between merchants. This includes: the electronic device can obtain at least one type of relationship data among the following three types from the aforementioned complete merchant data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data between merchants.
[0090] In some possible implementations, the electronic device generates a merchant network topology based on at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants. This includes: the electronic device generates a corresponding merchant network topology based on each of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants.
[0091] For example, assuming we consider the equity relationships, transaction relationships, upstream and downstream supply chain relationships, cooperative relationships, and competitive relationships among various merchants, electronic devices can generate merchant network topologies corresponding to equity relationships, transaction relationships, upstream and downstream supply chain relationships, cooperative relationships, and competitive relationships. In this case, a total of 5 merchant network topologies can be generated.
[0092] The merchant network topology corresponding to equity relationships is a merchant network topology with each merchant as a node and equity relationships as edges. This merchant network topology can be a directed graph. For example, if merchant A holds shares in merchant B, then the merchant network topology contains directed edges from merchant A to merchant B. In addition, the edges of this merchant network topology can have weights, which can be obtained based on the number of shares or the shareholding ratio. If the number of shares is larger or the shareholding ratio is higher, the corresponding weight is larger. Conversely, if the number of shares is smaller or the shareholding ratio is lower, the corresponding weight is smaller.
[0093] The merchant network topology corresponding to the transaction relationship is a merchant network topology with each merchant as a node and the transaction relationship as an edge. This merchant network topology can be a directed graph. For example, if merchant A purchases goods from merchant B, then the merchant network topology contains directed edges from merchant B to merchant A. In addition, the edges of the merchant network topology can have weights, which can be obtained based on the transaction amount or the number of transactions. If the transaction amount is larger or the number of transactions is more, the corresponding weight is larger. Conversely, if the transaction amount is smaller or the number of transactions is less, the corresponding weight is smaller.
[0094] The merchant network topology corresponding to the upstream and downstream relationships in the supply chain is a merchant network topology with each merchant as a node and the upstream and downstream relationships in the supply chain as edges. This merchant network topology can be a directed graph. For example, if merchant A supplies goods to merchant B, then the merchant network topology contains directed edges from merchant A to merchant B. In addition, the edges of this merchant network topology can have weights, which can be obtained based on the supply volume. If the supply volume is larger, the corresponding weight is larger, and conversely, if the supply volume is smaller, the corresponding weight is smaller.
[0095] The merchant network topology corresponding to the cooperation relationship is a merchant network topology with each merchant as a node and the cooperation relationship as an edge. This merchant network topology can be an undirected graph. For example, if merchant A and merchant B have a cooperation relationship, then the merchant network topology contains an undirected edge between merchant A and merchant B. In addition, the edges of this merchant network topology can be unweighted.
[0096] The merchant network topology corresponding to the competitive relationship is a merchant network topology with each merchant as a node and the competitive relationship as an edge. This merchant network topology can be an undirected graph. For example, if merchant A and merchant B have a competitive relationship, then the merchant network topology contains an undirected edge between merchant A and merchant B. In addition, the edges of this merchant network topology can be unweighted.
[0097] In some possible implementations, the electronic device generates a merchant network topology based on at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants. This includes: the electronic device generates a corresponding undirected graph of merchant relationships based on each of at least two of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants; and merges the undirected graphs of merchant relationships corresponding to at least two of the following relationship data to obtain the merchant network topology.
[0098] It should be understood that the embodiments of this application obtain a merchant network topology by fusing the merchant relationship undirected graph corresponding to at least two relational data items. This allows the merchant network topology to contain more merchant relationships, thereby improving the accuracy of the structural features of merchants and thus improving the accuracy of merchant classification.
[0099] It should be understood that an undirected graph of merchant relationships refers to an undirected graph with each merchant as a node and the relationships between each merchant as edges.
[0100] It should be understood that in this feasible approach, at least two of the following relationships are considered: equity relationships, transaction relationships, upstream and downstream supply chain relationships, cooperative relationships, and competitive relationships. For each relationship, the electronic device generates a corresponding undirected graph of merchant relationships. Finally, the undirected graphs of merchant relationships corresponding to at least two relationship data are merged to obtain a merchant network topology. In other words, in this feasible approach, the number of merchant network topologies is 1.
[0101] In some possible implementations, the electronic device fuses the merchant relationship undirected graphs corresponding to at least two relational data points to obtain a merchant network topology, including: if at least one merchant relationship undirected graph in the merchant relationship undirected graphs corresponding to at least two relational data points contains an edge between the second merchant and the third merchant, then an edge between the second merchant and the third merchant is constructed in the merchant network topology; if none of the merchant relationship undirected graphs corresponding to at least two relational data points contain an edge between the fourth merchant and the fifth merchant, then no edge is constructed between the fourth merchant and the fifth merchant in the merchant network topology.
[0102] It should be understood that the first merchant, second merchant, third merchant, fourth merchant, fifth merchant and the sixth merchant mentioned below in the embodiments of this application can all be any one merchant, wherein the second merchant is different from the third merchant and the fourth merchant is different from the fifth merchant.
[0103] It should be understood that in this feasible approach, for each relationship, an undirected graph of merchant relationships is generated, and the edges of each undirected graph of merchant relationships may or may not have weights.
[0104] For example, the undirected graph of merchant relationships corresponding to equity relationships is an undirected graph with each merchant as a node and equity relationships as edges. The edges of this undirected graph can have weights, which can be obtained based on the number of shares or the proportion of shares. If the number of shares is larger or the proportion of shares is higher, the corresponding weight is larger. Conversely, if the number of shares is smaller or the proportion of shares is lower, the corresponding weight is smaller.
[0105] For example, the undirected graph of merchant relationships corresponding to transaction relationships is an undirected graph with each merchant as a node and the transaction relationship as an edge. The edges of this undirected graph can have weights, which can be obtained based on the transaction amount or the number of transactions. If the transaction amount is larger or the number of transactions is more, the corresponding weight is larger. Conversely, if the transaction amount is smaller or the number of transactions is less, the corresponding weight is smaller.
[0106] For example, an undirected graph of merchant relationships corresponding to upstream and downstream relationships in the supply chain is an undirected graph with each merchant as a node and the upstream and downstream relationships in the supply chain as edges. The edges of this undirected graph can have weights, which can be obtained based on the supply volume. If the supply volume is larger, the corresponding weight is larger, and conversely, if the supply volume is smaller, the corresponding weight is smaller.
[0107] For example, the undirected graph of merchant relationships corresponding to the cooperation relationship is an undirected graph with each merchant as a node and the cooperation relationship as an edge. The edges of this undirected graph can be unweighted.
[0108] For example, the undirected graph of merchant relationships corresponding to competitive relationships is an undirected graph with each merchant as a node and competitive relationships as edges. The edges of this undirected graph can be unweighted.
[0109] The following is combined with Figure 3 An example is provided to illustrate how to merge undirected graphs of merchant relationships corresponding to at least two data items:
[0110] For example, Figure 3 This is a schematic diagram of the fusion of an undirected graph of merchant relationships provided in an embodiment of this application, as shown below. Figure 3As shown, the undirected graph on the upper left includes the following edges: between merchant A and merchant B, between merchant A and merchant D, between merchant B and merchant C, and between merchant C and merchant D. The undirected graph on the upper right also includes the following edges: between merchant A and merchant B, between merchant A and merchant C, between merchant A and merchant D, and between merchant C and merchant D. Following the above fusion method, the undirected graph below, or the merchant network topology, is obtained. This merchant network topology includes the following edges: between merchant A and merchant B, between merchant A and merchant C, between merchant A and merchant D, between merchant B and merchant C, and between merchant C and merchant D.
[0111] In some feasible implementations, when electronic devices merge undirected graphs of merchant relationships corresponding to at least two relational data items, they may not generate weights for the merged merchant network topology.
[0112] For example, Figure 4 This is a schematic diagram of the fusion of an undirected graph of merchant relationships provided in another embodiment of this application, such as... Figure 4 As shown, the undirected graph on the upper left includes the following edges: merchant A and merchant B, merchant A and merchant D, merchant B and merchant C, and merchant C and merchant D. The weight of the edge between merchant A and merchant B is 0.2, the weight between merchant A and merchant D is 0.8, the weight between merchant B and merchant C is 0.5, and the weight between merchant C and merchant D is 0.6. The undirected graph on the upper right also includes the following edges: merchant A and merchant B, merchant A and merchant C, merchant A and merchant D, and merchant C and merchant D. The weight of the edge between merchant A and merchant B is 0.4, the weight between merchant A and merchant C is 0.6, the weight between merchant A and merchant D is 0.6, and the weight between merchant C and merchant D is 0.4. Following the above fusion method, the following undirected graph, or merchant network topology, is obtained. This merchant network topology includes: the edges between merchant A and merchant B, the edges between merchant A and merchant C, the edges between merchant A and merchant D, the edges between merchant B and merchant C, and the edges between merchant C and merchant D, but none of these edges have weights.
[0113] In some implementations, if at least one undirected graph of merchant relationships corresponding to at least two sets of relationship data contains an edge between a second merchant and a third merchant, then the electronic device performs a weighted summation on the undirected graphs of merchant relationships corresponding to the at least two sets of relationship data to obtain the weights corresponding to the edges between the second and third merchants in the merchant network topology. In other words, when the electronic device merges the undirected graphs of merchant relationships corresponding to at least two sets of relationship data, it can generate the weights of the merged merchant network topology, where a weighted summation method can be used to determine the weights of the merged merchant network topology.
[0114] For example, Figure 5 This is a schematic diagram of the fusion of an undirected graph representing merchant relationships provided in another embodiment of this application, such as... Figure 5 As shown, the undirected graph on the upper left includes the following edges: merchant A and merchant B, merchant A and merchant D, merchant B and merchant C, and merchant C and merchant D. The weight of the edge between merchant A and merchant B is 0.2, the weight between merchant A and merchant D is 0.8, the weight between merchant B and merchant C is 0.5, and the weight between merchant C and merchant D is 0.6. The undirected graph on the upper right also includes the following edges: merchant A and merchant B, merchant A and merchant C, merchant A and merchant D, and merchant C and merchant D. The weight of the edge between merchant A and merchant B is 0.4, the weight between merchant A and merchant C is 0.6, the weight between merchant A and merchant D is 0.6, and the weight between merchant C and merchant D is 0.4. Following the above fusion method, the undirected graph below, or merchant network topology, is obtained. The weights of the two undirected graphs above are each 0.5. Based on this, the merchant network topology includes: edges between merchant A and merchant B, between merchant A and merchant C, between merchant A and merchant D, between merchant B and merchant C, and between merchant C and merchant D. The weights of the edges between merchant A and merchant B are 0.3, between merchant A and merchant C are 0.3, between merchant A and merchant D are 0.5, between merchant B and merchant C are 0.25, and between merchant C and merchant D are 0.5.
[0115] In some implementations, the weights of the undirected graphs corresponding to the at least two relational data items can be preset; that is, the weights of the undirected graphs corresponding to the at least two relational data items can be fixed. For example, the weights of the two undirected graphs corresponding to the merchant relationships are both 0.5.
[0116] It should be understood that in each undirected graph of merchant relationships, each edge in the graph can correspond to a weight. It is worth mentioning that when there is no edge between two nodes, the weight corresponding to that edge can be considered to be 0. Based on this, for each undirected graph of merchant relationships, according to the preset arrangement order of the edges, the weights corresponding to these edges are combined into a weight vector. Based on this, each undirected graph of merchant relationships corresponds to a weight vector.
[0117] For example, such as Figure 5 The two undirected graphs shown above, assuming the default order of the edges is AB→AC→AD→BC→BD→CD, then the weight vector corresponding to the undirected graph on the left is (0.2,0,0.8,0.5,0,0.6), and the weight vector corresponding to the undirected graph on the right is (0.4,0.6,0.2,0,0,0.4).
[0118] In some implementations, before the electronic device performs a weighted summation on the undirected graph of merchant relationships corresponding to the at least two relational data items, a genetic algorithm or a particle swarm optimization algorithm can be used to determine the weight vectors corresponding to each of the undirected graphs of merchant relationships corresponding to the at least two relational data items. Based on this, the electronic device performs a weighted summation on the undirected graph of merchant relationships corresponding to the at least two relational data items to obtain the weights corresponding to the edges between the second and third merchants in the merchant network topology. This includes: the electronic device performs a weighted summation on the undirected graph of merchant relationships corresponding to the at least two relational data items based on the weight vectors obtained by using a genetic algorithm or a particle swarm optimization algorithm to obtain the weights corresponding to the edges between the second and third merchants in the merchant network topology.
[0119] The process of determining the weight vector using a genetic algorithm is explained below:
[0120] Step 1: Initialize the population;
[0121] A set of initial weight vectors is randomly generated for the merchant relationship undirected graph corresponding to the at least two relation data items. It is worth mentioning that each weight vector (i.e., each individual) here refers to the weight vector composed of the weights of the merchant relationship undirected graph corresponding to the at least two relation data items. In other words, each component in the weight vector corresponds to a merchant relationship undirected graph.
[0122] Let them be denoted as w1, w2, ... w m , where w i satisfy And w ij ≥0. w ij This represents the j-th component in the i-th weight vector of a set of weight vectors, which is the weight corresponding to the j-th merchant relationship undirected graph. This weight is actually in vector form.
[0123] Step 2: Assess fitness;
[0124] The fitness value of each weight vector is calculated, that is, each weight vector is substituted into the objective function to obtain the corresponding fitness. In this embodiment of the application, the objective function can be a function for calculating classification accuracy or F1 score, but is not limited to this.
[0125] Step 3: Select superior individuals based on fitness values (e.g., roulette wheel selection, tournament selection);
[0126] Step 4: Cross;
[0127] Perform a crossover operation on the selected individuals to generate a new weight vector.
[0128] Step 5: Randomly mutate some of the weight vectors to increase the diversity of the population.
[0129] Step 6: Repeat the selection, crossover, and mutation operations until the maximum number of iterations or the fitness value converges.
[0130] The process of determining the weight vector using the particle swarm optimization algorithm is explained below:
[0131] Step 1: Initialize the particle swarm;
[0132] A set of initial weight vectors is randomly generated for the merchant relationship undirected graph corresponding to the at least two relation data items. It is worth mentioning that each weight vector (i.e., each particle) here refers to the weight vector composed of the weights of the merchant relationship undirected graph corresponding to the at least two relation data items. In other words, each component in the weight vector corresponds to a merchant relationship undirected graph.
[0133] Let them be denoted as w1, w2, ... w m , where w i satisfy And w ij ≥0. w ij This represents the j-th component in the i-th weight vector of a set of weight vectors, which is the weight corresponding to the j-th merchant relationship undirected graph. This weight is actually in vector form.
[0134] Initialize the velocity v for each particle i .
[0135] Step 2: Assess fitness;
[0136] The fitness value of each weight vector is calculated, that is, each weight vector is substituted into the objective function to obtain the corresponding fitness. In this embodiment of the application, the objective function can be a function for calculating classification accuracy or F1 score, but is not limited to this.
[0137] Step 3: Update the individual optimal and global optimal;
[0138] The individual optimal solution for each particle is updated based on fitness, where the individual optimal solution for the i-th particle can be denoted as p. i .
[0139] Update the global optimal solution g.
[0140] Step 4: Update velocity and particles;
[0141] Update the particle's velocity and position based on individual optimality and global optimality:
[0142] v i =ωv i +c1r1(p i -w i )+c2r2(gw i );
[0143] w i =w i +v i
[0144] Where ω is the inertia weight, c1 and c2 are learning factors, and r1 and r2 are random numbers.
[0145] Step 5: Iteration.
[0146] Repeat the update of velocity and position until the maximum number of iterations or fitness value converges.
[0147] It should be understood that the embodiments of this application do not limit the method of determining the weights of the undirected graph of merchant relationships corresponding to at least two relational data items.
[0148] In some feasible implementations, electronic devices can also use merchants' personal data as attributes of merchant nodes in the merchant network topology. For example, electronic devices can use merchant A's merchant name, registration information, business scope, user review information, etc., as attribute information of the merchant A node in the merchant network topology.
[0149] In some feasible ways, electronic devices can use graph databases or network analysis tools to transform merchant data into merchant network topology, but are not limited to this.
[0150] In some implementations, the graph database may be Neo4j, Amazon Neptune, OrientDB, AnusGrap, etc., but is not limited to these.
[0151] In some implementations, the network analysis tool may be NetworkX, Gephi, igraph, etc., but is not limited to these.
[0152] In some feasible implementations, electronic devices can also utilize the query language provided by graph databases to query and modify the merchant's network topology, facilitating subsequent network analysis and feature extraction.
[0153] In some feasible ways, electronic devices can also utilize the programming interfaces provided by network analysis tools to query and modify the merchant's network topology, facilitating subsequent network analysis and feature extraction.
[0154] In some feasible implementations, after generating the merchant network topology, electronic devices can utilize visualization tools to draw the merchant network topology, providing intuitive support for further network analysis and understanding. For example, merchant nodes can be drawn as circles or squares, and the edges between merchant nodes can be drawn as lines, with the thickness or color intensity of the lines varying according to the weights of the edges.
[0155] For example, Figure 6 This is a schematic diagram of a merchant network topology provided in an embodiment of this application, such as... Figure 6 As shown, each merchant node is represented by a circle, and the edges between merchant nodes are represented by lines, with different line thicknesses representing different weights.
[0156] In some implementations, electronic devices can also utilize visualization tools to mark merchant nodes whose structural characteristics exceed a corresponding threshold, providing intuitive support for further network analysis and understanding. For example, merchant nodes in the merchant network topology that meet at least one of the following requirements can be marked, but are not limited to:
[0157] Degree centrality is greater than the degree centrality threshold;
[0158] The betweenness centrality is greater than the betweenness centrality threshold;
[0159] The proximity centrality is greater than the proximity centrality threshold;
[0160] The eigenvector centrality is greater than the eigenvector centrality threshold;
[0161] The modularity is greater than the modularity threshold.
[0162] For example, Figure 7 A schematic diagram of another merchant network topology provided in this application embodiment, as shown below. Figure 7 As shown, since merchant A's degree centrality is greater than the degree centrality threshold, merchant A can be labeled with a different color than other nodes.
[0163] In some implementations, the visualization tool may be Gephi, Graphviz, etc., but is not limited to these.
[0164] It should be understood that the structural characteristics of the first merchant are used to characterize the overall structural features of the first merchant in the merchant network topology.
[0165] In some possible implementations, the structural characteristics of the first merchant include at least one of the following, but are not limited to: degree centrality, betweenness centrality, proximity centrality, eigenvector centrality, and modularity.
[0166] It should be understood that degree centrality is used to measure the number of times a node is directly connected to other nodes.
[0167] It should be understood that if the merchant network topology is an undirected graph, then the degree centrality of node i can be calculated using the following formula (1):
[0168] Degree(i) = ∑ j≠i A ij (1)
[0169] Among them, A ij This represents the edge weight between node i and node j.
[0170] It should be understood that if the merchant network topology is a directed graph, then the in-degree centrality and out-degree centrality of node i can be calculated using the following formulas (2) and (3):
[0171] In-Degree(i)=∑ j≠i A ji (2)
[0172] Out-Degree(i)=∑ j≠i A ij (3)
[0173] Among them, A ji Let A represent the edge weight from node j to node i. ij This represents the edge weight from node i to node j.
[0174] It should be understood that betweenness centrality is used to measure the importance of a node as a “bridge” in a network, i.e., how many shortest paths pass through that node.
[0175] The betweenness centrality of node i can be calculated using the following formula (4):
[0176]
[0177] Where σ st σ is the number of shortest paths from node s to node t. st (i) represents the number of shortest paths from s to t that pass through node i.
[0178] It should be understood that proximity centrality is used to measure the reciprocal of the average shortest path length from one node to other nodes, reflecting the efficiency of information propagation from a node.
[0179] The proximity centrality of node i can be calculated using the following formula (5):
[0180]
[0181] Where d(i,j) is the shortest path length between node i and node j.
[0182] It should be understood that eigenvector centrality is used to measure the importance of a node, taking into account not only the number of its neighbors but also the importance of those neighbors.
[0183] The eigenvector centrality of node i can be calculated using the following formula (6):
[0184]
[0185] Where x is the eigenvector centrality vector, and its i-th component is the eigenvector centrality of node i, A is the adjacency matrix, and λ is the eigenvalue.
[0186] It should be understood that modularity is used to measure the quality of community segmentation. The higher the modularity, the tighter the connections within the community and the relatively sparser the connections between communities. Modularity can be used to identify the characteristics of merchant groups with close business ties.
[0187] In some feasible ways, electronic devices can calculate modularity using clustering algorithms.
[0188] In some feasible implementations, the electronic device determines the structural characteristics of the first merchant based on the merchant network topology, which has each merchant as a node and the relationships between each merchant as edges. This includes: the electronic device determining multiple initial structural characteristics of the first merchant based on the merchant network topology; and performing feature fusion on the multiple initial structural characteristics of the first merchant to obtain the target structural characteristics of the first merchant.
[0189] It should be understood that the embodiments of this application obtain target structural features by fusing multiple initial structural features, which can make the target structural features contain more structural features, thereby improving the accuracy of the merchant's structural features and thus improving the accuracy of merchant classification.
[0190] It should be understood that the initial structural feature of the first merchant refers to a structural feature directly determined based on the merchant's network topology. The target structural feature of the first merchant refers to the fused feature obtained by fusing multiple initial structural features.
[0191] For example, assuming that the electronic device calculates the degree centrality and betweenness centrality of merchant A, the electronic device can fuse the degree centrality and betweenness centrality of merchant A to obtain the target structural features of merchant A.
[0192] In some feasible implementations, the electronic device performs feature fusion on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant, including: the electronic device performs feature splicing on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant.
[0193] It should be understood that if multiple initial structural features of the first merchant are concatenated to obtain the target structural features of the first merchant, the dimensionality of the target structural features may be high, which will increase computational complexity and reduce merchant classification efficiency. Therefore, this application proposes to reduce the dimensionality of the target structural features of the first merchant in order to reduce computational complexity and improve merchant classification efficiency.
[0194] In some possible implementations, electronic devices can use principal component analysis (PCA) or other dimensionality reduction methods to reduce the dimensionality of the target structural features of the first merchant. This application does not limit the dimensionality reduction method.
[0195] It should be understood that PCA decomposes the covariance matrix into eigenvalues, selects the eigenvectors corresponding to the k largest eigenvalues as new basis vectors, and projects the original eigenvectors onto this set of basis vectors to obtain the dimensionality-reduced eigenvectors. For example, assuming the target structural feature, i.e., the concatenated structural feature, has a dimension of m = p + d, then the fused feature matrix F fushion The matrix is n x m dimensional, where n represents the number of merchants. Each row in the matrix represents the target structural features of one merchant. First, the fused feature matrix F can be calculated. fushion The covariance matrix Σ is then used to perform eigenvalue decomposition on the covariance matrix Σ=VΛV. T Where Λ is a diagonal matrix with eigenvalues on the diagonal, and V is the eigenvector matrix. Let f be the target structural feature of a merchant before dimensionality reduction. fusion Then, its dimensionality-reduced target structural features are: f reduced =f fusion V k , where V k It is a matrix consisting of the first k columns of V.
[0196] In some feasible implementations, the electronic device performs feature fusion on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant, including: the electronic device performs a weighted summation on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant.
[0197] In some implementations, the weights corresponding to the plurality of initial structural features can be preset, that is, the weights corresponding to the plurality of initial structural features can be fixed. For example, the weights corresponding to the degree centrality and the betweenness centrality of merchant A are both 0.5.
[0198] In some feasible implementations, before the electronic device performs feature fusion on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant, a genetic algorithm or a particle swarm optimization algorithm can be used to determine the weights (or weight vectors) corresponding to each of the multiple initial structural features. Based on this, the electronic device performs feature fusion on multiple initial structural features of the first merchant to obtain the target structural features of the first merchant, including: the electronic device performs feature fusion on multiple initial structural features of the first merchant based on the weight vectors obtained by using a genetic algorithm or a particle swarm optimization algorithm to obtain the target structural features of the first merchant.
[0199] It should be understood that the process of determining the weight vector using a genetic algorithm and the process of determining the weight vector using a particle swarm optimization algorithm can be referred to above, and will not be repeated in the embodiments of this application.
[0200] S220: Perform semantic extraction on the individual data of the first merchant to obtain the individual characteristics of the first merchant;
[0201] It should be understood that the individual characteristics of the first merchant are used to characterize the unique features of the first merchant.
[0202] It should be understood that the individual characteristics of the first merchant are actually an embedding, or an embedding vector, which contains the semantic characteristics of the first merchant.
[0203] In some implementations, electronic devices can use an embedding module to perform semantic extraction on the individual data of the first merchant to obtain the individual characteristics of the first merchant.
[0204] It should be understood that the embedding module is also referred to as an embedding unit, embedding operator, embedding layer, etc., and the embodiments of this application do not limit this.
[0205] It should be understood that, since the large language model contains an embedding layer, electronic devices can use the large language model embedding (LLM embedding) to perform semantic extraction on the individual data of the first merchant, thereby obtaining the individual characteristics of the first merchant. In other words, electronic devices can use the large language model to perform semantic extraction on the individual data of the first merchant, thereby obtaining the individual characteristics of the first merchant.
[0206] In some possible implementations, the large language model can be a mixed model, a Bidirectional Encoder Representations from Transformers (BERT) model, etc., and the embodiments of this application do not limit this.
[0207] In some feasible implementations, electronic devices can use a large language model to perform semantic extraction on the individual data of the first merchant to obtain the individual characteristics of the first merchant. This includes: if there are multiple individual data of the first merchant, the electronic device concatenates the multiple individual data of the first merchant and inputs them into the large language model so that the large language model can perform semantic extraction on these individual data of the first merchant to obtain the individual characteristics of the first merchant.
[0208] For example, assuming that the individual data of the first merchant includes: merchant name, registration information and business scope, then the electronic device can concatenate the merchant name, registration information and business scope of the first merchant and input them into the large language model, so that the large language model can perform semantic extraction on these individual data of the first merchant to obtain the individual characteristics of the first merchant.
[0209] It should be understood that each individual data point of a merchant can be interpreted as a sequence. Therefore, when an electronic device concatenates multiple individual data points, it is actually concatenating multiple sequences. For example, concatenating the merchant name, registration information, and business scope of the first merchant results in (merchant name, registration information, business scope). In summary, this application embodiment does not limit the method of concatenating multiple individual data points.
[0210] In some feasible implementations, the electronic device can determine the input format and output dimensions of the large language model based on the characteristics of the merchant data and the task requirements. Based on this, the electronic device can process the individual data of the first merchant according to the input format of the large language model and output individual characteristics that conform to the output dimensions.
[0211] For example, for text information such as merchant names and business scope descriptions, electronic devices can concatenate them into a complete text sequence according to the input format of the large language model, and use it as the input of the large language model. The output dimension is set to a low-dimensional vector of fixed length, such as 256-dimensional or 512-dimensional, for subsequent calculation and analysis.
[0212] In some feasible implementations, if the large language model is based on the Transformer architecture, then when the electronic device uses the large language model to perform semantic extraction on the individual data of the first merchant, it can use the large language model to segment and encode the individual data of the first merchant, add positional encoding and segment encoding information, and finally convert it into the individual features of the first merchant.
[0213] In some feasible implementations, electronic devices can use the word segmenter of a large language model to segment the individual data of the first merchant, use the encoder of the large language model to encode the individual data of the first merchant, add positional encoding and segment encoding information, and use the embedding representation layer of the large language model to convert the encoding result into the individual features of the first merchant.
[0214] To improve the quality and stability of the individual characteristics of the first merchant, this application proposes to use multiple large language models to perform semantic extraction on the individual data of the first merchant, and to fuse the multiple individual characteristics of the first merchant obtained, as follows:
[0215] In some feasible implementations, the electronic device performs semantic extraction on the individual data of the first merchant to obtain the individual characteristics of the first merchant, including: the electronic device inputs the individual data of the first merchant into multiple large language models to obtain multiple initial individual characteristics of the first merchant; and fuses the multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant.
[0216] In some implementations, the multiple large language models can be multiple different large language models or different variants of the same large language model; this application does not limit this.
[0217] It should be understood that the initial individual characteristics of the first merchant refer to the individual characteristics before feature fusion. The target individual characteristics of the first merchant refer to the fused characteristics obtained by fusing multiple initial individual characteristics.
[0218] For example, suppose an electronic device can merge merchant A's merchant name and registration information to obtain merchant A's target individual characteristics.
[0219] In some possible implementations, the electronic device fuses multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant, including: the electronic device performs feature splicing on multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant.
[0220] It should be understood that if multiple initial individual characteristics of the first merchant are concatenated to obtain the target individual characteristics of the first merchant, the dimensionality of the target individual characteristics may be high, which will increase the computational complexity and reduce the efficiency of merchant classification. Therefore, this application proposes to reduce the dimensionality of the target individual characteristics of the first merchant in order to reduce the computational complexity and improve the efficiency of merchant classification.
[0221] In some possible implementations, electronic devices can use PCA or other dimensionality reduction methods to reduce the dimensionality of the target individual characteristics of the first merchant. This application does not limit the dimensionality reduction method.
[0222] It should be understood that the explanation of the PCA dimensionality reduction method can be found above, and the embodiments of this application will not be repeated here.
[0223] In some possible implementations, the electronic device performs feature fusion on multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant, including: the electronic device performs a weighted summation on multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant.
[0224] Assuming the large language model is denoted as M, and the individual data of a merchant is denoted as t, the individual characteristics of the merchant obtained through inference using the large language model are denoted as e. t =M(t), where e t ∈R d Let d be the dimension of the individual feature. If k LLM models are used to generate k initial individual features for a merchant, their corresponding weights are ω1, ω2…ω k ,in, The target individual characteristics are:
[0225]
[0226] in, These are the initial individual features generated based on the i-th large language model.
[0227] In some implementations, the weights corresponding to the multiple initial individual characteristics can be preset, that is, the weights corresponding to the multiple initial individual characteristics can be fixed. For example, the weights corresponding to merchant A's merchant name and registration information are both 0.5.
[0228] In some possible implementations, before the electronic device performs feature fusion on multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant, a genetic algorithm or a particle swarm optimization algorithm can be used to determine the weights (or weight vectors) corresponding to each of the multiple initial individual characteristics. Based on this, the electronic device performs feature fusion on multiple initial individual characteristics of the first merchant to obtain the target individual characteristics of the first merchant, including: the electronic device performs feature fusion on multiple initial individual characteristics of the first merchant based on the weight vectors obtained by using a genetic algorithm or a particle swarm optimization algorithm to obtain the target individual characteristics of the first merchant.
[0229] It should be understood that the process of determining the weight vector using a genetic algorithm and the process of determining the weight vector using a particle swarm optimization algorithm can be referred to above, and will not be repeated in the embodiments of this application.
[0230] In some feasible implementations, when an electronic device performs a weighted summation of multiple initial individual characteristics of a first merchant, the weights corresponding to these initial individual characteristics are adjustable. The optimal values of these weights are determined through validation on a large-scale dataset, enabling the target individual characteristics to better capture the semantic information of the individual data.
[0231] S230: Perform feature fusion on the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant;
[0232] In some feasible implementations, the electronic device performs feature fusion on the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant. This includes: the electronic device splices the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant.
[0233] For example, suppose merchant A has the structural feature f. sruct = [f1, f2…f p Merchant A's individual characteristic is e. t = [e1, e2…e d Then, the fusion feature of merchant A is f. fusion = [f1, f2…f p e1, e2…e d ].
[0234] It should be understood that if the structural and individual characteristics of the first merchant are concatenated to obtain the fused characteristics of the first merchant, the dimensionality of the fused characteristics of the first merchant may be high, which will increase computational complexity and reduce merchant classification efficiency. Therefore, this application proposes to reduce the dimensionality of the fused characteristics of the first merchant to reduce computational complexity and improve merchant classification efficiency. Based on this, in some possible implementations, the electronic device performs feature fusion on the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant, including: the electronic device concatenates the structural and individual characteristics of the first merchant to obtain the initial fused characteristics of the first merchant; and reduces the dimensionality of the initial fused characteristics of the first merchant to obtain the target fused characteristics of the first merchant.
[0235] It should be understood that the initial fusion feature of the first merchant is the fusion feature of the first merchant before dimensionality reduction. The target fusion feature of the first merchant is the dimensionality-reduced fusion feature obtained after reducing the dimensionality of the initial fusion feature of the first merchant.
[0236] In some possible implementations, the electronic device can use PCA or other dimensionality reduction methods to reduce the target structural features of the initial fusion features of the first merchant. The embodiments of this application do not limit the dimensionality reduction method.
[0237] It should be understood that the explanation of the PCA dimensionality reduction method can be found above, and the embodiments of this application will not be repeated here.
[0238] In some feasible implementations, the electronic device performs feature fusion on the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant. This includes: the electronic device performs a weighted summation of the structural and individual characteristics of the first merchant based on the respective weights of the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant.
[0239] For example, suppose merchant A has the structural feature f. sruct = [f1, f2…f p The weight vector corresponding to the structural features of merchant A is α = [α1, α2, ..., α]. p Merchant A's individual characteristic is e. t = [e1, e2…e d The weight vector corresponding to the individual characteristics of merchant A is β = [β1, β2, ..., β]. d Then, the integration characteristics of merchant A are:
[0240]
[0241] In some possible implementations, the weights corresponding to the structural features and individual features of the first merchant can be preset, that is, the weights corresponding to the structural features and individual features of the first merchant can be fixed.
[0242] In some feasible implementations, before the electronic device performs a weighted summation of the structural and individual characteristics of the first merchant based on their respective weights to obtain the fused characteristics of the first merchant, a genetic algorithm or particle swarm optimization algorithm can be used to determine the weights (or weight vectors) corresponding to the structural and individual characteristics of the first merchant. Based on this, the electronic device can perform a weighted summation of the structural and individual characteristics of the first merchant based on the weight vectors obtained by the genetic algorithm or particle swarm optimization algorithm to obtain the fused characteristics of the first merchant.
[0243] It should be understood that the process of determining the weight vector using a genetic algorithm and the process of determining the weight vector using a particle swarm optimization algorithm can be referred to above, and will not be repeated in the embodiments of this application.
[0244] In some feasible implementations, when the structural and individual characteristics of the first merchant of the electronic device are weighted and summed, the weights corresponding to the structural and individual characteristics are adjustable, and the optimal values of these weights are determined through validation on a large-scale dataset.
[0245] S240: Input the fused features of the first merchant into the target machine learning model to classify the first merchant.
[0246] In some possible implementations, the target machine learning model can be a neural network model, such as a deep learning model, but is not limited to this.
[0247] In some possible implementations, the target machine learning model can be an MLP model, a Convolutional Neural Network (CNN) model, a Graph Neural Network (GNN) model, etc., but is not limited to these.
[0248] In some feasible ways, electronic devices can select a target machine learning model based on the task requirements of the merchant's classification task.
[0249] For example, if the task requirement for merchant classification is to identify whether a merchant is a high-risk merchant, then this classification task can be determined to be a binary classification task. Based on this, the target machine learning model selected by the electronic device can be an MLP model with one node in its output layer, and the Sigmoid function can be used as the activation function. Furthermore, the number of hidden layers and nodes in the MLP model can be determined through experimentation and optimization.
[0250] For example, if the task requirement for merchant classification is to identify the industry category of a merchant, then this classification task can be determined to be a multi-class classification task. Based on this, the target machine learning model selected by the electronic device can be an MLP model, where the number of nodes in the output layer is equal to the number of merchant categories, and the ReLU function can be used as the activation function. Furthermore, the number of hidden layers and nodes in the MLP model can be determined through experimentation and optimization.
[0251] In some feasible implementations, the classification result of the first merchant can be the industry classification result. Based on this, the target machine learning model can output the industry category probability distribution of the first merchant. Furthermore, the electronic device can select the category with the highest probability as the predicted category of the merchant, i.e., the industry classification result.
[0252] In some feasible implementations, the classification result of the first merchant can be a risk level, the target machine learning model can output a risk score, and further, the electronic device can determine the risk level of the merchant, such as high risk, medium risk, or low risk, based on a set threshold and the risk score.
[0253] In some possible implementations, the classification result of the first merchant can be whether it is a high-risk merchant, the target machine learning model can output a risk score, and further, the electronic device can determine whether the merchant is high-risk based on a set threshold and the risk score.
[0254] This application provides a merchant classification method, comprising: determining the structural features of a first merchant based on a merchant network topology with each merchant as a node and the relationships between merchants as edges; performing semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant; fusing the structural features and individual features of the first merchant to obtain the fused features of the first merchant; and inputting the fused features of the first merchant into a target machine learning model to classify the first merchant. The technical solution of this application has the following technical effects:
[0255] First, because the structural characteristics of merchants can effectively represent their features within the overall merchant network topology, and the individual characteristics of merchants contain semantic information about their individual data, classifying merchants based on the fused features obtained from both can improve the accuracy of merchant classification. Furthermore, because the merchant network topology has broad coverage and is easily updated, it can also classify merchants even when faced with complex and ever-changing data. For example, in credit assessments of merchants by financial institutions, high-risk merchants can be identified more accurately, reducing financial risk; in merchant management on e-commerce platforms, merchants can be more accurately classified and labeled, improving platform operational efficiency and user experience.
[0256] Secondly, because the merchant network topology has the characteristics of wide coverage and easy updating, it can also classify merchants in the face of complex and ever-changing merchant data.
[0257] Third, when electronic devices perform semantic extraction on the individual data of the first merchant based on the embedded representation layer, even if the individual data is semantically ambiguous, the semantic information in the individual data can be mined, thereby improving the accuracy of merchant classification.
[0258] Fourth, the merchant network topology constructed in this application embodiment can include various merchant relationships, thereby comprehensively reflecting the relationships between merchants and facilitating a holistic understanding of the structure and characteristics of the business ecosystem. Simultaneously, utilizing the embedded representation layer to perform semantic extraction on individual merchant data helps uncover semantic associations and potential patterns, providing strong support for in-depth analysis of business relationships. For example, in supply chain management, it can more clearly identify key node merchants and potential risk links in the supply chain, thereby optimizing the supply chain structure and improving its stability and efficiency; in market competition analysis, it can more accurately discover potential cooperation opportunities and market gaps among competitors, providing more valuable information for corporate strategic decision-making.
[0259] Fifth, the embedded representation layer possesses strong semantic understanding and generalization capabilities, enabling it to adapt to individual data across different domains and scenarios. Furthermore, the merchant network topology can be easily expanded and updated. With the continuous addition of new merchant data and relationship information, the model can be adjusted and optimized in a timely manner, allowing it to continuously adapt to changes and developments in the business environment. For example, in emerging e-commerce live-streaming scenarios, the technical solution of this application can quickly adapt to new merchant types and transaction models. Through the analysis of live-streaming data and user interaction information, it accurately identifies potential merchant streamers and provides them with personalized development suggestions and platform support, promoting the healthy development of the e-commerce live-streaming industry.
[0260] The following example illustrates the merchant classification method in an e-commerce scenario:
[0261] For example, Figure 8 The flowchart illustrates another merchant classification method provided in this application embodiment. This method can be executed by electronic devices such as terminal devices, servers, edge devices, and cloud platforms, but is not limited to these. Figure 8 As shown, the merchant classification method may include:
[0262] S810: Obtain merchant data from various merchants on e-commerce platforms;
[0263] In some possible implementations, merchant data includes merchant relationship data and individual data, such as, but not limited to, at least one of the following: merchant registration information, store product information, transaction records, user reviews, etc.
[0264] S820: Cleans, preprocesses, standardizes, normalizes, associates, and integrates merchant data from various merchants to form complete merchant data;
[0265] It should be understood that the above text provides information on data cleaning, preprocessing, standardization, normalization, data association, and integration, and this application's embodiments will not elaborate further.
[0266] For example, electronic devices can standardize the format of merchants' registration information, segment and remove stop words from product description text, and organize transaction records according to time and amount.
[0267] S830: Generate a merchant network topology with each merchant as a node and the relationships between each merchant as edges;
[0268] In some possible implementations, electronic devices can generate a merchant network topology based on at least one set of relationship data between the various merchants.
[0269] In some possible implementations, the electronic device generates a merchant network topology based on at least one piece of relationship data between the merchants, including: the electronic device generates a corresponding merchant network topology based on each piece of relationship data in the at least one relationship data between the merchants.
[0270] In some possible implementations, the electronic device generates a merchant network topology based on at least one relationship data between various merchants, including: the electronic device generates a corresponding undirected graph of merchant relationships based on each of the at least two relationship data between various merchants; and merges the undirected graphs of merchant relationships corresponding to the at least two relationship data to obtain the merchant network topology.
[0271] It should be understood that the method for generating the merchant network topology can be referred to above, and will not be repeated in this embodiment.
[0272] S840: Based on a large language model, semantic extraction is performed on the individual data of each merchant to obtain the individual characteristics of each merchant;
[0273] To improve the quality and stability of merchants' individual characteristics, this application proposes using multiple large language models to perform semantic extraction on merchants' individual data and fusing the resulting multiple individual characteristics of merchants, as detailed below:
[0274] In some feasible implementations, electronic devices perform semantic extraction on individual merchant data to obtain individual merchant features, including: the electronic device inputs the individual merchant data into multiple large language models to obtain multiple initial individual features of the merchant; and fuses the multiple initial individual features of the merchant to obtain the target individual features of the merchant.
[0275] It should be understood that the method of fusing target individual characteristics can be referred to above, and will not be repeated in the embodiments of this application.
[0276] S850: Based on the merchant network topology, determine the structural characteristics of each merchant;
[0277] In some possible implementations, the structural characteristics of a merchant include at least one of the following, but are not limited to: degree centrality, betweenness centrality, proximity centrality, eigenvector centrality, and modularity.
[0278] It should be understood that the method for determining the structural characteristics of merchants can be referred to above, and will not be repeated in this embodiment.
[0279] S860: For each merchant, feature fusion is performed on the merchant's structural features and individual features to obtain the merchant's fused features;
[0280] In some feasible implementations, the electronic device performs feature fusion on the merchant's structural and individual characteristics to obtain the merchant's fused characteristics. This includes: the electronic device splices the merchant's structural and individual characteristics to obtain the merchant's fused characteristics.
[0281] In some feasible implementations, the electronic device performs feature fusion on the merchant's structural and individual characteristics to obtain the merchant's fused characteristics, including: the electronic device concatenates the merchant's structural and individual characteristics to obtain the merchant's initial fused characteristics; and reduces the dimensionality of the merchant's initial fused characteristics to obtain the merchant's target fused characteristics.
[0282] In some possible implementations, electronic devices may employ PCA dimensionality reduction or other dimensionality reduction methods, and the embodiments of this application do not impose any limitations on this.
[0283] In some feasible implementations, the electronic device performs feature fusion on the merchant's structural and individual characteristics to obtain the merchant's fused characteristics. This includes: the electronic device performs a weighted sum of the merchant's structural and individual characteristics based on their respective weights to obtain the merchant's fused characteristics.
[0284] It should be understood that the feature fusion method and weight determination method can be referred to above, and will not be repeated in the embodiments of this application.
[0285] S870: For each merchant, input the merchant's fusion features into the MLP to classify the merchant.
[0286] In some feasible approaches, after obtaining the merchant classification results, appropriate management and service recommendations can be made based on these results. For example, merchants identified as high-quality can be given more traffic support and marketing resources, while high-risk merchants can be subject to enhanced supervision and risk warnings.
[0287] It should be understood that, in the embodiments of this application, merchant classification is based on the fusion features of the merchant's structural features and individual features. The structural features can better characterize the characteristics of the merchant in the entire merchant network topology, and the individual features contain the semantic information of the merchant's individual data. Therefore, classifying merchants in e-commerce scenarios based on the fusion features obtained from the two can improve the accuracy of merchant classification in e-commerce scenarios, thereby improving the platform's operational efficiency and user experience.
[0288] The following is combined with Figure 9 The model training method is explained as follows:
[0289] Figure 9 A flowchart illustrating a model training method provided in this application embodiment. This method can be executed by a training device, which may be the same as or different from the electronic device that executes the merchant classification method. Figure 9 As shown, the model training method may include:
[0290] S910: Based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, determine the structural characteristics of the sixth merchant.
[0291] In some possible implementations, the training device determines the structural features of the sixth merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges. This includes: the training device determining multiple initial structural features of the sixth merchant based on the merchant network topology; and performing feature fusion on the multiple initial structural features of the sixth merchant to obtain the target structural features of the sixth merchant.
[0292] In some possible implementations, the training device performs feature fusion on multiple initial structural features of the sixth merchant to obtain the target structural features of the sixth merchant, including: the training device performs feature splicing on multiple initial structural features of the sixth merchant to obtain the target structural features of the sixth merchant.
[0293] In some possible implementations, the training device performs feature fusion on multiple initial structural features of the sixth merchant to obtain the target structural features of the sixth merchant, including: the training device performs a weighted summation on multiple initial structural features of the sixth merchant to obtain the target structural features of the sixth merchant.
[0294] It should be understood that the method for determining the structural characteristics of the sixth merchant can refer to the method for determining the structural characteristics of the first merchant, and this application embodiment will not elaborate on this further.
[0295] S920: Semantic extraction is performed on the individual data of the sixth merchant to obtain the individual characteristics of the sixth merchant;
[0296] In some possible implementations, the training device performs semantic extraction on the individual data of the sixth merchant to obtain the individual characteristics of the sixth merchant, including: the training device inputs the individual data of the sixth merchant into multiple large language models to obtain multiple initial individual characteristics of the sixth merchant; and fuses the multiple initial individual characteristics of the sixth merchant to obtain the target individual characteristics of the sixth merchant.
[0297] In some possible implementations, the training device fuses multiple initial individual features of the sixth merchant to obtain the target individual features of the sixth merchant, including: the training device performs feature splicing on multiple initial individual features of the sixth merchant to obtain the target individual features of the sixth merchant.
[0298] In some possible implementations, the training device fuses multiple initial individual characteristics of the sixth merchant to obtain the target individual characteristics of the sixth merchant, including: the training device performs a weighted summation of multiple initial individual characteristics of the sixth merchant to obtain the target individual characteristics of the sixth merchant.
[0299] It should be understood that the method for determining the individual characteristics of the sixth merchant can refer to the method for determining the individual characteristics of the first merchant, and this application embodiment will not elaborate on this further.
[0300] S930: Perform feature fusion on the structural and individual characteristics of the sixth merchant to obtain the fused characteristics of the sixth merchant;
[0301] In some feasible implementations, the training device performs feature fusion on the structural and individual features of the sixth merchant to obtain the fused features of the sixth merchant. This includes: the training device concatenating the structural and individual features of the sixth merchant to obtain the initial fused features of the sixth merchant; and reducing the dimensionality of the initial fused features of the sixth merchant to obtain the target fused features of the sixth merchant.
[0302] In some possible implementations, the training device performs feature fusion on the structural and individual features of the sixth merchant to obtain the fused features of the sixth merchant. This includes: the training device determining the weights corresponding to the structural and individual features of the sixth merchant based on a genetic algorithm or a particle swarm optimization algorithm; and performing a weighted summation of the structural and individual features of the sixth merchant based on the weights corresponding to the structural and individual features of the sixth merchant to obtain the fused features of the sixth merchant.
[0303] It should be understood that the method for determining the integration characteristics of the sixth merchant can refer to the method for determining the integration characteristics of the first merchant, and this application embodiment will not elaborate on this further.
[0304] S940: Training a target machine learning model based on the fusion features of the sixth merchant.
[0305] In some implementations, the training device trains the target machine learning model based on the fusion features of the sixth merchant, including: the training device calculates the cross-entropy loss of the target machine learning model based on the fusion features of the sixth merchant; and trains the target machine learning model based on the cross-entropy loss.
[0306] It should be understood that, for binary classification problems, the cross-entropy loss function can be as follows:
[0307]
[0308] Where n is the number of samples, y i This is the true label of the i-th sample, which takes the value 0 or 1. Let be the predicted probability of the target machine learning model for the i-th sample.
[0309] It should be understood that for multi-class classification problems, the cross-entropy loss function can be as follows:
[0310]
[0311] Where n is the number of samples, c is the number of categories, and y ij The true value of the i-th sample in the j-th class is either 0 or 1. Let be the probability that the target machine learning model predicts the i-th sample as belonging to the j-th category.
[0312] It should be understood that, in order to prevent model overfitting, a regularization loss can also be added to the loss function. This regularization loss can be either L1 or L2 regularization loss, and the embodiments of this application do not impose any limitations on it. Based on this, the training device trains the target machine learning model based on the fusion features of the sixth merchant, including: the training device calculating the cross-entropy loss and regularization loss of the target machine learning model based on the fusion features of the sixth merchant; calculating the weighted summation loss of the cross-entropy loss and the regularization loss; and training the target machine learning model based on the weighted summation loss.
[0313] For example, suppose the target machine learning model is an MLP model, and its weight matrix from the input layer to the l-th hidden layer is W. l The bias vector is b l If the activation function of the hidden layer is g(·), then the output of the l-th hidden layer is:
[0314] h l =g(W l h l-1 +b l )
[0315] Among them, h l-1 For the (l-1)th hidden layer, h is the output. 0 The fusion features of the sixth merchant are input.
[0316] In the MLP model, L1 regularization loss can be added to the cross-entropy loss function, as shown in the following formula:
[0317]
[0318] Alternatively, L2 regularization loss can be added to the cross-entropy loss function of the MLP model, as shown in the following formula:
[0319]
[0320] Where λ is the regularization parameter.
[0321] It should be understood that by adding an L1 norm penalty term to the weight vector in the loss function, some weights of the model are made to approach 0, thereby achieving feature selection and model simplification; by adding an L2 norm penalty term to the weight vector in the loss function, the weight values are more evenly distributed, avoiding overfitting caused by some weights being too large.
[0322] Furthermore, the training device adjusts the model's parameters (weights and biases) by minimizing the loss function and using optimization algorithms such as Stochastic Gradient Descent (SGD), Adaptive Gradient Algorithm (Adagrad), and Adaptive Delta (Adadelta), enabling the model to gradually fit the training data and improve prediction accuracy.
[0323] For example, suppose the target machine learning model is an MLP model, and its weight matrix from the input layer to the l-th hidden layer is W. l The bias vector is b l If the activation function of the hidden layer is g(·), then the output of the l-th hidden layer is:
[0324] h l =g(W l h l-1 +b l )
[0325] Among them, h l-1 For the (l-1)th hidden layer, h is the output. 0 The fusion features of the sixth merchant are input.
[0326] The weights can be optimized using the SGD optimization algorithm, and the formula is as follows:
[0327]
[0328] Where η is the learning rate. The loss function is applied to the weight matrix W. l The gradient.
[0329] Furthermore, after each training epoch, the training device can also evaluate the target machine learning model using a validation set. Specifically, it can calculate performance metrics such as accuracy, recall, F1 score, precision, false positive rate, false negative rate, receiver operating characteristic curve (ROC curve), and area under the curve (AUC). If the performance of the target machine learning model on the validation set no longer improves or even declines, early stopping can be used to stop training, preventing the model from overfitting the training data and losing its ability to generalize to unknown data.
[0330] It should be understood that precision represents the proportion of samples predicted as positive that are actually positive; false positive rate and false negative rate reflect the number of times the model misclassifies negative examples as positive and positive examples as negative, respectively; the ROC curve reflects the true positive rate and false positive rate at different thresholds; and AUC is the area under the ROC curve. A higher AUC value indicates better model performance and better classification ability across different thresholds. Analyzing these evaluation metrics provides a comprehensive understanding of the model's performance in merchant classification tasks, identifies existing problems and shortcomings, and provides a basis for further model improvement and optimization.
[0331] This application provides a model training method, comprising: determining the structural features of a sixth merchant based on a merchant network topology with each merchant as a node and the relationships between merchants as edges; extracting semantics from the individual data of the sixth merchant to obtain the individual features of the sixth merchant; fusing the structural features and individual features of the sixth merchant to obtain the fused features of the sixth merchant; and training a target machine learning model based on the fused features of the sixth merchant. Since structural features can effectively characterize the characteristics of a merchant within the entire merchant network topology, and individual features contain the semantic information of the merchant's individual data, training the model based on the fused features allows the model to learn the characteristics of the merchant within the entire merchant network topology and the semantic information of the merchant's individual data, thereby facilitating merchant classification.
[0332] The preferred embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.
[0333] It should also be understood that, in the various method embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0334] The methods provided in the embodiments of this application have been described above. The merchant classification device and model training device provided in the embodiments of this application will be described below.
[0335] Figure 10 A schematic diagram of a merchant sorting device 1000 provided in this application embodiment is shown below. Figure 10 As shown, the device 1000 includes: a determination module 1010, a semantic extraction module 1020, a feature fusion module 1030, and a classification module 1040; wherein, the determination module 1010 is used to determine the structural features of a first merchant based on a merchant network topology with each merchant as a node and the relationships between each merchant as edges; the semantic extraction module 1020 is used to perform semantic extraction on the individual data of the first merchant to obtain the individual features of the first merchant; the feature fusion module 1030 is used to fuse the structural features and individual features of the first merchant to obtain the fused features of the first merchant; and the classification module 1040 is used to input the fused features of the first merchant into a target machine learning model to classify the first merchant.
[0336] In some possible implementations, the device 1000 further includes an acquisition module 1050 and a generation module 1060, wherein, before the determination module 1010 determines the structural characteristics of the first merchant based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, the acquisition module 1050 is used to acquire at least one type of relationship data among the equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the merchants; the generation module 1060 is used to generate the merchant network topology based on at least one type of relationship data among the equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation data, and competition relationship data among the merchants.
[0337] In some implementations, the generation module 1060 is specifically used to generate a corresponding merchant network topology based on each of at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants.
[0338] In some implementations, the generation module 1060 is specifically used to: generate a corresponding undirected graph of merchant relationships based on each of at least two of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants; and merge the undirected graphs of merchant relationships corresponding to at least two of the relationship data to obtain the merchant network topology.
[0339] In some implementations, the generation module 1060 is specifically used to: if at least one undirected graph of merchant relationships corresponding to at least two relational data items contains an edge between the second merchant and the third merchant, then construct an edge between the second merchant and the third merchant in the merchant network topology; if none of the undirected graphs of merchant relationships corresponding to at least two relational data items contain an edge between the fourth merchant and the fifth merchant, then do not construct an edge between the fourth merchant and the fifth merchant in the merchant network topology.
[0340] In some implementations, the generation module 1060 is further configured to: if at least one undirected graph of merchant relationships corresponding to at least two relation data items contains an edge between the second merchant and the third merchant, then perform a weighted summation of the weights corresponding to the edge between the second merchant and the third merchant in the undirected graph of merchant relationships corresponding to at least two relation data items to obtain the weights corresponding to the edge between the second merchant and the third merchant in the merchant network topology.
[0341] In some implementations, the determining module 1010 is specifically used to: determine multiple initial structural features of the first merchant based on the merchant network topology; and perform feature fusion on the multiple initial structural features of the first merchant to obtain the target structural features of the first merchant.
[0342] In some possible implementations, the semantic extraction module 1020 is specifically used to: input the individual data of the first merchant into multiple large language models to obtain multiple initial individual features of the first merchant; and fuse the multiple initial individual features of the first merchant to obtain the target individual features of the first merchant.
[0343] In some possible implementations, the feature fusion module 1030 is specifically used to: perform feature splicing on the structural features and individual features of the first merchant to obtain the initial fused features of the first merchant; and reduce the dimensionality of the initial fused features of the first merchant to obtain the target fused features of the first merchant.
[0344] In some implementation methods, the feature fusion module 1030 is specifically used to: determine the weights of the structural features and individual features of the first merchant based on a genetic algorithm or a particle swarm optimization algorithm; and perform a weighted summation of the structural features and individual features of the first merchant based on the weights of the structural features and individual features of the first merchant to obtain the fused features of the first merchant.
[0345] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 10 The device 1000 shown can perform Figure 2 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the device 1000 are respectively for implementing Figure 2 For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0346] The apparatus 1000 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0347] Figure 11 This is a schematic diagram of a model training device 1100 provided in an embodiment of this application, as shown below. Figure 11 As shown, the device 1100 includes: a determination module 1110, a semantic extraction module 1120, a feature fusion module 1130, and a training module 1140; wherein, the determination module 1110 is used to determine the structural features of the sixth merchant based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges; the semantic extraction module 1120 is used to perform semantic extraction on the individual data of the sixth merchant to obtain the individual features of the sixth merchant; the feature fusion module 1130 is used to perform feature fusion on the structural features and individual features of the sixth merchant to obtain the fused features of the sixth merchant; and the training module 1140 is used to train a target machine learning model based on the fused features of the sixth merchant.
[0348] In some implementations, the training module 1140 is specifically used to: calculate the cross-entropy loss and regularization loss of the target machine learning model based on the fusion features of the sixth merchant; calculate the weighted summation loss of the cross-entropy loss and regularization loss; and train the target machine learning model based on the weighted summation loss.
[0349] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 11 The device 1100 shown can perform Figure 9 The corresponding method embodiments, and the foregoing and other operations and / or functions of each module in the device 1100 are respectively for implementing Figure 9For the sake of brevity, the corresponding processes in each method are not described in detail here.
[0350] The apparatus 1100 of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.
[0351] Figure 12 This is a schematic block diagram of the electronic device 1200 provided in an embodiment of this application. Figure 12 As shown, the electronic device 1200 may include:
[0352] The system includes a memory 1210 and a processor 1220. The memory 1210 stores a computer program 1230 and transfers the computer program 1230 to the processor 1220. In other words, the processor 1220 can retrieve and run the computer program 1230 from the memory 1210 to implement the methods described in the embodiments of this application.
[0353] For example, the processor 1220 can be used to execute the steps in the above method according to the instructions in the computer program 1230.
[0354] In some embodiments of this application, the processor 1220 may include, but is not limited to:
[0355] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0356] In some embodiments of this application, the memory 1210 includes, but is not limited to:
[0357] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
[0358] In some embodiments of this application, the computer program 1230 may be divided into one or more modules, which are stored in the memory 1210 and executed by the processor 1220 to complete the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 1230 in the electronic device.
[0359] like Figure 12 As shown, the electronic device 1200 may further include:
[0360] Transceiver 1240, which can be connected to processor 1220 or memory 1210.
[0361] The processor 1220 can control the transceiver 1240 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 1240 may include a transmitter and a receiver. The transceiver 1240 may further include antennas, and the number of antennas may be one or more.
[0362] It should be understood that the various components in the electronic device 1200 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.
[0363] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.
[0364] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.
[0365] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0366] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0367] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0368] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0369] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A merchant classification method, characterized by, include: Based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, the structural characteristics of the first merchant are determined. Semantic extraction is performed on the individual data of the first merchant to obtain the individual characteristics of the first merchant; The structural and individual characteristics of the first merchant are fused to obtain the fused characteristics of the first merchant. The fused features of the first merchant are input into the target machine learning model to classify the first merchant.
2. The method of claim 1, wherein, Before determining the structural characteristics of the first merchant based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, the process also includes: Obtain at least one type of relationship data among the following: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among various merchants; The merchant network topology is generated based on at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the various merchants.
3. The method of claim 2, wherein, The process of generating the merchant network topology based on at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the various merchants includes: Based on each of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the merchants, a corresponding merchant network topology is generated.
4. The method of claim 2, wherein, The process of generating the merchant network topology based on at least one of the following relationship data: equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the various merchants includes: Based on each of at least two of the following relationship data among the equity relationship data, transaction relationship data, supply chain upstream and downstream relationship data, cooperation relationship data, and competition relationship data among the merchants, generate a corresponding undirected graph of merchant relationships. The merchant network topology is obtained by fusing the undirected graphs of merchant relationships corresponding to the at least two relational data items.
5. The method of claim 4, wherein, The process of fusing the undirected graph of merchant relationships corresponding to the at least two relational data items to obtain the merchant network topology includes: If at least one undirected graph in the merchant relationship undirected graph corresponding to the at least two relational data items contains an edge between the second merchant and the third merchant, then construct the edge between the second merchant and the third merchant in the merchant network topology; If the undirected graph of merchant relationships corresponding to the at least two relational data items does not contain an edge between the fourth merchant and the fifth merchant, then the edge between the fourth merchant and the fifth merchant in the merchant network topology will not be constructed.
6. The method of claim 5, wherein, Also includes: If at least one undirected graph in the merchant relationship undirected graph corresponding to the at least two relation data items contains an edge between the second merchant and the third merchant, then the weights corresponding to the edge between the second merchant and the third merchant in the merchant relationship undirected graph corresponding to the at least two relation data items are weighted and summed to obtain the weights corresponding to the edge between the second merchant and the third merchant in the merchant network topology.
7. The method according to any one of claims 1 to 6, characterized in that, The structural characteristics of the first merchant, determined based on a merchant network topology with each merchant as a node and the relationships between merchants as edges, include: Based on the merchant network topology, several initial structural features of the first merchant are determined; Multiple initial structural features of the first merchant are fused to obtain the target structural features of the first merchant.
8. The method according to any one of claims 1 to 6, characterized in that, The step of semantic extraction from the individual data of the first merchant to obtain the individual characteristics of the first merchant includes: The individual data of the first merchant is input into multiple large language models to obtain multiple initial individual characteristics of the first merchant; Multiple initial individual characteristics of the first merchant are fused to obtain the target individual characteristics of the first merchant.
9. The method according to any one of claims 1 to 6, characterized in that, The feature fusion of the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant includes: The structural and individual characteristics of the first merchant are spliced together to obtain the initial fused characteristics of the first merchant; The initial fusion features of the first merchant are reduced in dimensionality to obtain the target fusion features of the first merchant.
10. The method according to any one of claims 1 to 6, characterized in that, The feature fusion of the structural and individual characteristics of the first merchant to obtain the fused characteristics of the first merchant includes: The weights corresponding to the structural and individual characteristics of the first merchant are determined based on genetic algorithms or particle swarm optimization algorithms. Based on the weights corresponding to the structural and individual characteristics of the first merchant, the structural and individual characteristics of the first merchant are weighted and summed to obtain the fused characteristics of the first merchant.
11. A model training method, characterized in that, include: Based on the merchant network topology with each merchant as a node and the relationships between each merchant as edges, the structural characteristics of the sixth merchant are determined. Semantic extraction is performed on the individual data of the sixth merchant to obtain the individual characteristics of the sixth merchant; The structural and individual characteristics of the sixth merchant are fused to obtain the fused characteristics of the sixth merchant; A target machine learning model is trained based on the fusion features of the sixth merchant.
12. The method according to claim 11, characterized in that, The training of the target machine learning model based on the fusion features of the sixth merchant includes: Based on the fusion characteristics of the sixth merchant, calculate the cross-entropy loss and regularization loss of the target machine learning model; Calculate the weighted summation loss of the cross-entropy loss and the regularization loss; The target machine learning model is trained based on the weighted summation loss.
13. A merchant sorting device, characterized in that, include: The determination module is used to determine the structural characteristics of the first merchant based on the merchant network topology, which has each merchant as a node and the relationships between each merchant as edges. The semantic extraction module is used to extract semantics from the individual data of the first merchant to obtain the individual characteristics of the first merchant. The feature fusion module is used to fuse the structural features and individual features of the first merchant to obtain the fused features of the first merchant. The classification module is used to input the fused features of the first merchant into the target machine learning model to classify the first merchant.
14. A model training device, characterized in that, include: The determination module is used to determine the structural characteristics of the sixth merchant based on the merchant network topology, which has each merchant as a node and the relationships between each merchant as edges. The semantic extraction module is used to perform semantic extraction on the individual data of the sixth merchant to obtain the individual characteristics of the sixth merchant; The feature fusion module is used to fuse the structural features and individual features of the sixth merchant to obtain the fused features of the sixth merchant. The training module is used to train a target machine learning model based on the fusion features of the sixth merchant.
15. An electronic device, characterized in that, include: A processor and a memory, the memory being used to store a computer program, the processor being used to invoke and run the computer program stored in the memory to perform the method of any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that, Used to store a computer program that causes a computer to perform the method as described in any one of claims 1 to 12.
17. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the method as described in any one of claims 1 to 12.
