Zero sample classification method and device, electronic equipment and medium
Through the zero-sample classification method in the field of automobile research and development and manufacturing, the problem of machine learning classification method dependence on a large number of known data is solved, adaptability and efficient classification of newly emerging category labels is achieved, and the accuracy and efficiency of text classification are improved. .
Patent Information
- Application Number
- CN202411353771.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-01-14
AI Technical Summary
The existing machine learning classification methods require a large amount of known categories of data for training in the field of automotive R&D and manufacturing, and cannot effectively deal with the problems of many categories and few labeled data, making data acquisition expensive and time-consuming, and unable to adapt to new emergencies. category tags.
Using the zero-sample classification method, by obtaining quality problem data and labels, determining the candidate tag set, and inputting it into the zero-sample classification model to obtain the matching probability, and then determining the target classification tag, reducing the need for a large amount of labeled data, and adapting to the emerging ones Category tags and improve the model's ability to identify unknown categories.
It realizes the classification of text in the absence of pre-labeled data, reduces the need for data annotation and model retraining, reduces time and economic costs, improves problem response speed and processing efficiency, and provides more accurate fault classification and diagnosis.
Smart Images

Figure CN119312130A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of text classification, and in particular to a zero-sample classification method, device, electronic device, and medium. Background Art
[0002] The automotive R&D and manufacturing sector requires data on quality issues, including after-sales complaints and test reports from the production, R&D, and testing phases. Related technologies for classifying text information primarily include multi-classification methods using machine learning and deep learning.
[0003] However, commonly used machine learning classification methods usually require a large amount of data of known categories to build and train models, and obtaining labeled data for any specific task or field is a very expensive and time-consuming process. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a zero-sample classification method, device, electronic device, and medium. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a zero-shot classification method is provided, including:
[0006] Obtain quality problem data and quality problem labels;
[0007] Determine a candidate label set based on the quality problem labels;
[0008] Inputting the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data;
[0009] The target classification label is determined by the matching probability.
[0010] Optionally, obtaining quality problem data and quality problem labels includes:
[0011] Obtaining initial quality problem data and initial quality problem labels;
[0012] Prompt enhancement is performed on the initial quality problem data and the initial quality problem label to obtain the quality problem data and the quality problem label; the prompt enhancement is used to convert proprietary vocabulary into natural language expressions that can be understood by common sense.
[0013] Optionally, the label system to which the quality problem label belongs is a multi-level category; determining a candidate label set based on the quality problem label includes:
[0014] Randomly determine a target quality problem label from each layer of quality problem labels in the label system;
[0015] Obtain a target sentiment label, wherein the target sentiment label is any one of: a positive review, a negative review, and a neutral review;
[0016] The target sentiment label and each target quality problem label are concatenated into a natural language sentence to obtain a candidate label in the candidate label set.
[0017] Optionally, determining the target classification label by using the matching probability includes:
[0018] Determine the candidate tag whose matching probability is greater than the decision threshold as the first candidate tag;
[0019] Sort the first candidate tags according to their respective matching probabilities, and determine the second candidate tags from the top N first candidate tags with the highest matching probabilities, where N is an integer greater than 0;
[0020] Analyzing the matching probabilities of the respective second candidate tags to determine a cutoff point at which the matching probabilities drop significantly; the cutoff point indicates that a difference between the matching probabilities before the cutoff point and the matching probabilities after the cutoff point is greater than a difference threshold;
[0021] According to the dividing point, a target classification label is determined from the second candidate labels.
[0022] Optionally, the zero-shot classification model is fine-tuned in the following manner:
[0023] Constructing a fine-tuning dataset, wherein the fine-tuning dataset includes: positive samples with sample labels representing high matching probabilities and negative samples with sample labels representing low matching probabilities;
[0024] Importing the fine-tuning dataset into a preset zero-shot classification model, wherein the preset zero-shot classification model determines the prediction probability of each of the negative samples and the positive samples in the fine-tuning dataset through an activation function;
[0025] Calculating the loss of the predicted probability and the corresponding sample label;
[0026] The zero-shot classification model is fine-tuned according to the loss.
[0027] Optionally, build a fine-tuning dataset, including:
[0028] Performing a quality score based on the target classification label corresponding to the quality problem data determined by the zero-shot classification model; the quality score includes: valid, contradictory, and irrelevant;
[0029] Determine the target classification label and the corresponding quality problem data with the quality score as a positive sample; and add a sample label representing a high matching probability to the positive sample;
[0030] Determine the target classification labels and the corresponding quality problem data with contradictory or irrelevant quality scores as negative samples; and add sample labels representing low matching probabilities to the negative samples;
[0031] The positive samples and the negative samples are determined as a fine-tuning dataset.
[0032] Optionally, it also includes:
[0033] Storing the quality problem data and corresponding target classification labels in a database;
[0034] Acquire the quality problem data and corresponding target classification labels within a preset period from the database, and determine the problem distribution and common problems through statistical analysis;
[0035] Develop product improvement plans based on the problem distribution and common problems.
[0036] According to a second aspect of an embodiment of the present disclosure, a zero-sample classification apparatus is provided, including:
[0037] An acquisition module is used to obtain quality problem data and quality problem labels;
[0038] A first determining module is configured to determine a candidate tag set based on the quality problem tags;
[0039] An input module, configured to input the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data;
[0040] The second determination module is used to determine the target classification label according to the matching probability.
[0041] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the zero-sample classification method described in the first aspect are implemented.
[0042] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the zero-sample classification method described in the first aspect are implemented.
[0043] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of the zero-sample classification method as described in the first aspect.
[0044] The present disclosure classifies text through zero-shot learning, reducing the need for large amounts of labeled data and being able to adapt to newly emerging category labels, even if these labels have never appeared in the training data. By understanding the semantic association between text data and category labels, the zero-shot learning method improves the model's ability to recognize unknown categories. In environments where data is scarce or categories are variable, zero-shot learning provides an effective text classification method. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the description of the embodiments of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0046] Figure 1 1 is a schematic diagram of the steps of a zero-shot classification method according to an embodiment of the present disclosure;
[0047] Figure 2 is a zero-shot classification flow chart shown in an embodiment of the present disclosure;
[0048] Figure 3 is a schematic diagram of candidate tag screening shown in an embodiment of the present disclosure;
[0049] Figure 4 This is a statistical diagram of quality problem data classification shown in an embodiment of the present disclosure;
[0050] Figure 5 is a block diagram of a zero-shot classification device shown in an embodiment of the present disclosure;
[0051] Figure 6 is a schematic diagram of an electronic device shown in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0053] The terms "first", "second", etc. in the specification and claims of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present disclosure can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects related to each other are in an "or" relationship.
[0054] The automotive R&D and manufacturing sector needs to process quality issue data, including after-sales complaints and test reports from the production, R&D, and testing phases. Machine learning can be used to perform text classification on quality issue data. However, common machine learning classification methods typically require a large amount of data with known categories to build and train the model. Acquiring labeled data for any specific task or domain is a very expensive and time-consuming process. This is due to the large volume of quality issue data, making manual processing of each item a laborious task. Furthermore, typical automotive R&D databases define a wide variety of issue categories. Manually matching content to the corresponding issue category requires memorizing and frequently searching for available categories, which is a significant workload. Machine learning classification models cannot handle the large number of categories and small amounts of labeled data. Keyword-based methods cannot find synonyms or ambiguous semantics, resulting in low accuracy and a high rate of false positives. Furthermore, retraining is required when categories change, hindering business flexibility.
[0055] In order to solve the above technical problems, the present disclosure proposes a zero-sample classification method, which can classify text without any pre-labeled training samples. Therefore, text can be classified even in the absence of pre-labeled data.
[0056] Figure 1 This is a schematic diagram of the steps of a zero-sample classification method shown in an embodiment of the present disclosure. Figure 1 As shown, the zero-sample classification method may specifically include the following steps:
[0057] Step S11: Acquire quality problem data and quality problem labels.
[0058] Obtain quality problem data and quality problem labels from a database.
[0059] Quality problem data includes customer complaint records, production records, test records, etc. Quality problem data is collected from sources such as production lines, maintenance reports, and customer feedback. For example, Table 1 shows a display of quality problem data in a database according to an embodiment of the present disclosure.
[0060] Table 1 is an example of how quality problem data is displayed in the database.
[0061] User Reviews score The service attitude is very good! 10 points (very satisfied) I became a car owner in 28 days 9 points Overall, I am quite satisfied 10 points (very satisfied) Good service 10 points (very satisfied) Comfort and driving feel are very good 10 points (very satisfied) I just bought a new model a month ago, what should I do? 10 points (very satisfied) I bought the new M7 four-wheel drive smart driving version 6 points Powerful driving, comfortable cabin, and stylish appearance 9 points Details and services need improvement 8 points The car interior color is not as high-end as the brown interior 9 points
[0062] As shown in Table 1, users may have different comments on a product, as well as corresponding user ratings for the product. In their comments, users may rate various aspects of the product, including reviews of the service and certain aspects of the product. Based on user comments, one can get a sense of the user's satisfaction with the product. For example, a user commenting "the comfort and driving experience are both good" indicates that the user is very satisfied with the product, while a user commenting "details and service need improvement" indicates that the user feels the product is not good enough.
[0063] Quality issue labels are the result of expert annotation of vehicle parts across various stages of automotive R&D, production, supply, sales, and service during the R&D quality management process of an automotive company. For example, Table 2 shows a database display of quality issue labels in an embodiment of the present disclosure.
[0064] Table 2 is an example of the display of quality problem labels in the database
[0065]
[0066] As shown in Table 2, for each piece of quality problem data, the database uses multiple quality problem tags to more specifically analyze the data. For example, a user comment about "poor door material" would be labeled with the following quality problem tags: System-Interior, Mechanism-Door, Component-Door, Sentiment-Negative, and Core Area-Appearance. This allows for more detailed and multi-dimensional analysis of the quality problem data. By using multiple quality problem tags, the database can more accurately describe all aspects of the problem, helping the system or team better understand the root cause and impact of the problem.
[0067] Step S12: Determine a candidate tag set based on the quality problem tags.
[0068] A candidate tag set is determined by using all quality problem tags contained in the database. Each candidate tag in the candidate tag set represents a possible classification of the quality problem data.
[0069] Step S13: Input the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data.
[0070] The zero-shot classification model uses natural language processing techniques to extract key information and features from quality problem data, such as fault symptom descriptions and operating environment. The zero-shot classification model identifies the relationship between candidate labels and the key information corresponding to the quality problem data. The zero-shot classification model then outputs a matching probability for each candidate label, indicating the degree of match between the label and the problem data.
[0071] Step S14: Determine the target classification label based on the matching probability.
[0072] According to the matching probability of each candidate label, the candidate label that meets the matching probability requirement is determined and determined as the target classification label.
[0073] Using the embodiments of the present disclosure, zero-shot learning enables effective classification even for problem types not found in the training set, reducing reliance on large amounts of manually labeled data. This allows for rapid adaptation to new problem types without the need for re-labeling and retraining, particularly for new types of faults commonly encountered when new technologies or products are introduced. This reduces the need for data labeling and model retraining, lowering both time and financial costs, and improving problem response speed and processing efficiency. By deeply learning the semantic features of quality problem data, zero-shot classification methods can provide more accurate fault classification and diagnosis.
[0074] Among them, in an optional embodiment, the obtaining of quality problem data and quality problem labels includes: obtaining initial quality problem data and initial quality problem labels; performing prompt enhancement on the initial quality problem data and the initial quality problem labels to obtain the quality problem data and the quality problem labels; the prompt enhancement is used to: convert proprietary vocabulary into natural language expressions that can be understood by common sense.
[0075] A zero-shot classification model might not be trained on automotive industry terminology, but it does have strong common sense understanding capabilities. Therefore, it can be enhanced with Prompt to convert specialized vocabulary into common sense terms.
[0076] First, we can identify specialized or industry-specific terms from the initial quality issue data and labels and convert these proprietary terms into common natural language expressions. Specifically, we can use pre-defined vocabularies and natural language processing technologies to understand and convert terms, such as synonym replacement and semantic analysis.
[0077] The initial quality problem data and labels after prompt enhancement are then determined as quality problem data and labels. When these data and labels are fed into the zero-shot classification model, the zero-shot classification model can analyze them using common sense, avoiding the need for specialized vocabulary that may be present in these data and labels.
[0078] By using the embodiments of this disclosure, by converting quality problem data and labels into natural language representations, the classification performance of zero-shot classification models can be effectively improved. This enhances the model's ability to process diverse data types, particularly when dealing with new, unseen data. The model can better classify and identify issues by understanding semantically enhanced labels. By converting to common-sense language, the risk of misclassification due to improper understanding of terminology is reduced.
[0079] Figure 2 This is a zero-sample classification flow chart shown in an embodiment of the present disclosure. Figure 2 As shown, first obtain the initial quality problem data and the initial quality problem label; perform prompt enhancement on the initial quality problem data and the initial quality problem label respectively to obtain the initial quality problem label after prompt enhancement and the initial quality problem data after prompt enhancement, that is, the quality problem label and the quality problem data; then splice the quality problem labels and sentiment labels at different levels in the label system into natural language sentences to obtain candidate labels; input each candidate label and the quality problem data into the zero-shot classification model for zero-shot classification; obtain the probability distribution of each candidate label through the zero-shot classification model; screen the candidate labels through the probability distribution of the candidate labels; determine the target classification label through screening the candidate labels; store the quality problem data and the target classification label determined by the zero-shot classification model into the database.
[0080] Among them, in an optional embodiment, the label system to which the quality problem label belongs is a multi-level category; based on the quality problem label, a candidate label set is determined, including: randomly determining a target quality problem label from each layer of quality problem labels in the label system; obtaining a target emotional label, the target emotional label is: any one of: a good review, a bad review, and a medium review; the target emotional label and each of the target quality problem labels are spliced into a natural language sentence to obtain a candidate label in the candidate label set.
[0081] The label system corresponding to quality problem labels is a multi-level category. The top-level labels usually represent the broadest and most common quality problem categories, and the lower the level, the more specific and detailed the problems represented by the labels. For example, when the top-level problem label is "system", the corresponding sub-level problem labels for "system" include interior, exterior, service, and sales; when the top-level problem label is "organization", the corresponding sub-level problem labels for "organization" include "door"; when the top-level problem label is "component", the corresponding sub-level problem labels for "component" include "door", "door", and "handle". In addition, quality problem data can be summarized into a certain sentiment, including good reviews, bad reviews, and neutral reviews.
[0082] Target quality problem labels are selected from the label system in descending order. A superior quality problem label includes multiple subordinate quality problem labels. Each round of selection requires randomly selecting a label from the highest quality problem label to the lowest quality problem label. The randomly selected superior quality problem label must include the subordinate quality problem labels in the label system. The quality problem labels selected in a round are grouped together. When determining candidate labels, a candidate label is determined based on a set of quality problem data.
[0083] For example, a first target quality problem label is randomly selected from the top-level problem labels in the label system. Then, a second target quality problem label is randomly selected from the next-level problem labels corresponding to the first target quality problem label. This continues until the selected target quality problem label has no corresponding next-level problem label. This concludes the selection of quality problem labels, indicating that the bottom layer of the label system, i.e., the most specific and detailed quality problem classification, has been reached. At this point, the selection process stops. The first target quality problem label, the second target quality problem label, and any possible lower-level quality problem labels are all identified as target quality problem labels. These labels together form a path from broad to specific, accurately defining a specific quality problem.
[0084] When determining a set of target quality problem labels, a target sentiment label is randomly determined from the sentiment labels, where the sentiment labels include labels representing positive reviews, labels representing negative reviews, and labels representing neutral reviews.
[0085] A set of target quality labels and corresponding target sentiment labels are concatenated into a natural language sentence. During the concatenation process, the target quality labels can be concatenated in descending order within the labeling system. After concatenating the target quality labels, the concatenated target quality labels and target sentiment labels are concatenated. After concatenation, a candidate label is obtained from the candidate label set.
[0086] Using the disclosed embodiments, a multi-level category tagging system can more accurately identify and categorize various quality issues, helping companies better understand the specific categories and levels of issues. The addition of emotional tags helps companies assess product or service acceptance and user satisfaction from an emotional perspective. The automatically generated candidate tag sets can be directly used in report generation, quality monitoring systems, and customer service automated response systems, improving work efficiency and response speed.
[0087] Among them, in an optional embodiment, the target classification label is determined by the matching probability, including: determining the candidate label whose matching probability is greater than a decision threshold as the first candidate label; sorting the first candidate labels according to their respective matching probabilities, and determining the second candidate label from the top N first candidate labels with the highest matching probabilities, where N is an integer greater than 0; analyzing the matching probability of each of the second candidate labels to determine the dividing point where the matching probability drops significantly; the dividing point represents: the difference between the matching probability before the dividing point and the matching probability after the dividing point is greater than a difference threshold; and determining the target classification label from the second candidate labels based on the dividing point.
[0088] A decision threshold is pre-set. This threshold is determined based on the actual application scenario and data characteristics. It can be determined as follows: Decision threshold = Maximum value – r * Standard deviation, where r is typically in the range [0.9, 1, 1]. The decision threshold is a numerical limit used to determine which candidate tags are sufficiently relevant to warrant further consideration. Candidate tags with a matching probability greater than the decision threshold are determined as the first candidate tags.
[0089] The first candidate tags are then further screened and sorted in descending order by their matching probability. The top N tags with the highest matching probability after sorting are selected as the second candidate tags. The choice of N depends on the specific requirements and may be related to the size of the tag library and the required accuracy.
[0090] After determining the second candidate label, analyze the matching probability distribution of the second candidate label and look for a significant "cliff drop" dividing point. This can be achieved by comparing the matching probability differences of adjacent labels. For example, the absolute value of the difference between the matching probabilities of adjacent labels can be calculated. When the absolute value is greater than the difference threshold, it indicates that there is a large difference in the matching probability of the two adjacent labels, and the dividing point of the matching probability between the two adjacent labels is determined. The determination of the dividing point means that the label before the dividing point has a significantly higher matching degree with the input data than the label after the dividing point. Determine the final target classification label from all the second candidate labels before the dividing point. For example, the second candidate label with the highest matching probability can be selected as the target classification label.
[0091] By adopting the embodiments of the present disclosure, by setting a decision threshold and selecting the top N labels with the highest matching probability, labels that do not match the input data or have a low matching degree can be effectively filtered out, thereby improving the accuracy of classification. The introduction of the concept of a cutoff point where the matching probability drops significantly makes the classification results more robust to noise and outliers, and the analysis of the cutoff point provides an intuitive method to explain why certain labels are selected as target classification labels, which helps to improve the transparency of model decisions. When processing large-scale data or complex classification tasks, by limiting the number of candidate labels and quickly determining the cutoff point, the amount of calculation can be significantly reduced and the processing speed can be improved.
[0092] Figure 3 This is a schematic diagram of a candidate tag screening embodiment of the present disclosure. Figure 3 As shown in the figure, the quality problem data that needs to be zero-sample classified is "The exterior is majestic and calm, the interior contains high-tech intelligence, and the quality and cost performance of the whole vehicle are good! Thumbs up for Huawei and Seres!" For this quality text data, a series of candidate labels are determined through the quality problem label in this paper. Figure 5 Each candidate label in the graph has different content. For example, candidate label 1 is "Appearance: Positive, Nice Appearance," candidate label 2 is "Appearance: Positive, Nice Color," and candidate label 3 is "Exterior Accessories: Positive, Nice Overall Car Logo." The ordinate represents the matching probability. Based on the candidate label's position in the graph, the matching probability corresponding to each candidate label can be determined based on the ordinate. The larger the ordinate, the greater the matching probability of the candidate label. The candidate labels shown in the graph are not exhaustive. A candidate label is only displayed in the graph if its matching probability exceeds the decision threshold and is in the top N of the ranking. After the first two conditions are met, the matching probabilities corresponding to each candidate label in the graph are analyzed to determine the cutoff point where the matching probability significantly drops. For example, if the difference between the values corresponding to candidate label 2 and candidate label 3 on the ordinate in the graph is greater than the difference threshold, it is determined that there is a significant drop in the matching probabilities corresponding to candidate labels 2 and 3, respectively. This serves as the basis for determining the target classification label corresponding to the quality problem data from the candidate labels.
[0093] In an optional embodiment, the zero-sample classification model is obtained by fine-tuning in the following manner: constructing a fine-tuning dataset, the fine-tuning dataset including: adding positive samples with sample labels representing high matching probabilities and adding negative samples with sample labels representing low matching probabilities; importing the fine-tuning dataset into a preset zero-sample classification model, the preset zero-sample classification model determines the predicted probability of each negative sample and the positive sample in the fine-tuning dataset through an activation function; calculating the loss between the predicted probability and the corresponding sample label; and fine-tuning the zero-sample classification model based on the loss.
[0094] Construct a fine-tuning dataset. Each example in the dataset is a pair of quality-problem data and a target classification label. The fine-tuning dataset includes positive and negative examples. Positive examples indicate a match between the quality-problem data and the target classification label, while negative examples indicate a mismatch between the quality-problem data and the target classification label. Labels indicating a high probability of a match are added to positive examples, and labels indicating a low probability of a match are added to negative examples.
[0095] Choose a pre-trained zero-shot classification model as the basis for fine-tuning. The zero-shot classification model has a certain degree of classification ability and can classify or recognize the input to a certain extent without relying on specific category labels.
[0096] Import the fine-tuning dataset into the pre-set zero-shot classification model. Use the activation function to calculate the predicted probabilities for each negative and positive example in the fine-tuning dataset. Calculate the loss based on the predicted probabilities and the corresponding sample labels. The choice of loss function can be determined based on the specific task and data characteristics, such as cross-entropy loss or mean squared error loss. The purpose of the loss calculation is to measure the difference between the model's predictions and the true labels.
[0097] Fine-tune the zero-shot classification model based on the calculated loss value. Specifically, you can adjust the model parameters (such as weights and biases) to reduce the loss value, and update the model parameters through continuous iteration until the loss value converges to a lower level or reaches a preset number of iterations.
[0098] By using the embodiments of the present disclosure, by introducing a fine-tuning dataset and fine-tuning process, the zero-shot classification model can be made more adaptable to specific classification tasks and data characteristics. The fine-tuning process can be flexibly adjusted and optimized according to different datasets and task requirements. This enables the zero-shot classification model to adapt to a variety of classification tasks and data scenarios, improving the model's adaptability and flexibility.
[0099] In one optional embodiment, a fine-tuning dataset is constructed, including: performing quality scoring on the target classification label corresponding to the quality problem data determined by the zero-sample classification model; the quality scoring includes: validity, contradiction, and irrelevance; determining the target classification label with the quality score of validity and the corresponding quality problem data as positive samples; adding a sample label representing a high matching probability to the positive sample; determining the target classification label with the quality score of contradiction or irrelevant and the corresponding quality problem data as negative samples; adding a sample label representing a low matching probability to the negative sample; and determining the positive sample and the negative sample as a fine-tuning dataset.
[0100] When the zero-shot classification model determines the classification for the quality problem data, the quality problem data and its corresponding target classification label are stored in the database. Administrators and others regularly assess the quality of the classification results. This quality assessment helps construct a fine-tuning dataset.
[0101] The administrator's quality scores for the quality problem data classification results include valid, contradictory, and irrelevant; marked as valid, it means that the target classification label predicted by the model matches the actual situation of the quality problem data; marked as contradictory, it means that the target classification label predicted by the model does not match the actual situation of the quality problem data; marked as irrelevant, it means that the target classification label predicted by the model has no obvious correlation with the actual situation of the quality problem data.
[0102] When the administrator is performing quality scoring on the quality problem data classification results, he / she will mark whether the target classification label determined by the zero-sample classification model matches the corresponding quality problem data. If they match, the data pair of the target classification label and its corresponding quality problem data will be marked as valid, and used as a positive sample. The administrator will add a sample label representing a high matching probability to the data pair through the annotation of the data pair as a positive sample. If they do not match, the data pair of the target classification label and its corresponding quality problem data will be marked as contradictory or irrelevant, and used as a negative sample. The administrator will add a sample label representing a low matching probability to the data pair through the annotation of the data pair as a positive sample.
[0103] Negative samples and positive samples are determined as fine-tuning datasets to achieve the construction of fine-tuning datasets.
[0104] By directly fine-tuning the model's performance on specific data with quality issues, the disclosed embodiments can enhance the model's ability to identify similar situations, thereby improving classification accuracy. Explicit training on negative samples can help the model better identify and distinguish incorrect or irrelevant classification labels. This fine-tuning approach allows the model to quickly adapt to new data quality issues and is particularly suitable for application scenarios with large data quality fluctuations.
[0105] Among them, in an optional embodiment, the method also includes: storing the quality problem data and the corresponding target classification labels in a database; obtaining the quality problem data and the corresponding target classification labels within a preset period from the database, and determining the problem distribution and common problems through statistical analysis; and formulating product improvement plans based on the problem distribution and the common problems.
[0106] The quality problem data and its target classification label determined by the zero-shot classification model are stored as a data pair in the database for subsequent access and analysis.
[0107] According to the needs of the enterprise and the product life cycle, set an appropriate data analysis cycle, such as monthly or quarterly. Conduct a detailed statistical analysis of the collected data, including the frequency of problems, type distribution, trend changes, etc. Through statistical analysis, clarify which types of problems are most common, which problems are increasing, and the potential patterns that exist. Problems that occur frequently are usually identified as those that need to be solved as a priority. Based on the analysis results, formulate specific product improvement plans, including design changes, material replacements, process optimization, quality control standard upgrades, etc. Illustratively, Table 3 is a corresponding form of the target classification label corresponding to a quality problem data shown in an embodiment of the present disclosure in the database.
[0108] Table 3 is an example of the corresponding form of the target classification label corresponding to the quality problem data in the database
[0109] Quality problem data Target classification label Very satisfied in all aspects! Overall good experience Intelligent Good sense of technology Overall not bad, 4s... The overall service has room for improvement... Services (especially sales... Good service The smart system is great Good intelligent driving system If I give it 9 points, I hope to... Intelligent driving has room for improvement
[0110] Figure 4 This is a statistical diagram of quality problem data classification shown in the embodiment of the present disclosure. Figure 4 As shown, we can obtain quality problem data and its corresponding target classification labels from the database, and analyze the main problem distribution and common problems of the target product in the form of a bar chart. The bar chart can intuitively display the distribution of problems. Based on this, we can formulate targeted improvement plans for the product based on the problem distribution and common problems. For example, if the analysis shows that the quality problems of car door components are the most prominent, then we can focus on improving the design and production process of the car doors.
[0111] By using the embodiments of the present disclosure, the overall quality and performance of products can be gradually improved by systematically identifying and resolving quality issues in products. Improving common and significant quality issues identified in products can significantly increase customer satisfaction and loyalty. Using data-based methods to guide product improvement decisions makes these decisions more objective and effective. Periodic analysis provides an opportunity for companies to continuously learn and improve, allowing them to quickly adapt to market and technological changes.
[0112] Figure 5 This is a block diagram of a zero-sample classification device shown in an embodiment of the present disclosure. Figure 5 The zero-sample classification device includes:
[0113] An acquisition module 510 is used to acquire quality problem data and quality problem labels;
[0114] A first determining module 520 is configured to determine a candidate tag set based on the quality problem tags;
[0115] An input module 530 is configured to input the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data;
[0116] The second determination module 540 is configured to determine a target classification label based on the matching probability.
[0117] Optionally, the acquisition module is specifically configured to execute:
[0118] Obtaining initial quality problem data and initial quality problem labels;
[0119] Prompt enhancement is performed on the initial quality problem data and the initial quality problem label to obtain the quality problem data and the quality problem label; the prompt enhancement is used to convert proprietary vocabulary into natural language expressions that can be understood by common sense.
[0120] Optionally, the label system to which the quality problem label belongs is a multi-level category; the first determining module is specifically configured to execute:
[0121] Randomly determine a target quality problem label from each layer of quality problem labels in the label system;
[0122] Obtain a target sentiment label, wherein the target sentiment label is any one of: a positive review, a negative review, and a neutral review;
[0123] The target sentiment label and each target quality problem label are concatenated into a natural language sentence to obtain a candidate label in the candidate label set.
[0124] Optionally, the second determining module is specifically configured to execute:
[0125] Determine the candidate tag whose matching probability is greater than the decision threshold as the first candidate tag;
[0126] Sort the first candidate tags according to their respective matching probabilities, and determine the second candidate tags from the top N first candidate tags with the highest matching probabilities, where N is an integer greater than 0;
[0127] Analyzing the matching probabilities of the respective second candidate tags to determine a cutoff point at which the matching probabilities drop significantly; the cutoff point indicates that there is a significant difference between the matching probabilities before the cutoff point and the matching probabilities after the cutoff point;
[0128] According to the dividing point, a target classification label is determined from the second candidate labels.
[0129] Optionally, the device further comprises a fine-tuning device, wherein the fine-tuning device is used to:
[0130] Constructing a fine-tuning dataset, wherein the fine-tuning dataset includes: positive samples with sample labels representing high matching probabilities and negative samples with sample labels representing low matching probabilities;
[0131] Importing the fine-tuning dataset into a preset zero-shot classification model, wherein the preset zero-shot classification model determines the prediction probability of each of the negative samples and the positive samples in the fine-tuning dataset through an activation function;
[0132] Calculating the loss of the predicted probability and the corresponding sample label;
[0133] The zero-shot classification model is fine-tuned according to the loss.
[0134] Optionally, the fine-tuning device is specifically configured to perform:
[0135] Performing a quality score based on the target classification label corresponding to the quality problem data determined by the zero-shot classification model; the quality score includes: valid, contradictory, and irrelevant;
[0136] Determine the target classification label and the corresponding quality problem data with the quality score as a positive sample; and add a sample label representing a high matching probability to the positive sample;
[0137] Determine the target classification labels and the corresponding quality problem data with contradictory or irrelevant quality scores as negative samples; and add sample labels representing low matching probabilities to the negative samples;
[0138] The positive samples and the negative samples are determined as a fine-tuning dataset.
[0139] Optionally, the device further comprises:
[0140] A storage module, configured to store the quality problem data and corresponding target classification labels in a database;
[0141] A third acquisition module is used to obtain the quality problem data and corresponding target classification labels within a preset period from the database, and determine the problem distribution and common problems through statistical analysis;
[0142] A formulation module is used to formulate product improvement plans based on the problem distribution and the common problems.
[0143] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple. For relevant details, please refer to the method embodiment.
[0144] The present disclosure also provides an electronic device, Figure 6 , Figure 6 FIG is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 6 As shown, the electronic device 600 includes: a memory 610 and a processor 620. The memory 610 and the processor 620 are connected via a bus communication. A computer program is stored in the memory 610. The computer program can be run on the processor 620 to implement the steps in the zero-matching sample classification method disclosed in the embodiment of the present disclosure.
[0145] The embodiments of the present disclosure further provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps in the zero-shot classification method disclosed in the embodiments of the present disclosure are implemented.
[0146] The embodiments of the present disclosure further provide a computer program product, including a computer program. When the computer program is executed by a processor, the computer program implements the steps in the zero-shot classification method disclosed in the embodiments of the present disclosure.
[0147] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0148] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, apparatuses, or computer program products. Therefore, the embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0149] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, electronic devices, and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0150] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0152] Although some embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications that fall within the scope of the present disclosure.
[0153] The above is a detailed introduction to the zero-sample classification method, device, electronic device and storage medium provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method and core ideas of the present disclosure. At the same time, for those skilled in the art, according to the ideas of the present disclosure, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present disclosure.
Claims
1. A zero-shot classification method, characterized in that: include: Obtain quality problem data and quality problem labels; Determine a candidate label set according to the quality problem label; Inputting the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data; The target classification label is determined through the matching probability.
2. The method according to claim 1, characterized in that The obtaining of quality problem data and quality problem labels includes: Obtaining initial quality problem data and initial quality problem labels; The initial quality problem data and the initial quality problem label are enhanced with prompts to obtain the quality problem data and the quality problem label; the prompt enhancement is used to convert proprietary vocabulary into natural language expressions that can be understood by common sense.
3. The method according to claim 1, characterized in that The label system to which the quality problem label belongs is a multi-level category; according to the quality problem label, a candidate label set is determined, including: Randomly determine a target quality problem label from each layer of quality problem labels in the label system; Obtain a target sentiment label, wherein the target sentiment label is any one of a favorable review, a unfavorable review, and a neutral review; The target sentiment label and each of the target quality problem labels are concatenated into a natural language sentence to obtain a candidate label in the candidate label set.
4. The method according to claim 1, characterized in that: Determining the target classification label by using the matching probability includes: Determine the candidate tag whose matching probability is greater than the decision threshold as the first candidate tag; Sort the first candidate tags according to their respective matching probabilities, and determine the second candidate tags from the first N first candidate tags with the highest matching probabilities, where N is an integer greater than 0; Analyze the matching probabilities of the respective second candidate tags to determine a cutoff point at which the matching probabilities drop significantly; the cutoff point indicates that a difference between the matching probabilities before the cutoff point and the matching probabilities after the cutoff point is greater than a difference threshold; According to the dividing point, a target classification label is determined from the second candidate labels.
5. The method according to any one of claims 1 to 4, characterized in that: The zero-shot classification model is fine-tuned in the following way: Constructing a fine-tuning dataset, wherein the fine-tuning dataset includes: positive samples with sample labels representing high matching probabilities added and negative samples with sample labels representing low matching probabilities added; Importing the fine-tuning data set into a preset zero-shot classification model, wherein the preset zero-shot classification model determines the prediction probability of each of the negative samples and the positive samples in the fine-tuning data set through an activation function; Calculate the loss of the predicted probability and the corresponding sample label; The zero-shot classification model is fine-tuned according to the loss.
6. The method according to claim 5, characterized in that The constructing of the fine-tuning dataset includes: Performing a quality score based on the target classification label corresponding to the quality problem data determined by the zero-sample classification model; the quality score includes: valid, contradictory, and irrelevant; Determine the target classification label and the corresponding quality problem data with the quality score being established as positive samples; and add a sample label representing a high matching probability to the positive samples; Determine the target classification labels and the corresponding quality problem data whose quality scores are contradictory or irrelevant as negative samples; and add sample labels representing low matching probabilities to the negative samples; The positive samples and the negative samples are determined as a fine-tuning dataset.
7. The method according to claim 1, characterized in that Also includes: Storing the quality problem data and corresponding target classification labels in a database; Acquire the quality problem data and corresponding target classification labels within a preset period from the database, and determine the problem distribution and common problems through statistical analysis; Develop product improvement plans based on the problem distribution and common problems.
8. A zero-sample classification device, characterized in that: include: An acquisition module, used to acquire quality problem data and quality problem labels; A first determination module, configured to determine a candidate tag set according to the quality problem tags; An input module, used to input the candidate tag set and the quality problem data into a zero-shot classification model to obtain a matching probability of each candidate tag in the candidate tag set matching the quality problem data; The second determination module is used to determine the target classification label according to the matching probability.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the zero-sample classification method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the zero-shot classification method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Text data classification method and device, vehicle, storage medium and program product
CN120104803A