Classification model training method and device, electronic equipment and medium
By combining active learning and the generation ability of large models in the field of natural language processing, targeted generation of enhanced data is solved, and the problem of high cost of obtaining labeled data and lack of targeted data enhancement is achieved, and the effect of improving the generalization ability of the model is achieved.
Patent Information
- Application Number
- CN202411975312.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-09
AI Technical Summary
In the field of natural language processing, the existing technology faces high costs and time consumption when acquiring a large amount of labeled data to train a classification model, and the data enhancement method lacks targetedness, which affects the generalization ability of the model.
Active learning strategies are used to identify the weak points of the model, and through the generation ability of the big model, high-quality augmented data is generated in a targeted manner, combining active learning and the strong understanding and generation ability of the big model to enhance data.
It improves the pertinence and effectiveness of data enhancement, reduces the cost of manual labeling, and improves the generalization ability of the model.
Smart Images

Figure CN119961720A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, in particular to the fields of natural language processing, deep learning, and large model technology, and specifically to a classification model training method, device, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0003] Machine learning, deep learning, and emerging large language models (LargeLanguage Models) around natural language understanding and processing all require a large amount of labeled data. The so-called labeled data refers to the specific situation of the relevant information (including location, cause, reasoning logic, etc.) clearly indicated in the output according to the task requirements for the given task data. The effect of the model mainly depends on the quality and scale of the training data. In order to continuously improve the effect of the model, it is necessary to continuously iterate the training data, construct the training data based on real data, and periodically train the model to achieve continuous improvement in the model effect.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a classification model training method, device, electronic device, computer-readable storage medium and computer program product.
[0006] According to one aspect of the present disclosure, a classification model training method is provided, comprising: obtaining a pre-trained classification model, and performing a first operation to train the classification model, wherein the first operation comprises the following steps: obtaining a first sample set, wherein the first sample set comprises a plurality of sample data under one or more prediction categories, wherein the plurality of sample data comprises at least one of text, speech, and picture to be recognized; inputting the plurality of sample data into the classification model respectively to obtain prediction values output by the classification model for the categories to which the plurality of sample data respectively belong; determining the uncertainty of the classification model for each of the plurality of sample data based on the prediction values, wherein the uncertainty represents the degree of confidence of the classification model for the prediction result corresponding to the corresponding sample data; determining at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set; obtaining a first preset instruction based on at least one sample data in the second sample set; obtaining a plurality of new sample data through a first language model based on the first preset instruction, wherein the plurality of new sample data and the at least one sample data are of the same prediction category; and training the classification model based on the new sample data to obtain a trained classification model.
[0007] According to another aspect of the present disclosure, a classification model training device is provided, comprising: a first acquisition unit, configured to acquire a pre-trained classification model and perform a first operation to train the classification model, wherein the first operation is implemented by operations performed by the following units: a second acquisition unit, configured to acquire a first sample set, wherein the first sample set includes a plurality of sample data under one or more prediction categories, wherein the plurality of sample data include at least one of text, speech, and picture to be recognized; a first input unit, configured to input the plurality of sample data into the classification model respectively to obtain prediction values output by the classification model for the categories to which the plurality of sample data respectively belong; a first determination unit, configured to determine the predicted values based on the predicted values. The uncertainty of the classification model for each of the multiple sample data, wherein the uncertainty represents the confidence level of the classification model for the prediction result corresponding to the corresponding sample data; a second determination unit, configured to determine at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set; a third acquisition unit, configured to obtain a first preset instruction based on at least one sample data in the second sample set; a second input unit, configured to obtain a plurality of new sample data through a first language model based on the first preset instruction, wherein the plurality of new sample data and the at least one sample data are of the same prediction category; and a training unit, configured to train the classification model based on the new sample data to obtain a trained classification model.
[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the present disclosure.
[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method described in the present disclosure.
[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method described in the present disclosure when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, active learning strategies are fully utilized to identify the weaknesses of the model, and with the help of the powerful generation capabilities of large models, high-quality enhanced data is generated in a targeted manner, thereby improving the targetedness and effect of data enhancement, while reducing the cost of manual labeling and improving the generalization ability of the model.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;
[0015] Figure 2 A flow chart of a classification model training method according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A structural block diagram of a classification model training device according to an embodiment of the present disclosure is shown; and
[0017] Figure 4 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0018] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0019] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0020] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0021] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0022] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
[0023] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the method of model training to be performed.
[0024] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0025] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0026] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to input user instructions or receive information, etc. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.
[0027] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.
[0028] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0029] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0030] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0031] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0032] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0033] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as sample data. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.
[0034] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0035] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.
[0036] With the rapid development of deep learning and artificial intelligence technology, large-scale pre-trained models (such as GPT) have achieved outstanding results in fields such as natural language processing. These large models have demonstrated powerful understanding and generation capabilities with their massive parameters, large-scale training data, and complex network structures.
[0037] In practical applications, obtaining a large amount of labeled data to train text classification models often faces the problem of high cost and time consumption. At the same time, the diversity and dynamics of data distribution in the real world also bring challenges to improving the generalization ability of the model. In order to alleviate the lack of data and improve the generalization effect of the model, data augmentation technology is widely used, which expands the training set by transforming existing data or generating new synthetic data. However, traditional data augmentation methods (such as simple vocabulary replacement, sentence reorganization, etc.) are often lack of pertinence and cannot fully utilize the potential information of existing data. The enhanced data may be greatly different from the data distribution in the real world, and may even introduce noise, affecting the performance of the model. On the other hand, active learning, as an effective strategy, can significantly improve the performance of the model at a limited annotation cost by allowing the model to actively select the samples that are most helpful to improve its effect. How to effectively combine the idea of active learning and the powerful understanding and generation capabilities of large models, give full play to the advantages of both, and conduct data augmentation that is more extensive and closer to the real-world data distribution, thereby optimizing the model and improving its effect, is a technical point worth studying.
[0038] Therefore, according to an embodiment of the present disclosure, a classification model training method is provided. Figure 2 A flow chart of a model training method according to an embodiment of the present disclosure is shown, Figure 2 As shown, method 200 includes: obtaining a pre-trained classification model and performing a first operation to train the classification model (step 210), wherein the first operation includes the following steps: obtaining a first sample set, wherein the first sample set includes a plurality of sample data under one or more prediction categories, wherein the plurality of sample data includes at least one of text, speech, and picture to be recognized (step 220); inputting the plurality of sample data into the classification model respectively to obtain prediction values output by the classification model for the categories to which the plurality of sample data respectively belong (step 230); determining the uncertainty of the classification model for each of the plurality of sample data based on the prediction values; The method further comprises: determining an uncertainty, wherein the uncertainty represents the confidence level of the classification model for the prediction result corresponding to the corresponding sample data (step 240); determining at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set (step 250); obtaining a first preset instruction based on at least one sample data in the second sample set (step 260); obtaining a plurality of new sample data through a first language model based on the first preset instruction, wherein the plurality of new sample data and the at least one sample data are of the same prediction category (step 270); and training the classification model based on the new sample data to obtain a trained classification model (step 280).
[0039] According to the embodiments of the present disclosure, active learning strategies are fully utilized to identify the weaknesses of the classification model, and with the help of the powerful generation capabilities of the large model, high-quality enhanced data is generated in a targeted manner, thereby improving the targetedness and effect of data enhancement, while reducing the cost of manual labeling and improving the generalization ability of the classification model.
[0040] In the present disclosure, the model may be a classification model. In some examples, the model may be a classification model, and its input data may be text, speech, pictures, etc. to be recognized. The model may determine which category the input text, speech, pictures, etc. belongs to, for example, the model outputs the probability that the corresponding input belongs to the corresponding category. In some examples, when the input is in the form of speech, the speech may be converted into text by speech recognition technology to obtain corresponding output information.
[0041] In some examples, the model can be used for text classification tasks, such as sentiment detection and intent analysis. The text classification problem is a basic problem in natural language processing, which aims to predict the label of a sentence based on semantics. When the model is trained on these discriminatory sample data sets, it will also learn these discriminatory patterns, thereby generating prediction results on whether it is discriminatory or what type of discrimination it is.
[0042] In some examples, the predicted category may be the category of the input text, audio, or image that the classification model is used to identify. For example, in a text classification task, the predicted category may include positive, negative, neutral, etc., to represent the emotional tendency of the input text.
[0043] In the present disclosure, the classification model is a pre-trained model. For example, the target classification model (eg, text classification model BERT) can be trained with an initial annotated sample data set to obtain an initial model M0.
[0044] In some embodiments, the plurality of sample data are respectively input into the classification model to obtain the prediction values output by the classification model for each of the plurality of sample data; and the uncertainty of the model for the category to which each of the plurality of sample data belongs is determined based on the prediction values. The uncertainty represents the degree of confidence of the classification model in the prediction result corresponding to the corresponding sample data. For example, when the prediction value output by the model is the probability value of the corresponding sample data belonging to a certain prediction category, the uncertainty may be negatively correlated with the probability value.
[0045] In this embodiment, the uncertainty of the model for the category to which each sample data belongs is obtained based on the predicted value to determine the weak points of the model, that is, which type of sample data the model has a poor recognition effect on. Therefore, the corresponding new sample data is generated in a targeted manner through the first language model in the future, so as to strengthen the weak points of the model through the new sample data, thereby improving the performance and training effect of the model.
[0046] In some examples, the unlabeled sample set D unlabeled (i.e. the first sample set) inputs the classification model M0 to obtain the prediction output and uncertainty of the model for each sample data. Uncertainty is generally defined based on the uncertainty probability of the model's prediction of the sample data. For example, for the BERT classification model, an uncertainty calculation method can be defined: U = 1-p top1 , where U represents the uncertainty, p top1 Represents the probability of the model predicting the most likely category. Based on the model's prediction results, the uncertainty of the model on different samples is evaluated.
[0047] It will be appreciated that other suitable methods for determining the uncertainty are possible, for example No limitation is imposed here.
[0048] In some examples, it is possible to unlabeled Select the sample data with higher uncertainty to obtain the second sample set S t At this time, the second sample set W t The prediction category corresponding to the sample data in is the category for which the model has a poor prediction effect (i.e., the weak point of the model).
[0049] In some examples, a first preset instruction is obtained based on at least one sample data in the second sample set. That is, the first preset instruction is designed based on the at least one sample data so that the first language model can clarify the weaknesses of the target model, so as to generate sample data that conforms to the distribution of the weak risk points of the target model using the first language model.
[0050] In some embodiments, the first language model is obtained by training based on at least knowledge resources and dialogue data of a preset scale.
[0051] In some embodiments, the first language model can be a knowledge-enhanced large language model for conversation (such as ERNIE bot, etc.), and the first language model is trained through massive knowledge resources and conversation data (for example, including more than trillions of web page data, billions of search data, hundreds of millions of image data, billions of voice request data per day, more than 50 billion text request data, and more than 550 billion factual knowledge).
[0052] Therefore, by applying this type of model as the first language model, in addition to directly processing small talk dialogue information, it can also directly generate reply information for logical reasoning, common sense, and image generation dialogue information, which can further improve the generation efficiency while generating higher quality reply information.
[0053] In some examples, the first preset instruction may be, for example, an instruction for guiding the first language model to generate sample data so that the sample data is generated in a specific form (eg, in a list or table form).
[0054] In some examples, the first preset instruction may include a description and requirements of the target task to clarify the task and data generation requirements of the first language model. The first preset instruction may include the at least one sample data, so that by providing the sample data, the data distribution generated by the first language model is similar to the expected weak risk sample data.
[0055] In some examples, the first language model may be called multiple times to obtain enough new sample data. For example, the second sample set S t The sample data in may correspond to multiple prediction categories. Therefore, for each prediction category, based on the second sample set S t The first preset instruction is designed for the sample data under the prediction category in the prediction set to generate sample data that conforms to the prediction category using the first language model. In addition, under each prediction category, the first language model can be called once or multiple times to obtain enough new sample data. The generated new sample data can form a new sample set G t .
[0056] Therefore, through the first language model and the first preset instruction generated based on at least one sample data in the second sample set, the first language model fully understands the demand and fully learns the characteristics of the at least one sample data to generate multiple new sample data under the corresponding prediction category, so as to enrich the training data of the above-mentioned classification model and ensure the diversity of the subject, thereby improving the training effect and recognition performance of the subsequent classification model.
[0057] According to some embodiments, training the classification model based on the new sample data to obtain a trained classification model includes: labeling the new sample data through a second language model to obtain the labeled new sample data; and training the classification model based on the labeled new sample data to obtain the trained classification model.
[0058] In some examples, for the generated new sample set G t, the second language model can be used for automatic annotation to obtain a new sample set of the annotated data set
[0059] In some examples, Perform manual quality assessment to filter out samples that do not meet quality standards, ensure data accuracy, and obtain annotated high-quality sample data sets
[0060] According to some embodiments, the method further includes: labeling the plurality of sample data in the first sample set by using the second language model to obtain the labeled first sample set; and training the classification model based on the labeled first sample set to obtain a trained classification model.
[0061] In some embodiments, the second language model can be a knowledge-enhanced large language model for conversation (such as ERNIE bot, etc.), which is trained through massive knowledge resources and conversation data (for example, including more than trillions of web page data, billions of search data, hundreds of millions of image data, billions of voice request data per day, more than 50 billion text request data, and more than 550 billion factual knowledge).
[0062] Therefore, applying this type of model as a second language model, in addition to directly processing small talk dialogue information, can also directly generate reply information for logical reasoning, common sense, and image generation dialogue information, which can further improve generation efficiency while generating higher quality reply information.
[0063] It can be understood that the first and second language models can be the same language model or different language models, which is not limited here.
[0064] In some examples, the sample set can be With the existing training sample set D unlabeled Combined, we get a new training sample set use Train model M0 to obtain model M1.
[0065] In the above embodiment, automatic labeling of sample data is achieved based on the second language model. The labeling efficiency of sample data is improved through automatic data labeling of the large model, and the consistency of data labeling is guaranteed, thereby improving the optimization iteration speed of the classification model.
[0066] According to some embodiments, the method further includes: in response to determining that the trained classification model does not meet preset requirements, iteratively performing the first operation.
[0067] Specifically, after obtaining the model M1 as described above, a new first sample set can be obtained to determine the new weaknesses of the model M1 based on the new first sample set, so as to generate new sample data that conforms to the new weak point distribution using the first language model. Based on the new sample data, the model M1 is continuously trained to obtain the model M2... until the model M2 is obtained after multiple iterations. t Meet the preset requirements.
[0068] According to some embodiments, the preset requirement includes at least one of the following items: the accuracy of the trained classification model on a preset test sample set reaches a preset accuracy, and the first operation is iteratively executed for a maximum number of iterations.
[0069] In some examples, the final model M can be evaluated on an independent test set t The performance of the model can be verified to ensure that it meets the requirements of practical applications. The model can be deployed in the actual environment to observe its operating effect and further optimize it as needed.
[0070] According to the embodiments of the present disclosure, active learning strategies are fully utilized to identify the weaknesses of the model, and with the help of the powerful generation capabilities of the large language model, high-quality enhanced data is generated in a targeted manner. At the same time, the large language model is used for auxiliary annotation, which effectively improves the targeting and effect of data enhancement, while reducing the cost of manual annotation and improving the generalization ability of the model.
[0071] According to the embodiments of the present disclosure, it is applicable to model training and optimization in the fields of natural language processing, such as text classification models, content review models, etc. In particular, in the fields of social networks, instant messaging, user-generated content platforms, etc., the method described in the embodiments of the present disclosure can effectively and specifically enhance data and improve model effects; help content review models to achieve rapid iteration and effect improvement, and improve their accuracy in identifying harmful information, for example.
[0072] According to the embodiments of the present disclosure, Figure 3As shown, a classification model training device 300 includes: a first acquisition unit 310, configured to acquire a pre-trained classification model and perform a first operation to train the classification model, wherein the first operation is implemented by operations performed by the following units: a second acquisition unit 320, configured to acquire a first sample set, wherein the first sample set includes a plurality of sample data under one or more prediction categories, wherein the plurality of sample data includes at least one of text, speech, and picture to be recognized; a first input unit 330, configured to input the plurality of sample data into the classification model respectively to obtain prediction values output by the classification model for the categories to which the plurality of sample data respectively belong; a first determination unit 340, configured to determine the classification model based on the prediction values The model comprises an uncertainty for each of the multiple sample data, wherein the uncertainty represents the confidence level of the classification model for the prediction result corresponding to the corresponding sample data; a second determination unit 350 is configured to determine at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set; a third acquisition unit 360 is configured to obtain a first preset instruction based on at least one sample data in the second sample set; a second input unit 370 is configured to obtain a plurality of new sample data through a first language model based on the first preset instruction, wherein the plurality of new sample data and the at least one sample data are of the same prediction category; and a training unit 380 is configured to train the classification model based on the new sample data to obtain a trained classification model.
[0073] According to some embodiments, the training unit includes: a unit for labeling the new sample data through a second language model to obtain the labeled new sample data; and a unit for training the classification model based on the labeled new sample data to obtain a trained classification model.
[0074] According to some embodiments, the method further includes: a unit for labeling the plurality of sample data in the first sample set by using the second language model to obtain the labeled first sample set; and a unit for training the classification model based on the labeled first sample set to obtain a trained classification model.
[0075] According to some embodiments, the further comprising: a unit for iteratively performing the first operation in response to determining that the trained classification model does not meet preset requirements.
[0076] According to some embodiments, the preset requirement includes at least one of the following items: the accuracy of the trained classification model on a preset test sample set reaches a preset accuracy, and the first operation is iteratively executed for a maximum number of iterations.
[0077] Here, the operations of the above-mentioned units 310-380 of the model training device 300 are similar to the operations of the steps 210-280 described above, and will not be repeated here.
[0078] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0079] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.
[0080] refer to Figure 4 , a block diagram of an electronic device 400 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0081] like Figure 4 As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0082] Multiple components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 can be any type of device that can input information to the electronic device 400. The input unit 406 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 407 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 408 can include but is not limited to a disk, an optical disk. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0083] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).
[0084] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0085] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0086] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0088] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0089] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0090] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0091] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A classification model training method, comprising: Obtain a pre-trained classification model, and perform a first operation to train the classification model, wherein the first operation includes the following steps: Acquire a first sample set, wherein the first sample set includes a plurality of sample data under one or more prediction categories, wherein the plurality of sample data includes at least one of text, speech, and picture to be recognized; Inputting the plurality of sample data into the classification model respectively to obtain prediction values output by the classification model for the categories to which the plurality of sample data respectively belong; Determining the uncertainty of the classification model for each of the plurality of sample data based on the prediction value, wherein the uncertainty represents the confidence level of the prediction result corresponding to the corresponding sample data by the classification model; Determine at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set; Based on at least one sample data in the second sample set, obtaining a first preset instruction; Based on the first preset instruction, obtaining a plurality of new sample data through the first language model, wherein the plurality of new sample data and the at least one sample data are of the same prediction category; and The classification model is trained based on the new sample data to obtain a trained classification model.
2. The method of claim 1, wherein: Training the classification model based on the new sample data to obtain a trained classification model includes: Annotating the new sample data by using a second language model to obtain the annotated new sample data; and The classification model is trained based on the labeled new sample data to obtain a trained classification model.
3. The method according to claim 1 or 2, further comprising: Annotating the plurality of sample data in the first sample set by using the second language model to obtain the annotated first sample set; as well as The classification model is trained based on the labeled first sample set to obtain a trained classification model.
4. The method of claim 1, wherein: Also includes: In response to determining that the trained classification model does not meet preset requirements, the first operation is iteratively performed.
5. The method of claim 4, wherein: The preset requirement includes at least one of the following items: the accuracy of the trained classification model on a preset test sample set reaches a preset accuracy, and the first operation is iteratively executed for a maximum number of iterations.
6. A classification model training device, comprising: A first acquisition unit is configured to acquire a pre-trained classification model and perform a first operation to train the classification model, wherein the first operation is implemented by operations performed by the following units: A second acquisition unit is configured to acquire a first sample set, wherein the first sample set includes a plurality of sample data under one or more prediction categories, wherein the plurality of sample data includes at least one of text, speech, and picture to be recognized; A first input unit is configured to input the plurality of sample data into the classification model respectively, so as to obtain the prediction values output by the classification model for the categories to which the plurality of sample data respectively belong; A first determining unit is configured to determine the uncertainty of the classification model for each of the plurality of sample data based on the prediction value, wherein the uncertainty represents the confidence level of the prediction result corresponding to the corresponding sample data by the classification model; A second determining unit is configured to determine at least one sample data whose uncertainty is greater than a preset value to obtain a second sample set; A third acquisition unit, configured to obtain a first preset instruction based on at least one sample data in the second sample set; a second input unit configured to obtain a plurality of new sample data through a first language model based on the first preset instruction, wherein the plurality of new sample data and the at least one sample data are of the same prediction category; and The training unit is configured to train the classification model based on the new sample data to obtain a trained classification model.
7. The device according to claim 6, wherein: The training unit comprises: A unit for labeling the new sample data by using a second language model to obtain the labeled new sample data; and A unit for training the classification model based on the labeled new sample data to obtain a trained classification model.
8. The device according to claim 6 or 7, further comprising: a unit configured to label the plurality of sample data in the first sample set by using the second language model to obtain the labeled first sample set; as well as A unit for training the classification model based on the labeled first sample set to obtain a trained classification model.
9. The device according to claim 6, wherein: Also includes: A unit for iteratively performing the first operation in response to determining that the trained classification model does not meet a preset requirement.
10. The device of claim 9, wherein: The preset requirement includes at least one of the following items: the accuracy of the trained classification model on a preset test sample set reaches a preset accuracy, and the first operation is iteratively executed for a maximum number of iterations.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
13. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Cited By
Model training method and device, electronic equipment and storage medium
CN121434770A