Subject name classification and model training method, computer equipment and storage medium
By sampling, cleaning, segmenting, and removing cross-keywords from the customer entity name data of financial institutions, an integrated model framework was constructed, which solved the problem of low accuracy in customer entity classification and achieved more efficient data management and analysis.
Patent Information
- Application Number
- CN202411595654.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-11
AI Technical Summary
Financial institutions face challenges due to the lack of standardization in massive amounts of customer data and the incompleteness of name information, resulting in low accuracy in customer classification.
By sampling multiple types of original subject name data to ensure a balanced number of samples in each category, data cleaning, word segmentation, and cross-keyword removal are performed. Embedded features are extracted, and a subject name classification model is constructed using a pre-defined ensemble model framework for training.
It improves the accuracy and generalization ability of the entity name classification model, enabling more accurate classification of customer entities and supporting data management and analysis in areas such as risk management, compliance management, business development and customer acquisition, and data governance.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a subject name classification and model training method, computer equipment and storage medium. Background Art
[0002] With the rapid development of the financial market, the business scope of financial institutions has been unprecedentedly expanded. This has not only brought new growth points to financial institutions, but also put forward higher requirements for their service capabilities and risk management. With the increase in business types, the types and quantities of data of financial institutions have also increased sharply. In terms of risk management, compliance management, business development and customer acquisition, and data governance, financial institutions need to start with customer entities for data management and analysis. However, faced with the non-standardization and lack of attributes of massive customer data, as well as the incompleteness of name information, the accuracy of customer entity classification is low. Summary of the invention
[0003] The present application proposes a subject name classification and model training method, device, computer equipment and storage medium to improve the accuracy of numerical simulation of compressible flow problems.
[0004] In a first aspect, a subject name classification model training method is provided, comprising:
[0005] Sampling multiple categories of original subject name data to obtain a subject name sample data set, wherein the number of subject name sample data of each category in the subject name sample data set is balanced;
[0006] Performing data cleaning on the subject name sample data set to obtain a subject name standard data set;
[0007] Performing word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list;
[0008] Performing cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list;
[0009] Extracting the embedding features of each target subject name vocabulary in the target subject name vocabulary list to obtain an embedding feature set;
[0010] The preset integrated model framework is used to train based on the embedded feature set to obtain a subject name classification model.
[0011] In a second aspect, a subject name classification method is provided, including:
[0012] Get the name of the subject to be classified;
[0013] Performing data cleaning on the subject name to be classified to obtain a standard subject name;
[0014] Performing word segmentation processing on the standard subject name to obtain an initial vocabulary list;
[0015] Performing cross-keyword elimination processing on the initial vocabulary list to obtain a target vocabulary list;
[0016] extracting embedding features of the target vocabulary list;
[0017] The embedded features are classified based on the subject name classification model described in any one of the above-mentioned subject name classification model training methods to obtain the subject category of the subject name to be classified.
[0018] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned subject name classification model training method and / or subject name classification method when executing the computer program.
[0019] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned subject name classification model training method and / or subject name classification method are implemented.
[0020] The present application provides a subject name classification and model training method, apparatus, computer equipment and storage medium thereof. The method comprises the following steps: sampling multiple categories of original subject name data to obtain a subject name sample data set, wherein the number of subject name sample data of each category in the subject name sample data set is balanced; data cleaning is performed on the subject name sample data set to obtain a subject name standard data set; word segmentation is performed on the subject name standard data set to obtain an initial subject name vocabulary list; cross-keyword elimination is performed on the initial subject name vocabulary list to obtain a target subject name vocabulary list; embedded features of each target subject name vocabulary in the target subject name vocabulary list are extracted to obtain an embedded feature set; training is performed based on the embedded feature set using a preset integrated model framework to obtain a subject name classification model. In the subject name classification and model training scheme provided in the present application, a subject name sample data set is obtained by sampling, and the number of subject name sample data of each type is ensured to be balanced. Then, the subject name sample data is cleaned to improve the data quality. Then, word segmentation and deduplication are performed to reduce redundancy in the data, which is beneficial to improving data consistency and the generalization ability of the model. Finally, training based on the embedded feature set with a preset integrated model framework can effectively improve the accuracy of the subject name classification model, which is beneficial to data management and analysis in risk management, compliance management, business development and customer acquisition, data governance and other aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 An application environment diagram of the subject name classification and model training method provided in the embodiment of the present application;
[0023] Figure 2 A flowchart of a subject name classification model training method provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of the structure of the integrated model framework provided in the embodiment of the present application;
[0025] Figure 4 A flowchart of a subject name classification method provided in an embodiment of the present application;
[0026] Figure 5 A structural block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0031] The subject name classification model training method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In the application environment. The computer device 110 communicates with the server 120 via the network 130. The computer device 110 can sample multiple categories of original subject name data to obtain a subject name sample data set, in which the number of each category of subject name sample data in the subject name sample data set is balanced; perform data cleaning on the subject name sample data set to obtain a subject name standard data set; perform word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list; perform cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list; extract the embedded features of each target subject name vocabulary in the target subject name vocabulary list to obtain an embedded feature set; train based on the embedded feature set using a preset integrated model framework to obtain a subject name classification model, and display it through the computer device 110. In the present invention, a subject name sample data set is obtained by sampling, and the number of subject name sample data of each type is ensured to be balanced. Then, the subject name sample data is cleaned to improve the data quality. Then, word segmentation and deduplication are performed to reduce redundancy in the data, which is beneficial to improving the consistency of the data and the generalization ability of the model. Finally, the preset integrated model framework is used for training based on the embedded feature set, which can effectively improve the accuracy of the subject name classification model, thereby facilitating data management and analysis in terms of risk management, compliance management, business development and customer acquisition, data governance, etc. Among them, the computer device 110 can be, but is not limited to, various smart phones 110-1, tablet computers 110-2 and laptop computers 110-3. The present invention is described in detail below through specific embodiments.
[0032] The subject name classification model training method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1In the application environment. Among them, the computer device 110 communicates with the server 120 through the network 130. The computer device 110 can obtain the name of the subject to be classified; perform data cleaning on the subject name to be classified to obtain a standard subject name. Perform word segmentation processing on the standard subject name to obtain an initial vocabulary list. Perform cross-keyword elimination processing on the initial vocabulary list to obtain a target vocabulary list. Extract the embedded features of the target vocabulary list. Classify the embedded features based on the subject name classification model described in any of the above-mentioned subject name classification model training methods to obtain the subject category of the subject name to be classified, and display it through the computer device 110. In the present invention, by performing data cleaning on the subject name to be classified to improve data quality, then performing word segmentation processing and deduplication to reduce redundancy in the data, classifying the embedded features based on the subject name classification model described in any of the above-mentioned subject name classification model training methods to obtain the subject category of the subject name to be classified, it can effectively and accurately classify the subject name to be classified, so as to facilitate data management and analysis in risk management, compliance management, business development and customer acquisition, data governance and other aspects.
[0033] See also Figure 2 As shown, Figure 2 A flow chart of a subject name classification model training method provided in an embodiment of the present invention, which can be applied to both a terminal and a server, is illustrated in this embodiment by applying it to a server. The subject name classification model training method includes the following steps:
[0034] S101: Sampling multiple categories of original subject name data to obtain a subject name sample data set.
[0035] The number of sample data of each type of subject name in the subject name sample data set is balanced. The original subject name data is external information data obtained from open market channels.
[0036] The subject name sample data set may include company data and financial product data. Company data includes industrial and commercial enterprise data, social group data, and individual industrial and commercial data. Financial product data may include public offerings, private placements, and trusts, etc.
[0037] In this application, by performing balanced sampling on multiple categories of original subject name data, it is possible to ensure that the sample data has sufficient coverage of feature distribution and a balanced data volume, thereby ensuring the training results of the subsequent integrated model framework.
[0038] Optionally, sampling multiple types of original subject name data to obtain a subject name sample data set includes:
[0039] Performing first subject name sampling on the multiple categories of original subject name data to obtain first subject name sample data;
[0040] Performing group faction identification on the multiple types of original subject name data to obtain multiple group factions, and performing second subject name sampling on the original subject name data corresponding to each of the group faction vertices to obtain second subject name sample data;
[0041] Performing third subject name sampling on the multiple categories of original subject name data to obtain third subject name sample data;
[0042] Obtaining subject name sample data according to the first subject name sample data, the second subject name sample data and the third subject name sample data;
[0043] Among them, the sum of the number of the second subject name sample data and the third subject name sample data is consistent with the number of the first subject name sample data. The group faction can be a graph with the original subject names in the original subject name data as vertices and the similarity values between the original subject names as edges. It should be noted that the consistency here is not limited to complete equality, and a certain amount of deviation can be allowed, and the deviation can be determined according to the actual training scenario, which does not affect the balance between the number of samples, that is, the sum of the number of the second subject name sample data and the third subject name sample data is balanced with the number of the first subject name sample data, which indicates consistency.
[0044] The first subject name data may be data consisting of financial product names. Specifically, the multiple types of original subject name data include public offerings, private placements, trusts and other financial product data obtained from all public channels. Therefore, the multiple types of original subject name data may be sampled to obtain the first subject name sample data.
[0045] The second subject name data may be data consisting of industrial and commercial enterprise names. Multiple types of original subject data include industrial and commercial enterprise data. Since the name characteristics of industrial and commercial enterprises and their subsidiaries are highly similar, a graph can be constructed for the entire amount of industrial and commercial enterprise data, such as taking industrial and commercial enterprises as nodes, and equity relations, legal person relations, etc. as edges, to construct a graph, and then, through equity relations and group faction identification algorithms, group faction divisions are formed, and then all group faction vertex enterprises are used as samples of industrial and commercial enterprise names, thereby obtaining the second subject name sample data. For example, if the industrial and commercial enterprise names corresponding to each vertex in the group faction include Evergrande Real Estate Group Co., Ltd., Vanke Co., Ltd., China Resources Land Co., Ltd., Longfor Group Holdings Co., Ltd., etc., then Evergrande Real Estate Group Co., Ltd., Vanke Co., Ltd., China Resources Land Co., Ltd., Longfor Group Holdings Co., Ltd., etc. are used as samples of the sampling of the group faction. If there are multiple group factions, the sampling samples of multiple group factions can be obtained, thereby obtaining the second subject name sample data.
[0046] The third subject name data may include data consisting of social group names and data consisting of individual business names. The multiple categories of original subject name data may also include social group data and business group data. Based on this, the multiple categories of original subject name data may be randomly sampled based on regions to obtain the third subject name sample data. For example, by randomly sampling social group data, 1 million social group name sample data are obtained; by sampling individual business data, 1 million individual business name sample data are obtained; that is, the third subject name sample data includes 1 million social group name sample data and 1 million individual business name sample data.
[0047] For example, it is assumed that the data available from the open market channels include about 100 million pieces of industrial and commercial enterprise data, 8 million pieces of social group data, 100 million pieces of individual industrial and commercial data, and about 4 million pieces of public offerings, private placements, trusts and other financial product data, that is, the multiple categories of original subject name data include 8 million pieces of social group data, 100 million pieces of individual industrial and commercial data, more than 100 million pieces of industrial and commercial enterprise data, and 4 million pieces of financial product data. Based on this, the sampled industrial and commercial enterprise name sample data (i.e., the second subject name sample data) has a data volume of 2 million pieces, the social group name sample data (third subject name sample data) has a data volume of 1 million pieces, the individual industrial and commercial name sample data (third subject name sample data) has a data volume of 1 million pieces; the financial product name sample data (first subject name sample data) has a data volume of 4 million pieces. Among them, the social group data such as hospitals, schools, and government agencies are randomly sampled by region, forming a total of 1 million pieces of social group name sample data. The individual industrial and commercial data were randomly sampled by region, and a total of 1 million individual industrial and commercial name sample data were formed. The public offering, private placement, trust and other financial product data that can be obtained through all public channels were used as learning samples, and about 4 million financial product name sample data were obtained. By identifying the group factions of the industrial and commercial enterprise data, the industrial and commercial enterprise names corresponding to each vertex in each group faction were used as the second subject name sample data. Finally, 4 million pieces of company enterprise data (i.e., the second subject name sample data and the third subject name sample data) and financial product data (i.e., the first subject name sample data) were obtained. Under the premise that the amount of model training data can be controlled, it can also ensure that the sample data has sufficient coverage in feature distribution, thereby ensuring the training effect of the subsequent model.
[0048] S102: Clean the subject name sample data set to obtain a subject name standard data set.
[0049] Data cleaning of the subject name sample data set may include but is not limited to at least one of data deduplication, data null removal, unified encoding, removal of special characters, unification of full-width and half-width, and unification of traditional and simplified Chinese, thereby obtaining a subject name standard data set.
[0050] Specifically, data deduplication can be performed by using a term frequency-inverse document frequency (Tf-idf) algorithm to calculate the similarity of subject name samples in the subject name sample data set, and by setting a similarity threshold, deduplication of subject name samples that reach or exceed the similarity threshold is performed, and only one is retained. By removing duplicate or highly similar samples from the subject name sample data set, overfitting during model training can be avoided.
[0051] Specifically, data removal can be to clear missing values in the subject name sample data set and delete empty value samples in the subject nominal sample data set.
[0052] Specifically, the unified encoding may be to encode the subject name samples in the subject name sample data set using a preset encoding format. The preset encoding format may be UTF-8, ASCII, Unicode, GBK, etc. If the subject name samples in the subject name sample data set are mainly in Chinese, the preset encoding format may be GBK or Unicode encoding.
[0053] Specifically, special characters are non-standard characters that interfere with the analysis of subject name samples or model training, such as punctuation marks, emoticons, HTML tags, and disordered symbols. It should be noted that since the symbols that appear frequently in the subject name samples need to be retained, the symbols that appear frequently can include "()", "-", "《》", "【】" and "{}", and the brackets are uniformly replaced with parentheses. To remove special characters, the regular expression method can be used to match, replace, and delete the subject name samples in the subject name sample dataset.
[0054] Specifically, the unification of full-width and half-width characters is to convert the half-width characters of the subject name samples in the subject name sample data set into full-width characters. Characters with the same meaning are converted into full-width or half-width characters to avoid the irregularity of the subject name samples. For example, they are uniformly converted into full-width characters.
[0055] Specifically, unifying traditional and simplified Chinese means converting traditional Chinese characters in the subject name samples in the subject name sample data set into simplified Chinese characters, so as to avoid generating two sets of names in simplified and traditional Chinese due to different registration places of subject name samples.
[0056] S103: Perform word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list.
[0057] The initial subject name vocabulary list may include a vocabulary list of subject names in each type of subject name standard data.
[0058] The subject names in each category of the subject name standard data in the subject name standard data set are segmented to obtain a vocabulary list corresponding to each subject name, and then, based on the vocabulary list corresponding to each subject name, an initial subject name vocabulary list is obtained. For example, if the financial product name sample data includes the first fund, then the vocabulary list of the first fund includes "first" and "fund"; if the social group product name sample data includes the second college, then the word list of the second college includes "second" and "college". Based on this, the initial subject name word list includes the word list of the first fund corresponding to the financial product name sample data and the word list of the second college corresponding to the social group product name sample data.
[0059] In one embodiment, the segmentation process of the subject name standard data set to obtain an initial subject name vocabulary list includes:
[0060] constructing a dictionary based on the subject name standard dataset;
[0061] Constructing a directed acyclic graph of each subject name standard data based on the dictionary;
[0062] Performing path search on each directed acyclic graph based on a dynamic programming algorithm to obtain a target path corresponding to each directed acyclic graph, wherein the target path represents a path with the maximum cumulative probability of connection between characters in the subject name standard data;
[0063] Based on the target path corresponding to each directed acyclic graph, an initial subject name vocabulary list corresponding to each subject name standard data is obtained.
[0064] Among them, the directed acyclic graph is the implicit state transfer in the hidden Markov model, which means that the transition between states satisfies the Markov property, that is, each state only depends on the previous state.
[0065] A term frequency-inverse document frequency (TF-IDF) algorithm can be used to construct a dictionary for the subject name standard data set. Specifically, the term frequency of each word in the subject name standard data set is counted by the TF-IDF algorithm, and then each word is sorted by a term ranking algorithm (such as the WordRank algorithm) to obtain a dictionary. The dictionary can be a word prefix dictionary. The word prefix dictionary can be used to construct a directed acyclic graph of each subject name standard data. Specifically, each character in the subject name in each subject name standard data is used as a node, and the edges between the nodes represent the connection probability between characters. Based on the dynamic programming algorithm, starting from the first node in the directed acyclic graph corresponding to the subject name standard data, the nodes in the directed acyclic graph are gradually moved. For each node, all possible word lengths are tried, and the optimal path to the end of the word (that is, the path with the maximum cumulative connection probability between characters) is calculated to obtain the target path. Based on the target path, the corresponding initial subject name vocabulary list is obtained.
[0066] In this embodiment, a prefix dictionary is first used to process known words, and then a hidden Markov model and a dynamic programming algorithm are applied to identify unregistered words in the standard data of each subject name. When faced with ambiguous and unregistered words, the uncertainty and diversity of the vocabulary can be effectively handled through the directed acyclic graph based on the hidden Markov model and the target path found by the dynamic programming algorithm, which is conducive to improving the accuracy of word segmentation.
[0067] S104: performing cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list.
[0068] Specifically, the target subject name vocabulary list is obtained by identifying the cross keywords of the initial subject name vocabulary list and eliminating the cross keywords of the initial subject name vocabulary list.
[0069] In one embodiment, the initial subject name vocabulary list is subjected to cross-keyword elimination processing to obtain a target subject name vocabulary list, including:
[0070] Performing cross-keyword recognition on each type of initial subject name vocabulary list in the initial subject name vocabulary list to obtain a cross-keyword set;
[0071] Each type of initial subject name vocabulary list is updated based on the cross keyword set to obtain the target subject name vocabulary list.
[0072] Based on the graph sorting algorithm, cross-keyword recognition can be performed on each category of the initial subject name vocabulary list in the initial subject name vocabulary list, and the weighted keywords (i.e., cross-keywords) of each category can be identified to obtain a cross-keyword set. Then, each initial subject name vocabulary list is traversed, searched, and replaced in a Map-Reduce manner, and the cross-keywords in each category of the initial subject name vocabulary list are eliminated to obtain the target subject name vocabulary list. For example, the cross-keyword set of each category of the initial subject key vocabulary list corresponding to the enterprise subject data and the financial product data includes "management", "center", "international", "shares", "exhibition", "Shanghai", "China", etc. The features of the cross-keywords in the two categories are very prominent, which will affect the classification effect of the subject name classification model. Therefore, after removing the cross-keywords, classification training is performed through the keywords unique to each category, which is conducive to improving the classification accuracy of the subject classification model obtained in the end for the subject name to be classified. Before training the classification model, an algorithm based on keyword and text topic extraction is adopted, and the cross-interference factors of the feature vector are reduced by comparing and eliminating the cross-keywords, and the features of the embedding vector with obvious classification features are amplified, which improves the training effect of the classification model.
[0073] Optionally, updating each type of initial subject name vocabulary list based on the cross keyword set to obtain the target subject name vocabulary list includes:
[0074] In response to a confirmation operation on a cross-keyword set, the words corresponding to the confirmation operation are removed from the cross-keyword set; then, the cross-keyword set that excludes the words corresponding to the confirmation operation is used to perform traversal search and replacement based on the Map-Reduce model to remove the cross-keywords in each category of the initial subject name vocabulary list. For example, if the initial subject name vocabulary list is a vocabulary list corresponding to the corporate subject name, then the words corresponding to the confirmation operation may be "company", "limited company", "enterprise", etc. For another example, if the initial subject name vocabulary list is a vocabulary list corresponding to the financial product name, then the words corresponding to the confirmation operation may be "product", "plan", "financial management", etc. The Map-Reduce model is a programming model and processing framework for processing parallel computing of large-scale data sets. In the present application, the Map-Reduce model is used to perform traversal search and replacement on the initial subject name vocabulary list to remove the cross-keywords in each category of the initial subject name vocabulary list.
[0075] In one embodiment, the cross-keyword recognition is performed on each type of the initial subject name vocabulary list in the initial subject name vocabulary list to obtain a cross-keyword set, including:
[0076] Construct a word graph of the vocabulary list of each type of initial subject name;
[0077] Determining a keyword set of the word graph based on the word graph and a preset iteration formula corresponding to the word graph;
[0078] All keyword sets are cross-compared to obtain the cross keyword set.
[0079] The keyword set includes keywords of each type of initial subject name vocabulary list and the weight of the keyword.
[0080] Each word in each category of the initial subject name vocabulary list can be used as a node in the word graph, and the similarity between words can be calculated based on a similarity algorithm (such as cosine similarity), and the word co-occurrence window can be used to determine whether the words are adjacent to each other. If two words are adjacent, an edge with similarity as weight is established between the two words, thereby obtaining a word graph corresponding to each category of the initial subject name vocabulary list. The score of each node in each word graph is calculated based on the word graph and the preset iteration formula corresponding to the word graph, and the score of each node in each word graph is sorted, so that the keyword set of each word graph can be obtained. Finally, all keyword sets are cross-compared to find a preset number of keywords with the largest weights as the cross keyword set.
[0081] The TextRank score of each word is iteratively calculated using the preset iterative formula corresponding to the word graph. This iterative calculation process is similar to the PageRank algorithm, and the score of each word is based on the weighted sum of the scores of its neighboring nodes. The preset iterative formula is as follows:
[0082]
[0083] in, is the target score of the current word v (the score indicates the importance of the word), d is the damping coefficient (usually set to 0.85), N is the total number of nodes in the word graph, M(v) is the set of nodes connected to the current word v, represents the weight between the current word v and the previous word u of the current word v, C(u) is the number of nodes connected to u, is the target score of the previous word u of the current word v.
[0084] In one embodiment, determining the keyword set of the word graph based on the word graph and a preset iteration formula corresponding to the word graph includes:
[0085] constructing an adjacency matrix according to the word graph;
[0086] Normalizing the adjacency matrix to obtain a graph network structure of a random walk model;
[0087] Initializing an initial score for each word in the initial subject name vocabulary list;
[0088] Iteratively calculating the initial score of each word in the initial subject name vocabulary list based on the preset iteration formula, the graph network structure and the initial score of each word until the iteration stop condition is met, thereby obtaining the target score of each word in the initial subject name vocabulary list;
[0089] Sort each of the words based on the target score of each of the words to obtain a word sequence;
[0090] Based on the word sequence, a keyword set of the word graph is determined.
[0091] An adjacency matrix is constructed according to the word graph, and the elements in the adjacency matrix represent the similarity between nodes (words); the adjacency matrix is normalized, and the sum of each row in the adjacency matrix is 1. Based on this, a graph network structure of a random walk model (i.e., a normalized graph) can be obtained. The normalized graph network structure combines the characteristics of random walks and can better capture the structural information of the word graph. A node sequence (i.e., a word sequence) can be generated by random walks. By initializing the initial score of each word, an initial score is complex-valued for each word, and the initial score can be a word frequency, a custom value, etc.; a random walk is performed based on the graph network structure of the random walk model through a preset iterative formula, thereby iteratively updating the initial score of each word in each category of the initial subject name vocabulary list, until the number of iterations meets the preset iteration number threshold or the initial score obtained by iterative calculation is lower than the preset score threshold, thereby obtaining a target score for each word; each word is sorted based on the target score of each word to obtain a word sequence, thereby determining a keyword set of the word graph according to the word sequence. For example, if the word sequence is sorted from large to small according to the target score, the first K words can be selected as the keyword set.
[0092] S105: Extract the embedded features of each target subject name vocabulary in the target subject name vocabulary list to obtain an embedded feature set.
[0093] The embedding features of each target subject name vocabulary in the target subject name vocabulary can be extracted based on the following formula:
[0094]
[0095] in, is the embedding feature of the target subject name vocabulary t, d is the target subject name vocabulary list, D is the target subject name vocabulary list belonging to the same category as the target subject name vocabulary list, It represents the ratio of the number of times the target subject name word t appears in the target subject name word list to the total number of all words in the target subject name word list, is the derivative of the inverse document frequency, is the position function.
[0096] Among them, some core keywords often appear in multiple similar subject names, such as company, investment, shares, products, etc., and these keywords often play a decisive role in classification, so these keywords often have more obvious representation ability. Therefore, the IDF formula can be optimized and the inverse can be taken, that is, The calculation formula is as follows:
[0097]
[0098] The subject names are all nouns. For nouns, the later the phrase is, the more it can represent the nature and type of the name. For example, "XXXX Technology (Shenzhen) Co., Ltd.", after word segmentation: [XX, XX, Technology, Shenzhen, Co., Ltd.", "Co., Ltd." is obviously stronger than the previous phrase in representing the type of corporate subject. Therefore, position encoding enhancement can be added to the embedding vector of the name, and a position function can be introduced. The position function satisfies that the later the position is, the larger the generated value is, that is, it is monotonically increasing. Functions such as sigmoid, square, sin, etc. can be used. The position function of this application uses the sin function. The calculation formula of the position function is as follows:
[0099]
[0100] This embodiment makes further improvements and enhancements based on the TfIdf vectorization model. By performing inverse calculation on IDF and introducing a weight function based on word position, the RP_TfIdf vectorization model is formed, which better characterizes the numerical characteristics of the subject name for the subject type and further improves the effect of subsequent model training.
[0101] S106: Using a preset integrated model framework, training is performed based on the embedded feature set to obtain a subject name classification model.
[0102] Combining the Bayesian model of prior features and the machine learning model of hidden features to form a Stacking integrated model framework is conducive to further improving the classification accuracy of the model.
[0103] Specifically, the preset integrated model framework is trained by the labeled embedded feature set to obtain the subject name classification model. The trained subject name classification model is used to classify the subject names to be classified to obtain the categories of the subject names to be classified, such as financial products, individual enterprises, industrial and commercial enterprises or social groups.
[0104] Since the name classification problem draws heavily on prior data and experience and conforms to the prior feature distribution, the use of primary classifiers (such as Bayes, XGB, MLP, and LR, etc.) to summarize and learn the embedded feature sets corresponding to common subject data (i.e., multi-class original subject name data) can better simulate the pattern of manual recognition, which belongs to a generative model. In addition, due to the non-standard nature of subject names and the limitations of prior training samples, after the subject names are mapped to high-dimensional space through text embedding, there may be high-dimensional hidden features that conform to a specific distribution. Therefore, deep neural networks, XGBoost, and logistic regression models can be used as supplementary models (i.e., meta-model classifiers) for secondary splitting, which belongs to a discriminative model. Based on this, the Stacking integrated model framework can be used as the preset integrated model framework. That is, the preset integrated model framework includes a generative model (i.e., a base model) and a supplementary model (i.e., a meta-model). The preset integrated model framework is trained based on the embedded feature set to obtain a subject name classification model, including:
[0105] Dividing the embedded feature set into a training set and a validation set;
[0106] Performing multi-fold cross-training on the base model based on the training set to obtain a trained base model;
[0107] Classify the trained base model based on the verification set to obtain a classification result;
[0108] generating a new training set based on the classification result and the training set;
[0109] Training the meta-model based on the new training set to obtain a trained meta-model;
[0110] The subject name classification model is obtained according to the trained base model and the trained meta-model.
[0111] Exemplarily, the embedded feature set is divided into a training set and a validation set, such as Figure 3 As shown in the figure, the training set is first cross-trained with the base model, and then the validation set is classified with the trained base model, and the classification result is output. The classification result and the training set are then constructed into new variables, and the meta-model (such as a neural network) is used for secondary classification to output the final classification result. The base model and meta-model are then verified with the validation set. After the verification is passed, the subject name splitting model is obtained. The base model can be a Bayesian model, an XGBoost model, a neural network model, a logistic regression model, etc.
[0112] The subject name classification model combines the advantages of generative models and discriminative models, which can significantly improve the accuracy and generalization ability of the overall model; it can integrate various types of models, including linear models, nonlinear models, tree models, etc., to capture different features; it can automatically combine the advantages of different models to improve model performance; the training process of the subject name classification model can also be combined with cross-validation to effectively avoid overfitting problems.
[0113] Optionally, after training the ensemble model framework with the full set of embedding features to obtain the subject name splitting model, you can make an out-of-model adjustment:
[0114] By summarizing basic business rules with strong generalization ability, an off-model rule base is formed, and the embedded feature set is run in batches to form a rule-based classification result. The off-model rule base includes string processing algorithm rules and regular expression matching rules. Among them, the string processing algorithm rules use high-performance text search algorithms (such as KMP) to process strings and form corresponding judgment rules. For example, the subject name is judged according to special word suffixes. The enterprise subject usually ends with company, limited company, limited liability company, government, hospital, bank, university, primary school, middle school, etc., and the product subject usually ends with combination, product, plan, trust, contract. Regular expression matching rules use regular expression matching algorithms to classify names that meet unique patterns, such as matching bonds (\d{2}[\u4e00-\u9fa5]+[a-zA-Z0-9()\[\]]+), stocks ([a-zA-Z0-9]+) and other code names. After the rule base is formed, the prediction subject name data is scanned and processed in batches through the Map-Reduce method to form the classification results of the model's external rules (i.e., rule-based).
[0115] , combined with the classification results of secondary classification based on the meta-model and the classification results based on rules, the predicted data (i.e., embedded feature set) is cross-compared, and application suggestions for the results are formed. Since the output of the prediction results based on the artificial intelligence model mainly include: classification label, confidence (classification probability). The output of the result after rule-based prediction mainly includes: classification label. Therefore, the application suggestions for the output results after cross-validation are:
[0116] Subjects whose prediction confidence (classification probability) of the identification model is lower than the preset threshold are marked as subjects requiring manual verification.
[0117] Identify subjects whose model prediction labels are inconsistent with rule prediction labels, mark them as suspicious subjects, and require manual verification.
[0118] The final application suggestions are shown in Table 1, where FALSE means no and TRUE means yes.
[0119]
[0120] Table 1
[0121] Please refer to Figure 4 as shown Figure 4 Figure 4 This is a flowchart of the subject name classification method provided by an embodiment of the present invention. This method can be applied to both terminals and servers. In this embodiment, an example of applying it to the server is given. The subject name classification method includes the following steps: S201: Obtain the subject name to be classified.
[0122] The subject name to be classified can be the subject name of industrial and commercial enterprises, individual enterprises, financial products, social organizations, etc. For example: XX Co., Ltd.
[0123] S202: Perform data cleaning on the subject name to be classified to obtain a standard subject name.
[0124] Performing data cleaning on the subject name to be classified may include but is not limited to at least one of data deduplication, data emptying, unified coding, removal of special characters, unified full-width and half-width, and unified traditional and simplified Chinese, so as to obtain a standard subject name.
[0125] S203: Perform word segmentation on the standard subject name to obtain an initial vocabulary list.
[0126] Perform word segmentation on the standard subject name to obtain an initial vocabulary list. For example, performing word segmentation on "First Normal University" to obtain the initial vocabulary list "First Normal University".
[0127] S204: Perform cross-keyword elimination processing on the initial vocabulary list to obtain a target vocabulary list.
[0128] That is, eliminate the cross-keywords in the initial vocabulary list. For example, eliminate "First" in "First Normal University" to obtain the target vocabulary list "Normal University".
[0129] S205: Extract the embedding features of the target vocabulary list.
[0130] The embedding features of each target vocabulary in the target vocabulary list can be extracted based on the following formula:
[0131]
[0132] where is the embedding feature of the target vocabulary t, d is the target vocabulary list, D is the list of all target subject name vocabularies belonging to the same class as this target vocabulary list, represents the ratio of the number of times the target vocabulary t appears in the target vocabulary list to the total number of all target vocabularies in the target vocabulary list, is the derivative of the inverse document frequency, is the position function.
[0133] S206: Classify the embedded features based on the subject name classification model of any of the above subject name classification model training methods to obtain the subject category of the subject name to be classified.
[0134] In this embodiment, data cleaning is performed on the subject names to be classified to improve data quality, and then word segmentation and deduplication are performed to reduce redundancy in the data. The embedded features are classified based on the subject name classification model described in any of the above-mentioned subject model training methods to obtain the subject category of the subject name to be classified, which can effectively and accurately classify the subject names to be classified, thereby facilitating data management and analysis in risk management, compliance management, business development and customer acquisition, data governance and other aspects.
[0135] The above is the subject name classification and model training process of this application.
[0136] As described above, the present application provides a subject name classification and model training method, apparatus, computer equipment and storage medium thereof, wherein a subject name sample data set is obtained by sampling multiple categories of original subject name data, wherein the number of subject name sample data of each category in the subject name sample data set is balanced; data cleaning is performed on the subject name sample data set to obtain a subject name standard data set; word segmentation is performed on the subject name standard data set to obtain an initial subject name vocabulary list; cross-keyword elimination is performed on the initial subject name vocabulary list to obtain a target subject name vocabulary list; embedded features of each target subject name vocabulary in the target subject name vocabulary list are extracted to obtain an embedded feature set; training is performed based on the embedded feature set using a preset integrated model framework to obtain a subject name classification model. In the subject name classification and model training scheme provided in the present application, a subject name sample data set is obtained by sampling, and the number of subject name sample data of each type is ensured to be balanced. Then, the subject name sample data is cleaned to improve the data quality. Then, word segmentation and deduplication are performed to reduce redundancy in the data, which is beneficial to improving data consistency and the generalization ability of the model. Finally, training is performed based on the embedded feature set with a preset integrated model framework, which can effectively improve the accuracy of the subject name classification model and greatly improve the stability, accuracy and robustness of the classification results, thereby facilitating data management and analysis in risk management, compliance management, business development and customer acquisition, data governance and other aspects.
[0137] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean 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 embodiment of the present invention.
[0138] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server through a network connection. When the computer program is executed by the processor, it realizes the functions or steps of a subject name classification and its model training method.
[0139] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0140] Sampling multiple categories of original subject name data to obtain a subject name sample data set, in which the number of subject name sample data of each category is balanced; performing data cleaning on the subject name sample data set to obtain a subject name standard data set; performing word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list; performing cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list; extracting the embedded features of each target subject name vocabulary in the target subject name vocabulary list to obtain an embedded feature set; and training based on the embedded feature set using a preset integrated model framework to obtain a subject name classification model.
[0141] In an embodiment, a subject name sample data set is obtained by sampling, and the number of subject name sample data of each type is ensured to be balanced. Then, the subject name sample data is cleaned to improve data quality. Then, word segmentation and deduplication are performed to reduce redundancy in the data, which is beneficial to improving data consistency and the generalization ability of the model. Finally, training is performed based on the embedded feature set using a preset integrated model framework, which can effectively improve the accuracy of the subject name classification model, thereby facilitating data management and analysis in risk management, compliance management, business development and customer acquisition, data governance, etc.
[0142] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0143] Sampling multiple categories of original subject name data to obtain a subject name sample data set, in which the number of subject name sample data of each category is balanced; performing data cleaning on the subject name sample data set to obtain a subject name standard data set; performing word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list; performing cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list; extracting the embedded features of each target subject name vocabulary in the target subject name vocabulary list to obtain an embedded feature set; and training based on the embedded feature set using a preset integrated model framework to obtain a subject name classification model.
[0144] In an embodiment, a subject name sample data set is obtained by sampling, and the number of subject name sample data of each type is ensured to be balanced. Then, the subject name sample data is cleaned to improve data quality. Then, word segmentation and deduplication are performed to reduce redundancy in the data, which is beneficial to improving data consistency and the generalization ability of the model. Finally, training is performed based on the embedded feature set using a preset integrated model framework, which can effectively improve the accuracy of the subject name classification model, thereby facilitating data management and analysis in risk management, compliance management, business development and customer acquisition, data governance, etc.
[0145] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0146] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0147] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0148] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for training a subject name classification model, characterized in that: The method comprises: Sampling multiple categories of original subject name data to obtain a subject name sample data set, wherein the number of subject name sample data of each category in the subject name sample data set is balanced; Performing data cleaning on the subject name sample data set to obtain a subject name standard data set; Performing word segmentation processing on the subject name standard data set to obtain an initial subject name vocabulary list, including: constructing a dictionary based on the subject name standard data set; constructing a directed acyclic graph of each subject name standard data based on the dictionary; performing path search on each directed acyclic graph based on a dynamic programming algorithm to obtain a target path corresponding to each directed acyclic graph, wherein the target path represents a path with the maximum cumulative probability of connection between characters in the subject name standard data; and obtaining an initial subject name vocabulary list corresponding to each subject name standard data based on the target path corresponding to each directed acyclic graph; Performing cross-keyword elimination processing on the initial subject name vocabulary list to obtain a target subject name vocabulary list; Based on a preset formula, the embedding features of each target subject name vocabulary in the target subject name vocabulary list are extracted to obtain an embedding feature set. The preset formula is expressed as: in, is the embedding feature of the target subject name vocabulary t, d is the target subject name vocabulary list, D is the target subject name vocabulary list belonging to the same category as the target subject name vocabulary list, It represents the ratio of the number of times the target subject name word t appears in the target subject name word list to the total number of all words in the target subject name word list, is the derivative of the inverse document frequency, is the position function; The calculation formula is as follows: The calculation formula of the position function is as follows: Using a preset integrated model framework, training is performed based on the embedded feature set to obtain a subject name classification model. The preset integrated model framework includes a base model and a meta-model, including: dividing the embedded feature set into a training set and a verification set; performing multi-fold cross-training on the base model based on the training set to obtain a trained base model; classifying the trained base model based on the verification set to obtain a classification result; generating a new training set based on the classification result and the training set; training the meta-model based on the new training set to obtain a trained meta-model; and obtaining the subject name classification model based on the trained base model and the trained meta-model.
2. The subject name classification model training method according to claim 1 is characterized in that: The sampling of multiple types of original subject name data to obtain a subject name sample data set includes: Performing first subject name sampling on the multiple categories of original subject name data to obtain first subject name sample data; Performing group faction identification on the multiple types of original subject name data to obtain multiple group factions, and performing second subject name sampling on the original subject name data corresponding to each of the group faction vertices to obtain second subject name sample data; Performing third subject name sampling on the multiple categories of original subject name data to obtain third subject name sample data; Obtaining subject name sample data according to the first subject name sample data, the second subject name sample data and the third subject name sample data; The number of the second subject name sample data and the third subject name sample data is consistent with the number of the first subject name sample data.
3. The subject name classification model training method according to claim 1 is characterized in that: The cross-keyword elimination process is performed on the initial subject name vocabulary list to obtain a target subject name vocabulary list, including: Performing cross-keyword recognition on each type of initial subject name vocabulary list in the initial subject name vocabulary list to obtain a cross-keyword set; Each type of initial subject name vocabulary list is updated based on the cross keyword set to obtain the target subject name vocabulary list.
4. The subject name classification model training method according to claim 3 is characterized in that: The cross-keyword recognition is performed on each type of the initial subject name vocabulary list in the initial subject name vocabulary list to obtain a cross-keyword set, including: Construct a word graph of the vocabulary list of each type of initial subject name; Determining a keyword set of the word graph based on the word graph and a preset iteration formula corresponding to the word graph; All keyword sets are cross-compared to obtain the cross keyword set.
5. The subject name classification model training method according to claim 4 is characterized in that: The determining of the keyword set of the word graph based on the word graph and a preset iteration formula corresponding to the word graph includes: constructing an adjacency matrix according to the word graph; Normalizing the adjacency matrix to obtain a graph network structure of a random walk model; Initializing an initial score for each word in the initial subject name vocabulary list; Iteratively calculate the initial score of each word in the initial subject name vocabulary list based on the preset iteration formula, the graph network structure and the initial score of each word until the iteration stop condition is met, and obtain the target score of each word in the initial subject name vocabulary list; Sort each of the words based on the target score of each of the words to obtain a word sequence; Based on the word sequence, a keyword set of the word graph is determined.
6. A method for classifying subject names, characterized in that: include: Get the name of the subject to be classified; Performing data cleaning on the subject name to be classified to obtain a standard subject name; Performing word segmentation processing on the standard subject name to obtain an initial vocabulary list; Performing cross-keyword elimination processing on the initial vocabulary list to obtain a target vocabulary list; extracting embedding features of the target vocabulary list; The embedded features are classified based on the subject name classification model described in any one of claims 1 to 5 to obtain the subject category of the subject name to be classified.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the subject name classification model training method as described in any one of claims 1 to 5 and / or implements the steps of the subject name classification method as described in claim 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the subject name classification model training method as described in any one of claims 1 to 5 and / or implements the steps of the subject name classification method as described in claim 6.
Citation Information
Patent Citations
Customer classification method and device, computer equipment and storage medium
CN115239355A
Hotspot data acquisition method and device, equipment and storage medium
CN118643242A