Training a model, method and apparatus for industry classification of enterprises
By training an industry data extractor and a classification model, and utilizing the feature representation of enterprise basic data to eliminate invalid features, the problem of low accuracy in enterprise industry classification in existing technologies is solved, achieving efficient and accurate enterprise industry classification.
Patent Information
- Application Number
- CN202210620380.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In existing technologies, enterprise industry classification relies on manual statistical analysis, resulting in a heavy workload and low accuracy of classification results.
By training an industry data extractor and an industry classification model, positive sample pairs are constructed using different types of basic data from the same enterprise, and negative sample pairs are constructed using basic data from different enterprises. Feature vectors are calculated and the total representation loss is minimized to eliminate invalid and erroneous features and improve classification accuracy.
It enables efficient and accurate determination of enterprise industry categories, reduces the consumption of human and material resources, and improves the training effect of classification models.
Smart Images

Figure CN115099310B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of computers, and more particularly to training industry data extractors, training industry classification models, and methods and apparatus for classifying enterprises by industry. Background Technology
[0002] Based on business needs, it is often necessary to accurately classify the industry to which a company belongs. An industry refers to the collection of all entities engaged in the same type of economic activity. The industry classification in a company's business registration information is set when the company initially registers with the State Administration for Industry and Commerce and the State Administration of Taxation. This classification is prone to human error and differs significantly from the company's actual industry classification. Therefore, it is necessary to further refine the company's industry classification.
[0003] Current technologies primarily utilize traditional methods, employing manual statistical analysis to classify companies by industry. This process is labor-intensive, resource-intensive, and inefficient. Furthermore, the accuracy of industry classification results using current technologies is relatively low. Summary of the Invention
[0004] This specification describes one or more embodiments of a training industry data extractor, a training industry classification model, and a method and apparatus for classifying enterprises by industry, which can efficiently and accurately determine the industry category of an enterprise.
[0005] Firstly, a method for training an industry data extractor is provided, the method including:
[0006] Obtain a set of sample pairs consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; and any negative sample pair includes two basic data items from different enterprises.
[0007] The basic data included in the positive sample pair and the negative sample pair are respectively input into the industry data extractor to be trained to obtain the feature vectors corresponding to each basic data.
[0008] Based on the feature vectors corresponding to each basic data point, calculate the similarity between positive sample pairs and the similarity between negative sample pairs.
[0009] The industry data extractor is trained by minimizing the total representation loss, which is calculated based on the similarity of each sample pair in the sample pair set.
[0010] In one possible implementation, obtaining the sample pair set consisting of several positive sample pairs and several negative sample pairs includes:
[0011] Obtain basic data for a preset number of enterprises;
[0012] Take any one of the preset number of enterprises as the first enterprise and the other enterprises as the second enterprise. Construct the positive sample pair based on two basic data points of different types of the first enterprise, and construct the negative sample pair based on one basic data point of the first enterprise and one basic data point of the second enterprise.
[0013] In one possible implementation, the type of the underlying data includes:
[0014] Company name, business scope data, recruitment data, and patent data.
[0015] In one possible implementation, calculating the similarity between positive sample pairs and the similarity between negative sample pairs based on the feature vectors corresponding to each basic data item includes:
[0016] Based on the feature vectors corresponding to each basic data point, the similarity between positive and negative sample pairs is calculated using cosine similarity as the similarity function.
[0017] In one possible implementation, the total representation loss is negatively correlated with the sum of the similarities of each sample pair in the sample pair set and positively correlated with the sum of the similarities of each positive sample pair in the sample pair set.
[0018] Secondly, a method for training an industry classification model is provided, the method including:
[0019] Obtain a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise;
[0020] Each of the different types of basic data included in any training sample is input into the industry data extractor trained by the method described in the first aspect, to obtain multiple feature vectors;
[0021] The multiple feature vectors are input into the industry classification model to be trained to obtain the predicted category of the corresponding sample enterprise;
[0022] Calculate the prediction loss of the training sample based on the industry category label and the prediction category;
[0023] The industry classification model is trained by minimizing the total prediction loss, which is calculated based on the prediction loss of each training sample in the training sample set.
[0024] Thirdly, a method for classifying enterprises by industry is provided, including:
[0025] Obtain multiple types of basic data from the target company;
[0026] The various types of basic data are input one by one into the industry data extractor trained by the method described in the first aspect to obtain multiple feature vectors.
[0027] By inputting the multiple feature vectors into the industry classification model trained by the method described in the second aspect, the predicted industry category corresponding to the target enterprise is obtained.
[0028] In one possible implementation, the method further includes:
[0029] In the enterprise credit investigation service targeting the target enterprise, industry development data of the predicted industry category is collected to assess the credit status of the target enterprise.
[0030] Fourthly, an apparatus for training an industry data extractor is provided, the apparatus comprising:
[0031] The acquisition unit is used to acquire a set of sample pairs consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; and any negative sample pair includes two basic data items from different enterprises.
[0032] The feature extraction unit is used to input the basic data included in the positive sample pairs and negative sample pairs acquired by the acquisition unit into the industry data extractor to be trained, and obtain the feature vectors corresponding to each basic data.
[0033] The similarity calculation unit is used to calculate the similarity of positive sample pairs and the similarity of negative sample pairs based on the feature vectors corresponding to the various basic data obtained by the feature extraction unit.
[0034] A training unit is used to train the industry data extractor by minimizing the total representation loss, which is calculated based on the similarity of each sample pair in the sample pair set obtained by the similarity calculation unit.
[0035] Fifthly, an apparatus for training an industry classification model is provided, the apparatus comprising:
[0036] The acquisition unit is used to acquire a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise;
[0037] The feature extraction unit is used to input the various types of basic data included in any training sample acquired by the acquisition unit into the industry data extractor trained by the device described in the fourth aspect, so as to obtain multiple feature vectors.
[0038] The prediction unit is used to input multiple feature vectors obtained by the feature extraction unit into the industry classification model to be trained, so as to obtain the predicted category corresponding to the sample enterprise.
[0039] The loss calculation unit is used to calculate the prediction loss of the training sample based on the industry category label obtained by the acquisition unit and the prediction category obtained by the prediction unit.
[0040] The training unit is used to train the industry classification model by minimizing the total prediction loss; the total prediction loss is calculated based on the prediction loss of each training sample in the training sample set obtained by the loss calculation unit.
[0041] Sixthly, an apparatus for classifying enterprises by industry is provided, the apparatus comprising:
[0042] The acquisition unit is used to acquire multiple different types of basic data from the target enterprise.
[0043] The feature extraction unit is used to input the various types of basic data acquired by the acquisition unit into the industry data extractor trained by the device described in the fourth aspect, one by one, to obtain multiple feature vectors.
[0044] The prediction unit is used to input the multiple feature vectors obtained by the feature extraction unit into the industry classification model trained by the device described in the fifth aspect, so as to obtain the predicted industry category corresponding to the target enterprise.
[0045] In a seventh aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods of the first aspect, the second aspect, or the third aspect.
[0046] Eighthly, a computing device is provided, including a memory and a processor, wherein executable code is stored in the memory, and the processor, when executing the executable code, implements the methods of the first aspect, the second aspect, or the third aspect.
[0047] The method and apparatus for training an industry data extractor provided in the embodiments of this specification first obtain a sample pair set consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; any negative sample pair includes two basic data items from different enterprises; then, the basic data items included in the positive sample pairs and the negative sample pairs are respectively input into the industry data extractor to be trained to obtain the feature vectors corresponding to each basic data item; next, the similarity between the positive sample pairs and the similarity between the negative sample pairs are calculated based on the feature vectors corresponding to each basic data item; finally, the industry data extractor is trained by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. As can be seen from the above, the embodiments of this specification construct positive sample pairs using two basic data points of different types from the same enterprise, and construct negative sample pairs using two basic data points from different enterprises. By comparing the two basic data points in the feature space of the positive sample pairs and the two basic data points in the feature space of the negative sample pairs, the feature representation of each basic data point is learned. This enables the trained industry data extractor to discover the commonalities between the basic data of similar enterprises and eliminate invalid and erroneous features in the enterprise basic data. Thus, relying on the feature representation of the basic data by the industry data extractor, the industry category of the enterprise can be determined efficiently and accurately.
[0048] The method and apparatus for training an industry classification model provided in the embodiments of this specification first obtain a training sample set, wherein any training sample in the training sample set includes multiple types of basic data and industry category labels of a sample enterprise; then, the multiple types of basic data included in any training sample are input item by item into the industry data extractor trained by the method described in the first aspect to obtain multiple feature vectors; next, the multiple feature vectors are input into the industry classification model to be trained to obtain the predicted category corresponding to the sample enterprise; then, the prediction loss of the training sample is calculated according to the industry category label and the predicted category; finally, the industry classification model is trained by minimizing the total prediction loss; the total prediction loss is calculated based on the prediction loss of each training sample in the training sample set. As can be seen from the above, in the embodiments of this specification, because the trained industry data extractor can discover the commonalities between the basic data of similar enterprises and remove invalid and erroneous features in the basic data of enterprises, the industry classification model is trained based on the feature representation of the basic data by the industry data extractor, which improves the training effect of the industry classification model and can efficiently and accurately determine the industry category of an enterprise.
[0049] The method and apparatus for industry classification of enterprises provided in the embodiments of this specification first acquire multiple types of basic data of the target enterprise; then, the multiple types of basic data are input item by item into the industry data extractor trained by the method described in the first aspect to obtain multiple feature vectors; finally, the multiple feature vectors are input into the industry classification model trained by the method described in the second aspect to obtain the predicted industry category corresponding to the target enterprise. As can be seen from the above, in the embodiments of this specification, because the trained industry data extractor can uncover the commonalities between basic data of similar enterprises, eliminate invalid and erroneous features in the basic data of enterprises, and rely on the feature representation of the basic data by the industry data extractor to train the industry classification model, the training effect of the industry classification model is improved. Therefore, when classifying enterprises by industry, first using the industry data extractor to obtain the feature representation of the basic data, and then using the industry classification model to classify based on the feature representation, can efficiently and accurately determine the industry category of the enterprise. Attached Figure Description
[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification;
[0052] Figure 2 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification;
[0053] Figure 3 A flowchart illustrating a method for training an industry data extractor according to one embodiment is shown.
[0054] Figure 4 A schematic diagram illustrating the training process of an industry data extractor according to one embodiment is shown;
[0055] Figure 5 This diagram illustrates a method flowchart for training an industry classification model according to one embodiment.
[0056] Figure 6 A flowchart illustrating a method for classifying enterprises by industry according to one embodiment is shown;
[0057] Figure 7 A schematic block diagram of an apparatus for training an industry data extractor according to one embodiment is shown;
[0058] Figure 8A schematic block diagram of an apparatus for training an industry classification model according to one embodiment is shown;
[0059] Figure 9 A schematic block diagram of an apparatus for classifying enterprises by industry according to one embodiment is shown. Detailed Implementation
[0060] The solution provided in this specification will now be described with reference to the accompanying drawings.
[0061] Figure 1 This is a schematic diagram illustrating an implementation scenario of one embodiment disclosed in this specification. This implementation scenario involves classifying enterprises by industry. (Refer to...) Figure 1 In the embodiments of this specification, based on the basic data of an enterprise, natural language processing technology is used to obtain the predicted industry category of the enterprise. The basic data of the enterprise is usually text-type data, which is represented by natural language and may include multiple different types of basic data, such as enterprise name, business scope data, recruitment data, patent data, etc.
[0062] Natural language processing (NLP) is an important field in computer science and artificial intelligence, which studies various theories and methods that enable effective communication between humans and computers using natural language.
[0063] To address the inconsistencies and low quality of various basic data of enterprises, such as numerous instances of human error in the business scope data and many statements unrelated to industry classification in the recruitment data, this specification's embodiments train an industry data extractor using methods based on contrastive learning and deep learning. This makes the feature vector output by the industry data extractor more reflective of key data related to industry classification, thereby improving the accuracy of subsequent industry classification models based on this feature vector.
[0064] Contrastive learning: refers to an unsupervised image or text representation learning method that focuses on learning the common features between similar instances and distinguishing the differences between dissimilar instances.
[0065] Deep learning is a branch of machine learning, and it is an algorithm that uses artificial neural networks as an architecture to learn representations of data.
[0066] Figure 2 This is a schematic diagram illustrating an implementation scenario of another embodiment disclosed in this specification. This implementation scenario involves multiple fundamental data points about the enterprises upon which industry classification is based. (Refer to...) Figure 2A company's basic data includes its name, business scope, recruitment information, and patent data. Underlined portions represent industry-related terms within this basic data, which are considered valid features. Examples include "tobacco curing" in the company name, "tobacco curing" and "standardized tobacco seedling cultivation" in the business scope, "cigarette production" in the patent data, and "cigarette blender" in the recruitment data. Ununderlined portions represent invalid or erroneous features. For instance, "limited company" in the company name is an invalid feature, and "fruits and vegetables" in the business scope is an erroneous feature. These invalid and erroneous features severely impair the accuracy of industry classification. This embodiment demonstrates how a trained industry data extractor can extract valid features from the company's basic data, thereby improving the accuracy of subsequent classification.
[0067] Figure 3 This diagram illustrates a method flowchart for training an industry data extractor according to one embodiment, the method being based on... Figure 1 and Figure 2 The implementation scenario is shown. For example... Figure 3 As shown, the method for training an industry data extractor in this embodiment includes the following steps: Step 31, obtaining a sample pair set consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; any negative sample pair includes two basic data items from different enterprises; Step 32, inputting the basic data items included in the positive sample pairs and the negative sample pairs into the industry data extractor to be trained, respectively, to obtain the feature vectors corresponding to each basic data item; Step 33, calculating the similarity between positive sample pairs and the similarity between negative sample pairs based on the feature vectors corresponding to each basic data item; Step 34, training the industry data extractor by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. The specific execution method of each of the above steps is described below.
[0068] First, in step 31, a set of sample pairs consisting of several positive sample pairs and several negative sample pairs is obtained; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; any negative sample pair includes two basic data items from different enterprises. It is understood that the two basic data items in a positive sample pair are considered to have high similarity, while the two basic data items in a negative sample pair are considered to have low similarity.
[0069] Positive sample pairs include two basic data items of different types from the same company. For example, the business scope data of company A and the recruitment data of company A can form a positive sample pair, as can the company name of company A and the recruitment data of company A. Negative sample pairs include two basic data items from different companies. These two basic data items can be of the same type or different types. For example, the patent data of company A and the patent data of company B can form a negative sample pair, as can the patent data of company A and the recruitment data of company B.
[0070] In one example, obtaining the sample pair set consisting of several positive sample pairs and several negative sample pairs includes:
[0071] Obtain basic data for a preset number of enterprises;
[0072] Take any one of the preset number of enterprises as the first enterprise and the other enterprises as the second enterprise. Construct the positive sample pair based on two basic data points of different types of the first enterprise, and construct the negative sample pair based on one basic data point of the first enterprise and one basic data point of the second enterprise.
[0073] In this example, each company has several different types of basic data. Positive sample pairs can be constructed by combining two basic data items from the same company, and negative sample pairs can be constructed by combining two basic data items from different companies. This method can easily generate a large number of positive and negative sample pairs.
[0074] In one example, the types of the underlying data include:
[0075] Company name, business scope data, recruitment data, and patent data.
[0076] The embodiments in this specification employ various types of basic data to facilitate the removal of noise from the data itself. The types of basic data may include, but are not limited to, the types listed above. For example, it may also include industry classification data filled in by the company itself, or it may include the company's bidding data, etc.
[0077] Then, in step 32, the basic data included in the positive sample pairs and the negative sample pairs are respectively input into the industry data extractor to be trained to obtain the feature vectors corresponding to each basic data. It can be understood that the industry data extractor can also be called an encoder; by inputting a basic data item into the industry data extractor, the feature vector corresponding to that basic data item can be obtained.
[0078] In the embodiments described in this specification, by training an industry data extractor, the feature vector can represent the key data related to industry classification in the basic data, and noise in the basic data can be removed.
[0079] Next, in step 33, the similarity between positive and negative sample pairs is calculated based on the feature vectors corresponding to each basic data point. As can be understood, a positive sample pair includes two basic data points; the similarity between these two data points is calculated using their respective feature vectors. Similarly, a negative sample pair also includes two basic data points; the similarity between these two data points is calculated using their respective feature vectors.
[0080] In one example, calculating the similarity between positive sample pairs and the similarity between negative sample pairs based on the feature vectors corresponding to each basic data item includes:
[0081] Based on the feature vectors corresponding to each basic data point, the similarity between positive and negative sample pairs is calculated using cosine similarity as the similarity function.
[0082] For example, a company has one basic data point x and another basic data point x+. The positive sample pair formed by these two basic data points can be represented as (x, x+), where the feature vector of x is represented as f(x), and the feature vector of x+ is represented as f(x+). The similarity of this positive sample pair can be represented as score(f(x), f(x+)) = f(x). T f(x+). Given a basic data point x for one company and x- for another, a negative sample pair can be represented as (x, x-), where the feature vector of x is denoted as f(x), and the feature vector of x- is denoted as f(x-). The similarity of this negative sample pair can be expressed as score(f(x), f(x-)) = f(x). T f(x-).
[0083] Finally, in step 34, the industry data extractor is trained by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. It is understood that the sample pair set includes both positive and negative sample pairs, therefore the total representation loss is related to the similarity of both positive and negative sample pairs.
[0084] In one example, the total representation loss is negatively correlated with the sum of the similarities of individual sample pairs in the sample pair set and positively correlated with the sum of the similarities of individual positive sample pairs in the sample pair set.
[0085] In this embodiment, the industry data extractor is trained using contrastive learning, where the total representation loss is also known as contrastive loss. Contrastive learning learns the feature representation of a sample by comparing it with positive and negative examples in the feature space. Here, x can represent a basic data point, x+ represents a positive example of x (x and x+ form a positive sample pair), and x- represents a negative example of x (x and x- form a negative sample pair).
[0086] Figure 4 A schematic diagram illustrating the training process of an industry data extractor according to one embodiment is shown. (Refer to...) Figure 4 The industry data extractor, also known as an encoder, uses basic data from the same company but of different types to form positive sample pairs during the training phase, and basic data from different companies but of different or the same type to form negative sample pairs. For example, x represents the company name of company A, specifically "Hebei Anfeng Steel Co., Ltd."; one x+ represents company A's business scope data, specifically "strip steel, continuously cast billets, hot-rolled coils..."; another x+ represents company A's patent data, specifically "patent number A63B23 / 035"; and x- represents company B's recruitment data, specifically "Company sincerely recruits...five social insurances and one housing fund...main business is domestic internet technology...". In this embodiment, the training direction is based on the similarity of positive sample pairs being greater than the similarity of negative sample pairs. If cosine similarity is used as the similarity function, the comparison loss can be expressed as: Here, N represents the acquisition of basic data from N enterprises. Positive and negative sample pairs are constructed using this data to train the industry data extractor. The encoder parameters are then optimized using gradient descent to obtain the industry data extractor that reflects industry keywords.
[0087] The method for training an industry data extractor provided in the embodiments of this specification first obtains a sample pair set consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; any negative sample pair includes two basic data items from different enterprises; then, the basic data items included in the positive and negative sample pairs are respectively input into the industry data extractor to be trained to obtain the feature vectors corresponding to each basic data item; next, the similarity between the positive sample pairs and the similarity between the negative sample pairs are calculated based on the feature vectors corresponding to each basic data item; finally, the industry data extractor is trained by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. As can be seen from the above, the embodiments of this specification construct positive sample pairs using two basic data points of different types from the same enterprise, and construct negative sample pairs using two basic data points from different enterprises. By comparing the two basic data points in the feature space of the positive sample pairs and the two basic data points in the feature space of the negative sample pairs, the feature representation of each basic data point is learned. This enables the trained industry data extractor to discover the commonalities between the basic data of similar enterprises and eliminate invalid and erroneous features in the enterprise basic data. Thus, relying on the feature representation of the basic data by the industry data extractor, the industry category of the enterprise can be determined efficiently and accurately.
[0088] Figure 5 This diagram illustrates a method flowchart for training an industry classification model according to one embodiment. The method can be based on... Figure 1 and Figure 2 The implementation scenario is shown. For example... Figure 5 As shown, the method for training an industry classification model in this embodiment includes the following steps: Step 51, obtaining a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise; Step 52, inputting the multiple different types of basic data included in any training sample item by item. Figure 3 The method shown trains an industry data extractor, yielding multiple feature vectors. Step 53 involves inputting these feature vectors into the industry classification model to be trained, obtaining the predicted category for each sample company. Step 54 involves calculating the prediction loss for the training sample based on the industry category label and the predicted category. Step 55 involves training the industry classification model by minimizing the total prediction loss. The total prediction loss is calculated based on the prediction loss of each training sample in the training sample set. The specific execution methods of each of the above steps are described below.
[0089] First, in step 51, a training sample set is obtained. Each training sample in the training sample set includes multiple types of basic data and industry category labels for the sample enterprise. It is understood that the aforementioned industry category labels can be obtained, but are not limited to, through manual labeling.
[0090] The types of basic data may include, but are not limited to, any of the following: company name, business scope data, recruitment data, and patent data.
[0091] In the embodiments described in this specification, the above industry category labels can be obtained according to the national standard industry classification.
[0092] National Standard Industry Classification: Refers to the national economic industry classification system, issued by the State Administration for Quality Supervision, Inspection and Quarantine and the State Standardization Administration. It is used to classify economic activities in national macro-management such as statistics, planning, finance, taxation, and industry and commerce, and is also used for information processing and information exchange.
[0093] Then, in step 52, each of the multiple different types of basic data included in any training sample is input item by item. Figure 3 The industry data extractor trained using the method shown yields multiple feature vectors. Understandably, these feature vectors better reflect industry keywords, eliminating invalid and erroneous features from the company's basic data.
[0094] Next, in step 53, the multiple feature vectors are input into the industry classification model to be trained to obtain the predicted category corresponding to the sample enterprise. It can be understood that the industry classification model can output one or more predicted categories, and when there are multiple predicted categories, it can also provide the probability corresponding to each predicted category.
[0095] Since the trained industry data extractor removes text data that is irrelevant to industry classification, using the output of the industry data extractor as the input to the industry classification model can effectively reduce the training cost of the industry classification model.
[0096] In step 54, the prediction loss of the training sample is calculated based on the industry category label and the predicted category. It is understood that when there is only one predicted category, if that predicted category is the same as the industry category label, the prediction loss of the training sample is 0; when there are multiple predicted categories, the prediction loss of the training sample can be calculated by combining the probabilities corresponding to each predicted category and the industry category label.
[0097] Finally, in step 55, the industry classification model is trained by minimizing the total prediction loss; the total prediction loss is calculated based on the prediction loss of each training sample in the training sample set. It is understood that, typically, the total prediction loss is related to the sum of the prediction losses of each training sample.
[0098] In the embodiments described in this specification, training the industry classification model falls under the category of supervised learning. Supervised learning is a method of machine learning that refers to classifying or fitting input data given pre-labeled training examples.
[0099] The method for training an industry classification model provided in the embodiments of this specification first obtains a training sample set, wherein each training sample in the training sample set includes multiple types of basic data and industry category labels of the sample enterprise; then, the multiple types of basic data included in each training sample are input item by item. Figure 3 The industry data extractor trained by the method shown yields multiple feature vectors. These feature vectors are then input into the industry classification model to be trained, resulting in predicted categories for the corresponding sample companies. The prediction loss for the training sample is calculated based on the industry category label and the predicted category. Finally, the industry classification model is trained by minimizing the total prediction loss, which is calculated based on the prediction losses of each training sample in the training sample set. As can be seen from the above, in this embodiment, because the trained industry data extractor can uncover the commonalities among the basic data of similar companies and eliminate invalid and erroneous features in the basic data, training the industry classification model based on the feature representation of the basic data by the industry data extractor improves the training effect of the industry classification model, enabling efficient and accurate determination of the industry category of a company.
[0100] Figure 6 This diagram illustrates a method for classifying enterprises by industry according to one embodiment. The method can be based on... Figure 1 and Figure 2 The implementation scenario is shown. For example... Figure 6 As shown, the method for classifying enterprises by industry in this embodiment includes the following steps: Step 61, obtaining multiple types of basic data for the target enterprise; Step 62, inputting the multiple types of basic data item by item. Figure 3 The industry data extractor trained by the method shown yields multiple feature vectors; step 63 involves inputting the multiple feature vectors into... Figure 5 The industry classification model trained using the method shown yields the predicted industry category for the target company. The specific execution methods for each of the above steps are described below.
[0101] First, in step 61, multiple types of basic data about the target company are acquired. It's understandable that different types of basic data can complement each other, which helps improve the accuracy of predicting industry categories.
[0102] The types of basic data may include, but are not limited to, any of the following: company name, business scope data, recruitment data, and patent data.
[0103] Then, in step 62, the various types of basic data are entered one by one. Figure 3 The industry data extractor trained using the method shown yields multiple feature vectors. Understandably, these feature vectors better reflect industry keywords, eliminating invalid and erroneous features from the company's basic data.
[0104] Finally, in step 63, the multiple feature vectors are input Figure 5 The industry classification model trained using the method shown yields the predicted industry category for the target company. It is understood that the predicted industry category obtained based on the aforementioned trained industry data extractor and industry classification model has high accuracy.
[0105] In many business scenarios, it is necessary to predict the industry category of a company. For example, in corporate risk control scenarios, it is often necessary to determine the industry category of the target company in the credit investigation service for the target company.
[0106] Corporate credit reporting refers to the process by which credit reporting agencies, as enterprises providing credit information services, legally collect credit information of enterprises and individuals according to certain rules, process and organize it into credit reports and other credit products, and provide them for a fee to information users with legitimate needs in economic activities, such as lenders, sellers on credit, bidders, lessors, and insurers, to facilitate their understanding of the credit status of their trading partners.
[0107] In one example, the method further includes:
[0108] In the enterprise credit investigation service targeting the target enterprise, industry development data of the predicted industry category is collected to assess the credit status of the target enterprise.
[0109] The method for classifying enterprises by industry as provided in the embodiments of this specification first obtains multiple types of basic data about the target enterprise; then, the multiple types of basic data are input item by item. Figure 3 The industry data extractor trained using the method shown yields multiple feature vectors; finally, these multiple feature vectors are input... Figure 5The industry classification model trained by the method shown yields the predicted industry category corresponding to the target enterprise. As can be seen from the above, in this embodiment of the specification, because the trained industry data extractor can uncover the commonalities among the basic data of similar enterprises, eliminate invalid and erroneous features in the basic data, and relies on the feature representation of the basic data by the industry data extractor to train the industry classification model, the training effect of the industry classification model is improved. Therefore, when classifying enterprises by industry, first using the industry data extractor to obtain the feature representation of the basic data, and then using the industry classification model to classify based on this feature representation, can efficiently and accurately determine the industry category of the enterprise.
[0110] According to another embodiment, an apparatus for training an industry data extractor is also provided, the apparatus being used to perform the tasks provided in the embodiments of this specification. Figure 3 The method shown. Figure 7 A schematic block diagram of an apparatus for training an industry data extractor according to one embodiment is shown. Figure 7 As shown, the device 700 includes:
[0111] The acquisition unit 71 is used to acquire a set of sample pairs consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data of different types from the same enterprise; any negative sample pair includes two basic data from different enterprises.
[0112] The feature extraction unit 72 is used to input the basic data included in the positive sample pairs and negative sample pairs acquired by the acquisition unit 71 into the industry data extractor to be trained, and obtain the feature vectors corresponding to each basic data.
[0113] The similarity calculation unit 73 is used to calculate the similarity of positive sample pairs and the similarity of negative sample pairs based on the feature vectors corresponding to the various basic data obtained by the feature extraction unit 72.
[0114] Training unit 74 is used to train the industry data extractor by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set obtained by similarity calculation unit 73.
[0115] Optionally, as an embodiment, the acquisition unit 71 includes:
[0116] The acquisition sub-unit is used to acquire basic data from a preset number of enterprises;
[0117] A construction subunit is used to designate any one of the preset number of enterprises as the first enterprise and the other enterprises as the second enterprise, construct the positive sample pair based on two basic data points of different types of the first enterprise obtained by the acquisition subunit, and construct the negative sample pair based on one basic data point of the first enterprise and one basic data point of the second enterprise obtained by the acquisition subunit.
[0118] Optionally, as an example, the type of the underlying data includes:
[0119] Company name, business scope data, recruitment data, and patent data.
[0120] Optionally, as an embodiment, the similarity calculation unit 73 is specifically used to calculate the first similarity of positive sample pairs and the second similarity of negative sample pairs based on the feature vectors corresponding to each basic data, using cosine similarity as the similarity function.
[0121] Optionally, as an embodiment, the total representation loss is negatively correlated with the sum of the similarities of each sample pair in the sample pair set, and positively correlated with the sum of the similarities of each positive sample pair in the sample pair set.
[0122] The apparatus for training an industry data extractor provided in the embodiments of this specification first acquires a sample pair set consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; any negative sample pair includes two basic data items from different enterprises; then, the feature extraction unit 72 inputs the basic data items included in the positive sample pairs and the negative sample pairs into the industry data extractor to be trained, respectively, to obtain the feature vectors corresponding to each basic data item; next, the similarity calculation unit 73 calculates the similarity of the positive sample pairs and the similarity of the negative sample pairs based on the feature vectors corresponding to each basic data item; finally, the training unit 74 trains the industry data extractor by minimizing the total representation loss; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. As can be seen from the above, the embodiments of this specification construct positive sample pairs using two basic data points of different types from the same enterprise, and construct negative sample pairs using two basic data points from different enterprises. By comparing the two basic data points in the feature space of the positive sample pairs and the two basic data points in the feature space of the negative sample pairs, the feature representation of each basic data point is learned. This enables the trained industry data extractor to discover the commonalities between the basic data of similar enterprises and eliminate invalid and erroneous features in the enterprise basic data. Thus, relying on the feature representation of the basic data by the industry data extractor, the industry category of the enterprise can be determined efficiently and accurately.
[0123] According to another embodiment, an apparatus for training an industry classification model is also provided, which is used to perform the tasks provided in the embodiments of this specification. Figure 5 The method shown. Figure 8 A schematic block diagram of an apparatus for training an industry classification model according to one embodiment is shown. Figure 8 As shown, the device 800 includes:
[0124] The acquisition unit 81 is used to acquire a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise;
[0125] Feature extraction unit 82 is used to input the various types of basic data included in any training sample acquired by acquisition unit 81 one by one. Figure 7 The industry data extractor trained by the device shown yields multiple feature vectors.
[0126] The prediction unit 83 is used to input multiple feature vectors obtained by the feature extraction unit 82 into the industry classification model to be trained, so as to obtain the prediction category corresponding to the sample enterprise.
[0127] The loss calculation unit 84 is used to calculate the prediction loss of the training sample based on the industry category label obtained by the acquisition unit 81 and the prediction category obtained by the prediction unit 83.
[0128] Training unit 85 is used to train the industry classification model by minimizing the total prediction loss; the total prediction loss is calculated based on the prediction loss of each training sample in the training sample set obtained by loss calculation unit 84.
[0129] The apparatus for training an industry classification model provided in the embodiments of this specification first acquires a training sample set by the acquisition unit 81. Each training sample in the training sample set includes multiple types of basic data and industry category labels of the sample enterprise. Then, the feature extraction unit 82 inputs the multiple types of basic data included in each training sample item by item. Figure 7The industry data extractor trained by the device shown obtains multiple feature vectors. Then, the prediction unit 83 inputs these feature vectors into the industry classification model to be trained, obtaining the predicted category for each sample enterprise. Next, the loss calculation unit 84 calculates the prediction loss for the training sample based on the industry category label and the predicted category. Finally, the training unit 85 trains the industry classification model by minimizing the total prediction loss. The total prediction loss is calculated based on the prediction loss of each training sample in the training sample set. As can be seen from the above, in this embodiment, because the trained industry data extractor can uncover the commonalities between the basic data of similar enterprises and eliminate invalid and erroneous features in the basic enterprise data, relying on the feature representation of the basic data by the industry data extractor to train the industry classification model improves the training effect of the industry classification model, enabling efficient and accurate determination of the enterprise's industry category.
[0130] According to another embodiment, an apparatus for classifying enterprises by industry is also provided, the apparatus being used to perform the functions provided in the embodiments of this specification. Figure 6 The method shown. Figure 9 A schematic block diagram of an apparatus for classifying enterprises by industry according to one embodiment is shown. Figure 9 As shown, the device 900 includes:
[0131] Acquisition unit 91 is used to acquire multiple different types of basic data of the target enterprise;
[0132] Feature extraction unit 92 is used to input the multiple different types of basic data acquired by acquisition unit 91 item by item. Figure 7 The industry data extractor trained by the device shown yields multiple feature vectors.
[0133] Prediction unit 93 is used to input the multiple feature vectors obtained by feature extraction unit 92 into the prediction unit 93. Figure 8 The industry classification model trained by the device shown can obtain the predicted industry category corresponding to the target enterprise.
[0134] Optionally, as an embodiment, the apparatus further includes:
[0135] The data collection unit is used to collect industry development data of the predicted industry category obtained by the prediction unit in the enterprise credit investigation service for the target enterprise, so as to evaluate the credit status of the target enterprise.
[0136] The apparatus for classifying enterprises by industry provided in the embodiments of this specification first acquires multiple types of basic data of the target enterprise by the acquisition unit 91; then the feature extraction unit 92 inputs the multiple types of basic data item by item. Figure 7The device shown is used to train an industry data extractor, which yields multiple feature vectors; finally, the prediction unit 93 inputs these multiple feature vectors into... Figure 8 The industry classification model trained by the device shown yields the predicted industry category corresponding to the target enterprise. As can be seen from the above, in this embodiment, because the trained industry data extractor can uncover the commonalities among the basic data of similar enterprises, eliminate invalid and erroneous features in the basic data, and relies on the feature representation of the basic data by the industry data extractor to train the industry classification model, the training effect of the industry classification model is improved. Therefore, when classifying enterprises by industry, first using the industry data extractor to obtain the feature representation of the basic data, and then using the industry classification model to classify based on this feature representation, can efficiently and accurately determine the industry category of the enterprise.
[0137] According to another embodiment, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed in a computer, causes the computer to perform a combination Figure 3 , Figure 5 or Figure 6 The method described.
[0138] According to another embodiment, a computing device is also provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements a combination... Figure 3 , Figure 5 or Figure 6 The method described.
[0139] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0140] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for training an industry data extractor, the method comprising: Obtain a set of sample pairs consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; and any negative sample pair includes two basic data items from different enterprises. The basic data included in the positive sample pair and the negative sample pair are respectively input into the industry data extractor to be trained to obtain the feature vectors corresponding to each basic data. Based on the feature vectors corresponding to each basic data point, calculate the similarity between positive sample pairs and the similarity between negative sample pairs. The industry data extractor is trained by minimizing the total representation loss, and the feature vector output by the industry data extractor is used to classify enterprises by industry; the total representation loss is calculated based on the similarity of each sample pair in the sample pair set. The types of the basic data include: Company name, business scope data, recruitment data, and patent data.
2. The method as described in claim 1, wherein, The process of obtaining a set of sample pairs consisting of several positive sample pairs and several negative sample pairs includes: Obtain basic data for a preset number of enterprises; Take any one of the preset number of enterprises as the first enterprise and the other enterprises as the second enterprise. Construct the positive sample pair based on two basic data points of different types of the first enterprise, and construct the negative sample pair based on one basic data point of the first enterprise and one basic data point of the second enterprise.
3. The method as described in claim 1, wherein, The step of calculating the similarity between positive sample pairs and the similarity between negative sample pairs based on the feature vectors corresponding to each basic data item includes: Based on the feature vectors corresponding to each basic data point, the similarity between positive and negative sample pairs is calculated using cosine similarity as the similarity function.
4. The method of claim 1, wherein, The total representation loss is negatively correlated with the sum of similarities of all positive sample pairs in the sample pair set, and positively correlated with the sum of similarities of all negative sample pairs in the sample pair set.
5. A method for training an industry classification model, the method comprising: Obtain a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise; Each of the different types of basic data included in any training sample is input into the industry data extractor trained by the method described in claim 1 to obtain multiple feature vectors; The multiple feature vectors are input into the industry classification model to be trained to obtain the predicted category of the corresponding sample enterprise; Calculate the prediction loss of the training sample based on the industry category label and the prediction category; The industry classification model is trained by minimizing the total prediction loss, which is calculated based on the prediction loss of each training sample in the training sample set.
6. A method for classifying enterprises by industry, the method comprising: Obtain multiple types of basic data from the target company; The various types of basic data are input one by one into the industry data extractor trained by the method described in claim 1 to obtain multiple feature vectors; The multiple feature vectors are input into the industry classification model trained by the method described in claim 5 to obtain the predicted industry category corresponding to the target enterprise.
7. The method of claim 6, wherein, The method further includes: In the enterprise credit investigation service targeting the target enterprise, industry development data of the predicted industry category is collected to assess the credit status of the target enterprise.
8. An apparatus for training an industry data extractor, the apparatus comprising: The acquisition unit is used to acquire a set of sample pairs consisting of several positive sample pairs and several negative sample pairs; wherein, any positive sample pair includes two basic data items of different types from the same enterprise; and any negative sample pair includes two basic data items from different enterprises. The feature extraction unit is used to input the basic data included in the positive sample pairs and negative sample pairs acquired by the acquisition unit into the industry data extractor to be trained, and obtain the feature vectors corresponding to each basic data. The similarity calculation unit is used to calculate the similarity of positive sample pairs and the similarity of negative sample pairs based on the feature vectors corresponding to the various basic data obtained by the feature extraction unit. A training unit is used to train the industry data extractor by minimizing the total representation loss. The feature vector output by the industry data extractor is used to classify enterprises by industry. The total representation loss is calculated based on the similarity of each sample pair in the sample pair set obtained by the similarity calculation unit. The types of the basic data include: Company name, business scope data, recruitment data, and patent data.
9. The apparatus of claim 8, wherein, The acquisition unit includes: The acquisition sub-unit is used to acquire basic data from a preset number of enterprises; A construction subunit is used to designate any one of the preset number of enterprises as the first enterprise and the other enterprises as the second enterprise, construct the positive sample pair based on two basic data points of different types of the first enterprise obtained by the acquisition subunit, and construct the negative sample pair based on one basic data point of the first enterprise and one basic data point of the second enterprise obtained by the acquisition subunit.
10. The apparatus of claim 8, wherein, The similarity calculation unit is specifically used to calculate the first similarity of positive sample pairs and the second similarity of negative sample pairs based on the feature vectors corresponding to each basic data, using cosine similarity as the similarity function.
11. The apparatus of claim 8, wherein, The total representation loss is negatively correlated with the sum of similarities of all positive sample pairs in the sample pair set, and positively correlated with the sum of similarities of all negative sample pairs in the sample pair set.
12. An apparatus for training an industry classification model, the apparatus comprising: The acquisition unit is used to acquire a training sample set, wherein any training sample in the training sample set includes multiple different types of basic data and industry category labels of the sample enterprise; The feature extraction unit is used to input the various types of basic data included in any training sample acquired by the acquisition unit into the industry data extractor trained by the device according to claim 8, so as to obtain multiple feature vectors. The prediction unit is used to input multiple feature vectors obtained by the feature extraction unit into the industry classification model to be trained, so as to obtain the predicted category corresponding to the sample enterprise. The loss calculation unit is used to calculate the prediction loss of the training sample based on the industry category label obtained by the acquisition unit and the prediction category obtained by the prediction unit. The training unit is used to train the industry classification model by minimizing the total prediction loss; the total prediction loss is calculated based on the prediction loss of each training sample in the training sample set obtained by the loss calculation unit.
13. An apparatus for classifying enterprises by industry, the apparatus comprising: The acquisition unit is used to acquire multiple different types of basic data from the target enterprise. The feature extraction unit is used to input the various types of basic data acquired by the acquisition unit into the industry data extractor trained by the device according to claim 8, one by one, to obtain multiple feature vectors. The prediction unit is used to input multiple feature vectors obtained by the feature extraction unit into the industry classification model trained by the device according to claim 12, so as to obtain the predicted industry category corresponding to the target enterprise.
14. The apparatus of claim 13, wherein, The device further includes: The data collection unit is used to collect industry development data of the predicted industry category obtained by the prediction unit in the enterprise credit investigation service for the target enterprise, so as to evaluate the credit status of the target enterprise.
15. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-7.
16. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-7.
Citation Information
Patent Citations
Enterprise industry classification method
CN107944480A
Neural network model training method, identification method, storage medium and equipment
CN112734031A