A training method and apparatus for an industry label classification model
By using an industry label classification model and employing the TextCNN model to clean and train the business scope of enterprises, the problem of complex and costly industry label classification for enterprises is solved, achieving efficient and low-cost automatic classification of industry labels.
Patent Information
- Application Number
- CN202310567118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-05-19
AI Technical Summary
Industry-specific labeling for businesses is complex and costly, manual classification is not accurate enough, and it is difficult to handle business scopes that are described inappropriately.
An industry-label classification model is adopted. By selecting neighboring industry labels, the business scope samples of enterprises are cleaned, preprocessed, segmented, and strict and non-strict stop word texts are generated to produce word vector samples. The TextCNN model is then used for training and parameter tuning.
It improves industry classification efficiency, reduces labor costs, achieves efficient classification of reasonable samples, and reduces the need for manual intervention.
Smart Images

Figure CN116881447B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and more specifically, to a training method and apparatus for an industry label classification model. Background Technology
[0002] Because the description of a company's business scope is quite complex and often includes many different industry-related terms, and the number of industry types is relatively large, industry label classification is a complex task that requires a lot of manpower.
[0003] Currently, while manual classification can effectively complete industry categorization, it is costly and still suffers from inaccuracies. For business scopes with unreasonable descriptions, such as those containing numerous keywords from different related industries, even manual classification struggles to determine the corresponding industry. Therefore, more efficient methods are needed for industry classification. Summary of the Invention
[0004] In view of the above problems, the present invention provides a training method and apparatus for an industry label classification model, which can realize automatic classification of adjacent industry types based on reasonable samples, effectively improving the efficiency of industry classification.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a training method for an industry label classification model, comprising the following steps: selecting neighboring industry labels, obtaining samples of the business scope of the industry labels, and cleaning them; preprocessing the cleaned samples to obtain sample statement files, wherein the sample statement files correspond to the industry labels; segmenting the sample statement files to generate sample files; establishing strict and non-strict stop word texts, and using the strict and non-strict stop word texts to filter the sample files; generating a dictionary based on the filtered sample files, and generating word vector samples based on the dictionary; establishing a TextCNN model for industry label classification, and setting the model structure; loading the word vector samples into the TextCNN model, and adjusting the model parameters and sample cleaning strategies according to the model training effect.
[0006] As a preferred solution, the sample of the business scope of the enterprise is cleaned, including: selecting the parent label of the label corresponding to the sample to be cleaned according to the national standard for industry classification, and determining the sample group, which includes samples from different industries that are close to each other; determining the label keywords corresponding to the samples in the sample group; reading the sample to be cleaned one by one, and if the sample to be cleaned contains the label keyword corresponding to the sample to be cleaned and does not contain other label keywords, then the sample to be cleaned is retained; otherwise, the sample to be cleaned is deleted.
[0007] As a preferred approach, determining the corresponding tag keywords for the samples in the sample group includes: finding the tag set corresponding to the sample group in the national standard for industry classification, splitting the Chinese description of the industry corresponding to each tag, and extracting words that can accurately describe the industry characteristics as sample keywords.
[0008] As a preferred embodiment, the preprocessing of the cleaned samples includes: storing Word documents of samples with the same label in a folder, corresponding to a label type; when generating the input file, cleaning the punctuation marks of the original samples, generating sample sentences, and establishing a sample sentence file.
[0009] As a preferred embodiment, the establishment of strict and non-strict stop word texts includes: i) taking words that appear in all samples corresponding to each label as strict stop word texts; ii) taking invalid words that appear in different samples in proportion greater than N and have no distinguishing effect as non-strict stop word texts, based on the requirements of industry classification and the characteristics of business scope description.
[0010] As a preferred embodiment, the setting of the model structure specifically involves: setting the convolution kernel parameters of the TextCNN model, and defining convolutional layers, pooling layers, and fully connected layers.
[0011] As a preferred embodiment, the sample cleaning strategy includes: based on the model training results, identifying samples corresponding to labels whose accuracy and recall are lower than a set threshold, analyzing the number of samples and the rationality of sample descriptions, identifying unreasonable samples, and adjusting them to improve the model training effect.
[0012] As a preferred embodiment, the step of generating a dictionary based on the selected sample files and generating word vector samples based on the dictionary includes: using all sample files as a dictionary and converting Chinese words into word vectors using a word vector conversion tool.
[0013] This invention also provides a training device for an industry label classification model, comprising: a sample cleaning module for selecting neighboring industry labels, obtaining samples of the business scope of the industry labels, and cleaning them; a preprocessing module for preprocessing the cleaned samples to obtain sample statement files, wherein the sample statement files correspond to the industry labels; a word segmentation module for segmenting the sample statement files to generate sample files; a filtering module for establishing strict and non-strict stop word texts and filtering the sample files using the strict and non-strict stop word texts; a word vector module for generating a dictionary based on the filtered sample files and generating word vector samples based on the dictionary; a model building module for building a TextCNN model for industry label classification and setting the model structure; and a training module for loading the word vector samples into the TextCNN model and adjusting the model parameters and sample cleaning strategies according to the model training effect.
[0014] Compared with existing technologies, the beneficial effects of this invention include: Based on deep learning, it combines the intelligent characteristics of deep learning models with the supplementary role of human experience in improving model training performance. Keywords are extracted with reference to national industry classification standards; samples are cleaned using the keywords of this tag and other tags at the same level; and non-strictly defined stop words are identified through human experience to further clean the samples, ensuring they meet basic reasonable requirements. The cleaned samples are then used to train the TextCNN model, enabling the model to efficiently classify industry tags for samples that meet these requirements. The model's requirement for reasonable input values (i.e., descriptions of the company's business scope) for industry tag classification makes the classification problem theoretically solvable. Using a model for classification significantly improves industry classification efficiency, reduces labor costs, and is easier to implement in actual production. Attached Figure Description
[0015] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. In the drawings, the same reference numerals are used to refer to the same parts. Wherein:
[0016] Figure 1 This is a schematic diagram of the training method for the industry label classification model according to an embodiment of the present invention;
[0017] Figure 2 This is another flowchart illustrating the training method for the industry label classification model according to an embodiment of the present invention;
[0018] Figure 3 This is a schematic diagram showing the distribution of keywords in the sample group of an embodiment of the present invention;
[0019] Figure 4This is a schematic diagram illustrating the process of deleting unreasonable samples based on keywords in an embodiment of the present invention;
[0020] Figure 5 This is a schematic diagram of the preprocessing flow according to an embodiment of the present invention;
[0021] Figure 6 This is a schematic diagram illustrating strictly prohibited and non-strictly prohibited words in an embodiment of the present invention;
[0022] Figure 7 This is a schematic diagram illustrating the model training effect in an embodiment of the present invention;
[0023] Figure 8 This is a schematic diagram of the structure of the training device for the industry label classification model according to an embodiment of the present invention. Detailed Implementation
[0024] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.
[0025] According to one embodiment of the present invention, Figure 1 and 2 The following is illustrated: A training method for an industry label classification model, comprising the following steps:
[0026] S101. Select a nearby industry label, obtain a sample of the business scope of the enterprise under the industry label, and clean it to make the sample meet reasonable requirements.
[0027] See Figure 3 and 4 The above-mentioned cleaning of enterprise business scope samples includes: selecting the parent label of the label corresponding to the sample to be cleaned according to the national standard for industry classification, determining the sample group, which includes samples from different industries with similar characteristics; determining the label keywords of the samples in the sample group; reading the sample to be cleaned one by one, if the sample to be cleaned contains the label keyword corresponding to the sample to be cleaned and does not contain other label keywords, then the sample to be cleaned is retained; otherwise, the sample to be cleaned is deleted.
[0028] In this embodiment of the invention, determining the sample keywords in the sample group includes: finding the tag set corresponding to the sample group in the national standard for industry classification, splitting the Chinese description of the industry corresponding to each tag, and extracting words that can accurately describe the industry characteristics as sample keywords.
[0029] For example, to determine the desired label level for the model's industry label classification, such as the 'C171' label, find the industry description in the national standard for industry classification based on the label level. Its corresponding Chinese description is: Cotton textiles and dyeing finishing. Its sibling labels are: 'C172', 'C173', 'C174', 'C175', 'C176', 'C177', and 'C178'. Therefore, samples belonging to the 'C171' label should contain keywords such as 'cotton textiles', 'cotton yarn', and 'cotton manufacturing', but should not contain 'wool textiles' or 'wool tops'.
[0030] Keywords such as 'wool yarn', 'wool weaving', 'wool dyeing and finishing', 'wool spinning technology', 'linen textile', 'linen fiber', 'linen weaving', 'linen dyeing and finishing', 'silk', 'silk textile', 'silk spinning', 'silk weaving', 'chemical fiber', 'knitting', 'crochet', 'towel', 'curtains', and 'canvas' belong to the same level of other tags. From this, we can obtain reasonably descriptive samples that can be theoretically distinguished.
[0031] S102, preprocess the cleaned sample to obtain a sample statement file, which corresponds to the industry label.
[0032] See Figure 5 The cleaned samples undergo preprocessing, including: storing Word documents of samples with the same label in a folder, corresponding to a label type; cleaning punctuation marks from the original samples when generating the input file; generating sample sentences; and creating a sample sentence file.
[0033] S103, perform word segmentation on the sample statement file to generate a sample file.
[0034] Optionally, after word segmentation, the sample sentence file after word segmentation is cleaned a second time. Specifically, the words in the first part of the sample are retained because these words are most relevant to the company's actual business scope. The words in the second part of the sample are not closely related to the company's actual business scope, so they can be deleted.
[0035] S104. Create strict and non-strict stop word texts, and use the strict and non-strict stop word texts to filter the sample files, that is, delete the strict and non-strict stop word texts in the sample files.
[0036] See Figure 6 Establish strict and non-strict stop word texts, including:
[0037] i) Use the words that appear in the samples corresponding to each label as strict stop words;
[0038] ii) Based on industry classification requirements and the characteristics of the business scope description, invalid words that appear in different samples in a proportion greater than N (e.g., N is 50%) and have no obvious distinguishing effect are designated as non-strict stop words. Examples include 'production', 'sales', 'project', 'general', 'processing', 'operation', 'related', 'manufacturing', and 'products'. The selection of these stop words is primarily based on manual reading of samples and experience.
[0039] S105, Generate a dictionary based on the selected sample files, and generate word vector samples based on the dictionary. Specifically, generating word vector samples based on the dictionary includes: using all sample files as a dictionary, and converting Chinese words into word vectors using a word vector conversion tool.
[0040] S106, Build a TextCNN model for industry label classification and set the model structure.
[0041] In this embodiment of the invention, the model structure is set, specifically by configuring the convolutional kernel parameters of the TextCNN model and defining convolutional layers, pooling layers, and fully connected layers. For example, the model is configured with four different sizes of convolutional kernels for text processing, and the output layer uses a multi-classification function to classify samples.
[0042] S107: Load word vector samples into the TextCNN model, and adjust model parameters and sample cleaning strategies based on model training results.
[0043] Specifically, adjusting model parameters includes determining whether to adjust the number of iterations (epochs) based on changes in error during model training, and reducing model training error by increasing the number of iterations.
[0044] The sample cleaning strategy includes: based on the model training results, identifying samples corresponding to labels whose accuracy and recall are below a set threshold; analyzing the sample quantity and the reasonableness of the sample descriptions; identifying unreasonable samples; and adjusting them to improve the model training effect. Unreasonable samples are those with a very small number of samples or unreasonable descriptions.
[0045] In this embodiment of the invention, the sample cleaning strategy is adjusted, and more appropriate keywords are used to improve model performance. For example, under the conditions of a model learning rate of 0.001 and 200 iterations, the model training results are as follows: Figure 7 As shown, for samples with different labels, the accuracy and recall of the training and test sets are close to or above 0.8. Moreover, according to the industry coding, many samples are close to the industry, indicating that the model has a good classification effect.
[0046] See Figure 8The present invention also provides a training device for an industry label classification model, comprising:
[0047] The sample cleaning module 101 is used to select nearby industry labels, obtain samples of the business scope of enterprises under the industry labels, and clean them.
[0048] The preprocessing module 102 is used to preprocess the cleaned sample to obtain a sample statement file, which corresponds to an industry label.
[0049] The word segmentation module 103 is used to segment the sample sentence file into words and generate a sample file.
[0050] The filtering module 104 is used to create strict and non-strict stop word texts, and to filter sample files using the strict and non-strict stop word texts;
[0051] The word vector module 105 is used to generate a dictionary based on the filtered sample files and to generate word vector samples based on the dictionary;
[0052] Model building module 106 builds a TextCNN model for industry label classification and sets the model structure;
[0053] Training module 107 is used to load word vector samples into the TextCNN model, adjust model parameters based on model training performance, and implement sample cleaning strategies.
[0054] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0055] In summary, the beneficial effects of this invention include: based on deep learning, it takes into account both the intelligent characteristics of deep learning models and the supplementary role of human experience in improving model training performance; it extracts keywords with reference to national industry classification standards; it cleans samples using the keywords of this tag and other tags at the same level; and it further cleans samples by using human experience to determine non-strictly defined stop words, ensuring that the samples meet basic reasonable requirements. The cleaned samples are then used to train the TextCNN model, enabling the model to efficiently classify industry tags for samples that meet these basic reasonable requirements. The model's requirement for industry tag classification—that the input value, i.e., the description of the enterprise's business scope, is reasonable—makes the classification problem theoretically solvable. Using a model for classification can significantly improve industry classification efficiency, reduce labor costs, and this solution is easier to implement in actual production.
[0056] It should be understood that if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0057] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.
Claims
1. A training method for an industry label classification model, characterized in that, Includes the following steps: Select nearby industry tags, obtain a sample of the business scope of the enterprises under the industry tags, and clean them. The nearby industry tags are sub-category industry tags that belong to the same parent tag. The cleaned samples are preprocessed to obtain sample statement files, which correspond to industry labels. The sample statement file is segmented into words to generate a sample file; Create strict and non-strict stop word texts, and use the strict and non-strict stop word texts to filter sample files; A dictionary is generated based on the selected sample files, and word vector samples are generated based on the dictionary; Build a TextCNN model for industry label classification and set the model structure; The word vector samples are loaded into the TextCNN model, and the model parameters and sample cleaning strategy are adjusted according to the model training effect. The process of cleaning the sample of business scope of the enterprise includes: selecting the parent label of the label corresponding to the sample to be cleaned according to the national standard of industry classification, and determining the sample group, which includes samples from different industries that are close to each other; determining the label keywords corresponding to the samples in the sample group; reading the sample to be cleaned one by one, and if the sample to be cleaned contains the label keyword corresponding to the sample to be cleaned and does not contain other label keywords, then the sample to be cleaned is retained; otherwise, the sample to be cleaned is deleted. The establishment of strict and non-strict stop word texts includes: i) taking words that appear in all samples corresponding to each label as strict stop word texts; ii) taking invalid words that appear in different samples in proportion greater than N and have no distinguishing effect as non-strict stop word texts, based on the requirements of industry classification and the characteristics of business scope description.
2. The training method for the industry label classification model according to claim 1, characterized in that, Determining the corresponding tag keywords for samples in the sample group includes: finding the tag set corresponding to the sample group in the national standard for industry classification, splitting the Chinese description of the industry corresponding to each tag, and extracting words that can accurately describe the industry characteristics as sample keywords.
3. The training method for the industry label classification model according to claim 1, characterized in that, The preprocessing of the cleaned samples includes: storing Word documents of samples with the same label in a folder, corresponding to a label type; cleaning the punctuation marks of the original samples when generating the input file; generating sample sentences; and creating a sample sentence file.
4. The training method for the industry label classification model according to claim 1, characterized in that, The specific steps for setting the model structure are as follows: setting the convolution kernel parameters of the TextCNN model, and defining convolutional layers, pooling layers, and fully connected layers.
5. The training method for the industry label classification model according to claim 1, characterized in that, The sample cleaning strategy includes: based on the model training results, identifying samples corresponding to labels whose accuracy and recall are lower than a set threshold, analyzing the number of samples and the rationality of sample descriptions, identifying unreasonable samples, and adjusting them to improve the model training effect.
6. The training method for the industry label classification model according to claim 1, characterized in that, The step of generating a dictionary based on the selected sample files and generating word vector samples based on the dictionary includes: using all sample files as a dictionary and using a word vector conversion tool to convert Chinese words into word vectors.
7. A training device for an industry label classification model, characterized in that, include: The sample cleaning module is used to select adjacent industry tags, obtain samples of the business scope of enterprises under the industry tags, and clean them. The adjacent industry tags are sub-category industry tags belonging to the same parent tag. The preprocessing module is used to preprocess the cleaned sample to obtain a sample statement file, which corresponds to an industry label. The word segmentation module is used to segment the sample sentence file into words and generate sample files; The filtering module is used to generate strict and non-strict stop word texts, and to filter sample files using the strict and non-strict stop word texts; The word vector module is used to generate a dictionary based on the filtered sample files, and to generate word vector samples based on the dictionary; The model building module builds a TextCNN model for industry label classification and sets up the model structure. The training module is used to load the word vector samples into the TextCNN model and adjust the model parameters and sample cleaning strategy according to the model training effect. The process of cleaning the sample of the business scope of the enterprise includes: selecting the parent label of the label corresponding to the sample to be cleaned according to the national standard for industry classification, and determining the sample group, which includes samples from different industries that are close to each other; determining the label keywords corresponding to the samples in the sample group; reading the sample to be cleaned one by one, and if the sample to be cleaned contains the label keyword corresponding to the sample to be cleaned and does not contain other label keywords, then the sample to be cleaned is retained; otherwise, the sample to be cleaned is deleted. The establishment of strict and non-strict stop word texts includes: i) taking words that appear in all samples corresponding to each label as strict stop word texts; ii) taking invalid words that appear in different samples in proportion greater than N and have no distinguishing effect as non-strict stop word texts, based on the requirements of industry classification and the characteristics of business scope description.
Citation Information
Patent Citations
Enterprise industry secondary industry multi-label classifier based on deep learning algorithm
CN113407644A
Classification method and device for national standard industry of enterprise, electronic equipment and readable medium
CN113762420A