WO2022142010A1 - 一种非均衡样本的分类方法、装置、设备及存储介质 - Google Patents

一种非均衡样本的分类方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022142010A1
WO2022142010A1 PCT/CN2021/090432 CN2021090432W WO2022142010A1 WO 2022142010 A1 WO2022142010 A1 WO 2022142010A1 CN 2021090432 W CN2021090432 W CN 2021090432W WO 2022142010 A1 WO2022142010 A1 WO 2022142010A1
Authority
WO
WIPO (PCT)
Prior art keywords
corpus
classification model
classification
initial
training corpus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/090432
Other languages
English (en)
French (fr)
Inventor
陈昊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2022142010A1 publication Critical patent/WO2022142010A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Definitions

  • the present application belongs to the technical field of artificial intelligence, and specifically relates to a classification method, device, equipment and storage medium for non-equilibrium samples.
  • the purpose of the embodiments of the present application is to propose a classification method, device, computer equipment and storage medium for unbalanced samples, so as to solve the problem that the classification process of the existing biased data set classification method is complicated and the classification accuracy cannot meet the requirements. technical issues.
  • the embodiment of the present application provides a method for classifying unbalanced samples, which adopts the following technical solutions:
  • a classification method for unbalanced samples including:
  • training corpus from a preset corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus;
  • the preset first classification model is trained by the first training corpus to obtain the initial first classification model
  • the loss function of the initial first classification model is adjusted based on the preset adjustment rules, the second training corpus is imported into the initial first classification model after the loss function is adjusted, and the initial first classification model is iteratively updated based on the back-propagation algorithm, get the first classification model;
  • the corpus classification instruction is received, the corpus to be classified corresponding to the corpus classification instruction is obtained, and the corpus to be classified is classified by the first classification model.
  • the language type of the training corpus is the first language
  • the method further includes:
  • the training corpus is translated into the second language, wherein, under the language environment of the second language, the corpus similarity between the first training corpus and the second training corpus is less than the preset Similarity threshold.
  • the preset first classification model includes an encoding layer and a decoding layer
  • the steps of training the preset first classification model through the first training corpus to obtain the initial first classification model specifically include:
  • the preset first classification model is iterated based on the feature mapping result to obtain an initial first classification model.
  • steps of iterating the preset first classification model based on the feature mapping result to obtain the initial first classification model specifically include:
  • the preset first classification model is iterated based on the mapping error and the back-propagation algorithm to obtain an initial first classification model.
  • the loss function of the initial first classification model is adjusted based on the preset adjustment rules
  • the second training corpus is imported into the initial first classification model after the loss function is adjusted
  • the initial first classification model is adjusted based on the back-propagation algorithm.
  • the steps of iterative update to obtain the first classification model include:
  • a first classification model with a classification error greater than a preset classification error threshold is output.
  • the loss function of the initial first classification model is adjusted based on the preset adjustment rules
  • the second training corpus is imported into the initial first classification model after the loss function is adjusted
  • the initial first classification model is adjusted based on the back-propagation algorithm.
  • the second classification model is iteratively updated based on the result of the convolution operation, and the trained second classification model is output.
  • steps of iteratively updating the second classification model based on the result of the convolution operation, and outputting the trained second classification model specifically include:
  • the loss function of the second classification model is constructed based on the cross entropy loss function and the Levenstein distance function, and an initial third loss function is obtained, wherein the initial third loss function includes the cross entropy factor and the Levenstein factor;
  • the operation error of the convolution operation result is calculated by the third loss function, and the second classification model is iteratively updated by the back propagation algorithm based on the operation error, and the trained second classification model is obtained.
  • the embodiment of the present application also provides a classification device for unbalanced samples, which adopts the following technical solutions:
  • An apparatus for classifying unbalanced samples comprising:
  • a corpus acquisition module used for acquiring training corpus from a preset corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus;
  • a first model training module configured to train a preset first classification model through the first training corpus to obtain an initial first classification model
  • the reverse training module is used to adjust the loss function of the initial first classification model based on the preset adjustment rules, import the second training corpus into the initial first classification model after the loss function is adjusted, and based on the back-propagation algorithm, the initial first classification model is adjusted.
  • a classification model is iteratively updated to obtain a first classification model;
  • the corpus classification module is used for receiving the corpus classification instruction, acquiring the corpus to be classified corresponding to the corpus classification instruction, and classifying the corpus to be classified by the first classification model.
  • the embodiment of the present application also provides a computer device, which adopts the following technical solutions:
  • a device is characterized in that it includes a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the processor executes the computer-readable instructions, the steps of the above-mentioned method for classifying unbalanced samples are implemented.
  • the embodiments of the present application also provide a computer-readable storage medium, which adopts the following technical solutions:
  • a computer-readable storage medium characterized in that the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, implements the steps of the above-described method for classifying unbalanced samples.
  • the present application discloses a classification method, device, equipment and storage medium for unbalanced samples, belonging to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first The training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus.
  • the initial first classification model is obtained through training on the minority class training corpus, and the loss function of the initial first classification model is reversed through preset adjustment rules, and then Import the training corpus of the majority class into the initial first classification model after the loss function is reversed, and iterate the initial first classification model to obtain the first classification model, obtain the corpus to be classified, and classify the corpus to be classified through the first classification model.
  • the loss function of the classification model is reversed through the preset adjustment rules, and then an exclusive classification model is obtained by training.
  • the classification model can only respond to the corresponding data type of the training corpus of a few types. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • FIG. 1 shows an exemplary system architecture diagram to which the present application can be applied
  • FIG. 2 shows a flowchart of an embodiment of a method for classifying unbalanced samples according to the present application
  • FIG. 3 shows a schematic structural diagram of an embodiment of an apparatus for classifying unbalanced samples according to the present application
  • FIG. 4 shows a schematic structural diagram of an embodiment of a computer device according to the present application.
  • the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 .
  • the network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 .
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like.
  • Various communication client applications may be installed on the terminal devices 101 , 102 and 103 , such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and the like.
  • the terminal devices 101, 102, and 103 can be various electronic devices that have a display screen and support web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, dynamic Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) Players, Laptops and Desktops, etc.
  • MP3 players Moving Picture Experts Group Audio Layer III, dynamic Picture Experts Compression Standard Audio Layer 3
  • MP4 Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4
  • the server 105 may be a server that provides various services, such as a background server that provides support for the pages displayed on the terminal devices 101 , 102 , and 103 .
  • the method for classifying unbalanced samples provided by the embodiments of the present application is generally performed by a server, and accordingly, a device for classifying unbalanced samples is generally set in the server.
  • terminal devices, networks and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.
  • FIG. 2 there is shown a flowchart of one embodiment of a method for classifying non-equilibrium samples according to the present application.
  • the method for classifying unbalanced samples includes the following steps:
  • S201 Acquire training corpus from a preset corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus.
  • the training corpus is obtained from a preset corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus.
  • the training corpus of the majority class may reach more than 100,000 pieces, and the training corpus of the minority class may have only 10 pieces.
  • the training corpus can be any language corpus.
  • the training corpus is a Chinese corpus.
  • the classification accuracy of the classification model trained by setting the classification weight and then randomly combining the majority class training corpus and the minority class training corpus may not meet the requirements. Accurate classification is achieved.
  • an exclusive classification model is obtained through training.
  • the classification model can only respond and output corresponding data types corresponding to the training corpus of a few classes, but cannot respond to the data types corresponding to the training corpus of most classes. , which improves the accuracy of the unbalanced sample classification model.
  • the preset first classification model may be a classic transformer model, and the transformer model is first trained through a minority class training corpus to obtain an initial first classification model.
  • the transformer model structure includes an encoder (coding layer) and a decoder (decoding layer).
  • the corpus features of the minority training corpus are extracted through the coding layer, and the corpus features are vector-coded to obtain a feature vector, and the feature vector is mapped with the feature labels pre-stored in the decoding layer to obtain the feature mapping result.
  • the preset first classification model is iterated to obtain an initial first classification model, which can respond and output corresponding data types corresponding to the training corpus of the minority class.
  • adjusting the loss function of the initial first classification model based on the preset adjustment rule refers to reversing the loss function of the initial first classification model.
  • the loss function of the initial first classification model that is, the first loss function is L 1
  • the loss function L 2 of the initial first classification model after inversion is 1-L 1 .
  • the loss function of the initial first classification model is reversed based on the preset adjustment rules, and the training corpus of the majority class is imported into the initial first classification model after the loss function is reversed, and Based on the back-propagation algorithm, the initial first classification model after the inversion of the loss function is reversely iterated to obtain the first classification model, that is, the reversed loss function is used to encourage the initial first classification model to move towards the direction of excluding most classes of training corpus Learning to obtain an exclusive first classification model.
  • the first classification model cannot respond to the data type corresponding to the majority class training corpus.
  • the minority class training corpus corresponds to the data type and the majority class training corpus corresponds to the data type, which improves the performance. Accuracy of unbalanced sample classification models.
  • S204 Receive the corpus classification instruction, acquire the corpus to be classified corresponding to the corpus classification instruction, and classify the corpus to be classified by the first classification model.
  • the corpus to be classified corresponding to the corpus classification instruction is obtained, and the corpus to be classified is classified by the trained first classification model. If there is no output from the first classification model, it is considered that the input corpus belongs to the data type corresponding to the majority class data. If the first classification model has output, it is considered that the input corpus belongs to the data type corresponding to the minority class data, and the minority class training corpus through the first classification model corresponds to the data type. The data type and the majority class training corpus correspond to the data type.
  • the electronic device for example, the server/terminal device shown in FIG. 1
  • the electronic device on which the method for classifying unbalanced samples runs can receive the corpus classification instruction through a wired connection or a wireless connection.
  • the above wireless connection methods may include but are not limited to 3G/4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future .
  • the present application discloses a method for classifying unbalanced samples, belonging to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus, and the first training corpus is a minority class training corpus , the second training corpus is the majority class training corpus, the initial first classification model is obtained by training the minority class training corpus, the loss function of the initial first classification model is reversed through the preset adjustment rules, and then the majority class training corpus is imported into the loss
  • the initial first classification model after the function inversion is performed, and the initial first classification model is iterated to obtain the first classification model, the corpus to be classified is obtained, and the corpus to be classified is classified by the first classification model.
  • the loss function of the classification model is reversed through the preset adjustment rules, and then an exclusive classification model is obtained by training.
  • the classification model can only respond to the corresponding data type of the training corpus of a few types. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • the language type of the training corpus is the first language
  • the method further includes:
  • the training corpus is translated into the second language, wherein, under the language environment of the second language, the corpus similarity between the first training corpus and the second training corpus is less than the preset Similarity threshold.
  • the training data set may be a data set with severely imbalanced samples. For example, there are 100,000 corpora in category A, while at the same time, only a few or dozens of corpora are in category B. , and there may be some corpus in category A that are very close in grammatical structure to the corpus in category B. E.g,
  • Corpus 1 "The weather is very hot today” refers to the type of statement corpus.
  • Corpus 2 "Is the weather very hot today?" This is the type of interrogative corpus.
  • the Chinese corpus is translated into a German corpus.
  • the classification problem is transformed into a similarity measurement problem, that is, the original traditional classification problem is turned into a problem of measuring whether the input corpus is similar to a certain type of corpus after processing, for example:
  • Corpus 2 and corpus 3 are unclassified corpus, but corpus 4 is included in the classified corpus: "Is the weather very cold today?", it is obvious that corpus 2 is closer to corpus 4 than corpus 3, so corpus 2 should belong to corpus 4.
  • the data set of corpus 3 does not belong to the data set of corpus 4.
  • a language translation mapping table is preset in the server, and the translation mapping relationship between the first language and the second language is recorded in the language translation mapping table, such as "Chinese-German" and so on.
  • the translation mapping relationship between the language and the second language can be determined according to the language structure difference between the languages, and the first language and the second language having the translation mapping relationship are quite different in the language structure.
  • the server may query the second language corresponding to the first language in the language translation mapping table, and then translate the acquired first language is the second language queried. For example, the server recognizes that the first language of the training corpus is Chinese, and the second language corresponding to the "Chinese" language is "German” by querying the language translation mapping table, and then the server translates the Chinese training corpus into German.
  • the feature difference between the training corpus of the majority class and the training corpus of the minority class in the training corpus is enlarged, so that the first classification model after training only obtains the training corpus of the minority class.
  • the corresponding type of data response since the corpus input here is Chinese, it is necessary to select a language with relatively large differences in grammatical structure and other aspects compared with Chinese for translation. Translated into German to increase the feature differences between the majority class training corpus and the minority class training corpus in the training corpus.
  • the preset first classification model includes an encoding layer and a decoding layer
  • the steps of training the preset first classification model through the first training corpus to obtain the initial first classification model specifically include:
  • the preset first classification model is iterated based on the feature mapping result to obtain an initial first classification model.
  • the preset first classification model includes an encoding layer and a decoding layer.
  • the core idea of the design of the first classification model is to use the encoding layer to encode the vector of the input corpus and turn it into a feature vector, while the decoding layer is used to encode the vector of the input corpus.
  • These feature vectors are constructed to perform feature mapping with the feature labels in the decoding layer.
  • the encoding layer and decoding layer of the transformer model will only learn feature vector extraction methods and mappings suitable for these minority classes.
  • the input corpus does not belong to the minority class, Then the coding layer cannot obtain the feature vector, and cannot construct the conditions for a reasonable mapping.
  • steps of iterating the preset first classification model based on the feature mapping result to obtain the initial first classification model specifically include:
  • the preset first classification model is iterated based on the mapping error and the back-propagation algorithm to obtain an initial first classification model.
  • the loss function of the initial first classification model is constructed, and the first loss function is obtained, wherein the first loss function includes an adversarial factor.
  • the purpose of adding an adversarial factor here is to facilitate the subsequent iterative update of the initial first classification model.
  • the first classification model cannot be used for the data type corresponding to the majority class training corpus response.
  • the first loss function expression is as follows:
  • L ori here represents the standard transformer loss function
  • is a constant
  • D is a classic adversarial loss function.
  • the adversarial loss function D is constructed according to the following formula:
  • D is the decider in the adversarial loss network
  • G refers to the generator in the adversarial loss network
  • G can be the above-mentioned transformer model
  • x and z are the input training data
  • z ⁇ p noise (z) means that the training data x and z obey a certain distribution
  • E means to take the mean value of the output of the anti-loss network.
  • the error between the feature mapping result and the preset mapping result is calculated to obtain the mapping error, the mapping error is compared with the preset preset mapping error threshold, and the mapping error is compared with the preset mapping error threshold.
  • the initial first mapping error model is iteratively updated through the back-propagation algorithm until the mapping error is less than or equal to the preset mapping error threshold, and the output mapping error is greater than the preset mapping error Threshold the initial first classification model.
  • the loss function of the initial first classification model is adjusted based on the preset adjustment rules
  • the second training corpus is imported into the initial first classification model after the loss function is adjusted
  • the initial first classification model is adjusted based on the back-propagation algorithm.
  • the steps of iterative update to obtain the first classification model include:
  • a first classification model with a classification error greater than a preset classification error threshold is output.
  • the initial first classification model is made to learn in the direction of excluding the training corpus of the majority class, and an exclusive first classification model is obtained.
  • the model cannot respond to the data type corresponding to the training corpus of the majority class.
  • the data type corresponding to the training corpus of the minority class and the data type corresponding to the training corpus of the majority class are used to improve the accuracy of the unbalanced sample classification model.
  • the loss function of the initial first classification model is adjusted based on the preset adjustment rules
  • the second training corpus is imported into the initial first classification model after the loss function is adjusted
  • the initial first classification model is adjusted based on the back-propagation algorithm.
  • the second classification model is iteratively updated based on the result of the convolution operation, and the trained second classification model is output.
  • the training corpus of the minority class may be further classified by the second classification model, and the second classification model may be a CNN deep neural network model.
  • the input vector includes the corpus vector corresponding to the training corpus of the minority class and the feature vector output by the coding layer of the transformer model.
  • the reason for using the feature vector here is to use the feature vector to obtain higher-dimensional features. , and high-dimensional features are beneficial to the classification of the minority class training corpus.
  • the corpus vector of the first training corpus is obtained by vectorizing the first training corpus, the corpus vector and the feature vector are vector-spliced to obtain the corpus feature matrix, and the corpus feature matrix is imported into the preset No.
  • the convolution operation is performed on the corpus feature matrix through the convolution check of the second classification model, the result of the convolution operation is obtained, the second classification model is iteratively updated based on the result of the convolution operation, and the trained second classification model is output,
  • the second classification model can classify the minority class training corpus.
  • steps of iteratively updating the second classification model based on the result of the convolution operation, and outputting the trained second classification model specifically include:
  • the loss function of the second classification model is constructed based on the cross entropy loss function and the Levenstein distance function, and an initial third loss function is obtained, wherein the initial third loss function includes the cross entropy factor and the Levenstein factor;
  • the operation error of the convolution operation result is calculated by the third loss function, and the second classification model is iteratively updated by the back propagation algorithm based on the operation error, and the trained second classification model is obtained.
  • the form of the initial third loss function is as follows:
  • ⁇ and ⁇ are weight coefficients.
  • the sum of ⁇ and ⁇ is 1, and the initial values of ⁇ and ⁇ may be set to 0.5 and 0.5.
  • L cls is the standard cross-entropy loss function
  • L lve is the standard Levenstein distance function, where the cross-entropy loss function is used to guide the classification task, and the Levenstein distance function is used to ensure clustering and form cluster centers .
  • the weight coefficients ⁇ and ⁇ can be continuously adjusted according to the result of the convolution operation until the output of the initial third loss function reaches the minimum value, and the initial third loss function when the output reaches the minimum value is determined as
  • the loss function of the second classification model that is, the third loss function, calculates the operation error of the convolution operation result through the third loss function, and uses the back-propagation algorithm to iteratively update the second classification model based on the operation error to obtain the first training completed.
  • the sample classification is various, which makes the calculation of the sample weight value extremely complicated, and it is difficult for us to balance the weights between various types of samples. Moreover, for training samples with very similar characteristics, it is difficult for the above-mentioned classification model trained by setting weights to classify them, that is, the classification of biased data sets is realized by setting weights. In many scenarios, the classification accuracy cannot meet the requirements. Therefore, the existing classification of unbalanced samples by weighting different kinds of samples has certain defects.
  • the present application discloses a method, device, equipment and storage medium for classifying unbalanced samples, which belong to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus.
  • Training corpus the first training corpus is the minority class training corpus
  • the second training corpus is the majority class training corpus
  • the initial first classification model is obtained by training the minority class training corpus
  • the loss function of the initial first classification model is adjusted by the preset adjustment rules Perform the inversion, and then import the majority class training corpus into the initial first classification model after the loss function is reversed, and iterate the initial first classification model to obtain the first classification model, obtain the corpus to be classified, and pass the first classification model.
  • the present application reverses the loss function of the classification model through preset adjustment rules, and then trains to obtain an exclusive classification model.
  • the classification model can only respond to the data types corresponding to the training corpus of a few classes. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • the above-mentioned corpus to be classified may also be stored in a node of a blockchain.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the aforementioned storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
  • the present application provides an embodiment of an apparatus for classifying unbalanced samples.
  • the apparatus embodiment corresponds to the method embodiment shown in FIG. 2 .
  • the device can be specifically applied to various electronic devices.
  • the apparatus for classifying unbalanced samples includes:
  • Corpus acquisition module 301 used for acquiring training corpus from a preset corpus, wherein the training corpus includes a first training corpus and a second training corpus, the first training corpus is a minority class training corpus, and the second training corpus is a majority class training corpus ;
  • the first model training module 302 is used for training the preset first classification model through the first training corpus to obtain the initial first classification model;
  • the inversion training module 303 is configured to adjust the loss function of the initial first classification model based on the preset adjustment rules, import the second training corpus into the initial first classification model after the loss function is adjusted, and adjust the initial classification model based on the back-propagation algorithm.
  • the first classification model is iteratively updated to obtain the first classification model;
  • the corpus classification module 304 is configured to receive the corpus classification instruction, obtain the corpus to be classified corresponding to the corpus classification instruction, and classify the corpus to be classified by the first classification model.
  • the language type of the training corpus is the first language
  • the apparatus for classifying unbalanced samples further includes:
  • the corpus similarity calculation module is used to calculate the corpus similarity between the first training corpus and the second training corpus, and compare the corpus similarity with the preset similarity threshold;
  • the corpus translation module is used to translate the training corpus into the second language when the corpus similarity is greater than or equal to the preset similarity threshold, wherein, in the language environment of the second language, the difference between the first training corpus and the second training corpus is The corpus similarity is less than the preset similarity threshold.
  • the preset first classification model includes an encoding layer and a decoding layer
  • the first model training module 302 specifically includes:
  • a feature extraction unit used for extracting the corpus feature of the first training corpus through the coding layer, and performing vector coding on the corpus feature to obtain a feature vector
  • the feature mapping unit is used to perform feature mapping between the feature vector and the feature label pre-stored in the decoding layer, and obtain the feature mapping result;
  • the first iterative unit is configured to iterate the preset first classification model based on the feature mapping result to obtain the initial first classification model.
  • the first iterative unit specifically includes:
  • the first loss function construction subunit is used to construct the loss function of the initial first classification model to obtain the first loss function, wherein the first loss function includes the confrontation factor;
  • mapping error calculation subunit configured to calculate the error between the feature mapping result and the preset mapping result based on the first loss function to obtain the mapping error
  • the first iterative subunit is configured to iterate the preset first classification model based on the mapping error and the back-propagation algorithm to obtain an initial first classification model.
  • the inversion training module 303 specifically includes:
  • a function inversion unit configured to invert the loss function of the initial first classification model based on a preset adjustment rule to obtain a second loss function
  • the corpus classification unit is used to import the second training corpus into the initial first classification model after the inversion of the loss function, and obtain the classification result;
  • a classification error calculation unit configured to calculate the error between the classification result and the preset classification result based on the second loss function to obtain the classification error
  • the second iterative unit is configured to compare the classification error with the preset classification error threshold, and if the classification error is less than or equal to the preset classification error threshold, perform a back-propagation algorithm on the initial first classification model after the inversion of the loss function. Iteratively update until the classification error is greater than the preset classification error threshold;
  • the model output unit is configured to output a first classification model whose classification error is greater than a preset classification error threshold.
  • the apparatus for classifying unbalanced samples also includes:
  • the vectorization module is used for vectorizing the first training corpus to obtain a corpus vector of the first training corpus;
  • the vector splicing module is used to perform vector splicing of the corpus vector and the feature vector to obtain the corpus feature matrix;
  • the convolution operation module is used to import the corpus feature matrix into the preset second classification model, and perform convolution operation on the corpus feature matrix through the convolution check of the second classification model to obtain the convolution operation result;
  • the model iteration module is used to iteratively update the second classification model based on the result of the convolution operation, and output the trained second classification model.
  • model iteration module specifically includes:
  • the third loss function construction unit is configured to construct a loss function of the second classification model based on the cross entropy loss function and the Lewinstein distance function, and obtain an initial third loss function, wherein the initial third loss function includes the cross entropy factor and Lewin Stein factor;
  • the weight assignment unit is used to assign the same initial weight value to the cross-entropy factor and the Levenstein factor of the initial third loss function respectively;
  • the third loss function optimization unit is used to adjust the initial weight values of the cross-entropy factor and the Levenstein factor based on the result of the convolution operation, until the output of the initial third loss function reaches the minimum value, and the third loss function is obtained;
  • the third iterative unit is used to calculate the operation error of the convolution operation result through the third loss function, and based on the operation error, the second classification model is iteratively updated by using the back propagation algorithm to obtain the trained second classification model.
  • the present application discloses an apparatus for classifying unbalanced samples, which belongs to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus, and the first training corpus is a minority class training corpus , the second training corpus is the majority class training corpus, the initial first classification model is obtained by training the minority class training corpus, the loss function of the initial first classification model is reversed through the preset adjustment rules, and then the majority class training corpus is imported into the loss
  • the initial first classification model after the function inversion is performed, and the initial first classification model is iterated to obtain the first classification model, the corpus to be classified is obtained, and the corpus to be classified is classified by the first classification model.
  • the present application reverses the loss function of the classification model through preset adjustment rules, and then trains to obtain an exclusive classification model.
  • the classification model can only respond to the data types corresponding to the training corpus of a few classes. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • FIG. 4 is a block diagram of a basic structure of a computer device according to this embodiment.
  • the computer device 4 includes a memory 41, a processor 42, and a network interface 43 that communicate with each other through a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure, but it should be understood that it is not required to implement all of the shown components, and more or less components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, special-purpose Integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processor (Digital Signal Processor, DSP), embedded equipment, etc.
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • DSP Digital Signal Processor
  • the computer equipment may be a desktop computer, a notebook computer, a palmtop computer, a cloud server and other computing equipment.
  • the computer device can perform human-computer interaction with the user through a keyboard, a mouse, a remote control, a touch pad or a voice control device.
  • the memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static Random Access Memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 41 may be an internal storage unit of the computer device 4 , such as a hard disk or a memory of the computer device 4 .
  • the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device.
  • the memory 41 is generally used to store the operating system and various application software installed on the computer device 4 , such as computer-readable instructions for a method for classifying unbalanced samples.
  • the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 42 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 42 is typically used to control the overall operation of the computer device 4.
  • the processor 42 is configured to execute computer-readable instructions stored in the memory 41 or process data, for example, computer-readable instructions for executing the method for classifying unbalanced samples.
  • the network interface 43 may include a wireless network interface or a wired network interface, and the network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
  • the present application discloses a device for classifying unbalanced samples, which belongs to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus, and the first training corpus is a minority class training corpus , the second training corpus is the majority class training corpus, the initial first classification model is obtained by training the minority class training corpus, the loss function of the initial first classification model is reversed through the preset adjustment rules, and then the majority class training corpus is imported into the loss
  • the initial first classification model after the function inversion is performed, and the initial first classification model is iterated to obtain the first classification model, the corpus to be classified is obtained, and the corpus to be classified is classified by the first classification model.
  • the present application reverses the loss function of the classification model through preset adjustment rules, and then trains to obtain an exclusive classification model.
  • the classification model can only respond to the data types corresponding to the training corpus of a few classes. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • the present application also provides another implementation manner, that is, to provide a computer-readable storage medium
  • the computer-readable storage medium may be non-volatile or volatile
  • the computer-readable storage medium stores Computer readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the method for classifying unbalanced samples as described above.
  • the present application discloses a classified storage medium for unbalanced samples, which belongs to the technical field of artificial intelligence.
  • the present application obtains training corpus, wherein the training corpus includes a first training corpus and a second training corpus, and the first training corpus is a minority class training corpus.
  • the second training corpus is the majority class training corpus
  • the initial first classification model is obtained by training the minority class training corpus
  • the loss function of the initial first classification model is reversed through the preset adjustment rules
  • the majority class training corpus is imported
  • the initial first classification model after the inversion of the loss function is performed, and the initial first classification model is iterated to obtain the first classification model
  • the corpus to be classified is obtained, and the corpus to be classified is classified by the first classification model.
  • the present application reverses the loss function of the classification model through preset adjustment rules, and then trains to obtain an exclusive classification model.
  • the classification model can only respond to the data types corresponding to the training corpus of a few classes. and output, but cannot respond to the corresponding data type of most training corpus, which improves the accuracy of the unbalanced sample classification model.
  • the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
  • the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.
  • a storage medium such as ROM/RAM, magnetic disk, CD-ROM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种非均衡样本的分类方法、装置、设备和存储介质,属于人工智能技术领域中的机器学习技术,该方法通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过第一训练语料训练得到初始第一分类模型,通过损失函数进行反转,然后将第二训练语料导入初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。此外,该方法还涉及区块链技术,待分类语料可存储于区块链中。该方法通过预设调整规则对分类模型的损失函数进行反转,然后训练得到具有排他性的分类模型,提高了非均衡样本分类模型的精度。

Description

一种非均衡样本的分类方法、装置、设备及存储介质
本申请要求于2020年12月30日提交中国专利局、申请号为202011617671.4,发明名称为“一种非均衡样本的分类方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于人工智能技术领域,具体涉及一种非均衡样本的分类方法、装置、设备和存储介质。
背景技术
在机器学习领域中,绝大多数模型是基于正常分布的数据集训练得到的,适用于有偏数据集的模型设计以及获取方法非常少。但是在某些特定场景下更多的是有偏数据集的情况,比如在自然语言分类的领域中,有侮辱攻击性的语言占整体数据的比例非常少,但是在实际业务场景中,又必须对侮辱攻击性的语言进行准确的分类。
针对有偏数据集的分类模型设计以及训练一直是学界与业界的难点,当前较为常用的方法是,在模型训练的损失函数上做一定的改进,即对于某些数量很少的训练样本类别加入额外的权重,相当于强制模型更加关注这些类别的训练样本。由于这些类别的训练样本数量较少,通过设置相应权重,总体说来,可以获得一个较为稳健的分类模型,使得该分类模型在分类任务获得一个较好的表现。但是,在非均衡样本的分类过程中,发明人意识到样本分类是多种多样的,使得样本权重值计算极其复杂,我们很难去平衡各个种类样本之间的权重。而且针对特征特别相近的训练样本,上述通过设置权重的方式训练的得到分类模型难以对其进行分类,即通过设置权重的方式来实现有偏数据集的分类在很多场景下分类精度达不到要求。
发明内容
本申请实施例的目的在于提出一种非均衡样本的分类方法、装置、计算机设备及存储介质,以解决现有的有偏数据集的分类方式中分类过程复杂,以及分类精度达不到要求要求的技术问题。
为了解决上述技术问题,本申请实施例提供一种非均衡样本的分类方法,采用了如下所述的技术方案:
一种非均衡样本的分类方法,包括:
从预设的语料库获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料;
通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
接收语料分类指令,获取与语料分类指令相对应的待分类语料,并通过第一分类模型对待分类语料进行分类。
进一步地,训练语料的语种类型为第一语种,在从预设的语料库获取训练语料的步骤之后,还包括:
计算第一训练语料和第二训练语料的语料相似度,并比对语料相似度与预设相似度阈值的大小;
若语料相似度大于或等于预设相似度阈值,则将训练语料翻译为第二语种,其中,在第二语种的语种环境下,第一训练语料和第二训练语料的语料相似度小于预设相似度阈值。
进一步地,预设的第一分类模型为包括编码层和解码层,通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型的步骤,具体包括:
通过编码层提取第一训练语料的语料特征,并对语料特征进行矢量编码,得到特征矢量;
将特征矢量与预先存储在解码层中的特征标签进行特征映射,获取特征映射结果;
基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型。
进一步地,基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型的步骤,具体包括:
构建初始第一分类模型的损失函数,得到第一损失函数,其中,第一损失函数包含对抗因子;
基于第一损失函数计算特征映射结果与预设映射结果的误差,得到映射误差;
基于映射误差和反向传播算法对预设的第一分类模型进行迭代,得到初始第一分类模型。
进一步地,基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤,具体包括:
基于预设调整规则对初始第一分类模型的损失函数进行反转,得到第二损失函数;
将第二训练语料导入损失函数反转后的初始第一分类模型,获取分类结果;
基于第二损失函数计算分类结果与预设分类结果的误差,得到分类误差;
将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
输出分类误差大于预设分类误差阈值的第一分类模型。
进一步地,在基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤之后,还包括:
对第一训练语料进行矢量化处理,得到第一训练语料的语料矢量;
对语料矢量和特征矢量进行矢量拼接,得到语料特征矩阵;
将语料特征矩阵导入预设的第二分类模型,通过第二分类模型的卷积核对语料特征矩阵进行卷积运算,获取卷积运算结果;
基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型。
进一步地,基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型的步骤,具体包括:
基于交叉熵损失函数和莱温斯坦距离函数构建第二分类模型的损失函数,得到初始第三损失函数,其中,初始第三损失函数包括交叉熵因子和莱温斯坦因子;
为初始第三损失函数的交叉熵因子和莱温斯坦因子分别赋予相同的初始权重值;
基于卷积运算结果对交叉熵因子和莱温斯坦因子的初始权重值进行调整,直至初始第三损失函数的输出达到最小值,得到第三损失函数;
通过第三损失函数计算卷积运算结果的运算误差,基于运算误差采用反向传播算法对第二分类模型进行迭代更新,得到训练完成的第二分类模型。
为了解决上述技术问题,本申请实施例还提供一种非均衡样本的分类装置,采用了如下所述的技术方案:
一种非均衡样本的分类装置,包括:
语料获取模块,用于从预设的语料库获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料;
第一模型训练模块,用于通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
反转训练模块,用于基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
语料分类模块,用于接收语料分类指令,获取与语料分类指令相对应的待分类语料,并通过第一分类模型对待分类语料进行分类。
为了解决上述技术问题,本申请实施例还提供一种计算机设备,采用了如下所述的技术方案:
一种设备,其特征在于,包括存储器和处理器,存储器中存储有计算机可读指令,处理器执行所述计算机可读指令时实现如上述的非均衡样本的分类方法的步骤。
为了解决上述技术问题,本申请实施例还提供一种计算机可读存储介质,采用了如下所述的技术方案:
一种计算机可读存储介质,其特征在于,计算机可读存储介质上存储有计算机可读指令,计算机可读指令被处理器执行时实现如上述所述的非均衡样本的分类方法的步骤。
与现有技术相比,本申请实施例主要有以下有益效果:
本申请公开了一种非均衡样本的分类方法、装置、设备和存储介质,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
附图说明
为了更清楚地说明本申请中的方案,下面将对本申请实施例描述中所需要使用的附图作一个简单介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请可以应用于其中的示例性系统架构图;
图2示出了根据本申请的非均衡样本的分类方法的一个实施例的流程图;
图3示出了根据本申请的非均衡样本的分类装置的一个实施例的结构示意图;
图4示出了根据本申请的计算机设备的一个实施例的结构示意图。
具体实施方式
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同;本文中在申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请;本申请的说明书和权利要求书及上述附图说明中的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。本申请的说明书和权利要求书或上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
为了使本技术领域的人员更好地理解本申请方案,下面将结合附图,对本申请实施例中的技术方案进行清楚、完整地描述。
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。
终端设备101、102、103可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机和台式计算机等等。
服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103上显示的页面提供支持的后台服务器。
需要说明的是,本申请实施例所提供的非均衡样本的分类方法一般由服务器执行,相应地,非均衡样本的分类装置一般设置于服务器中。
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
继续参考图2,示出了根据本申请的非均衡样本的分类的方法的一个实施例的流程图。所述的非均衡样本的分类方法,包括以下步骤:
S201,从预设的语料库获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料。
具体的,从预设的语料库获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料。在本申请具体的实施例中,多数类训练语料可以达到10万条以上,少数类训练语料可能只有10条。训练语料可以是任意一种语种的语料,在本申请具体的实施例中,训练语料为中文语料。
S202,通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型。
其中,针对上述样本严重失衡的训练样本的分类场景,传统通过设置分类权重,然后将多数类训练语料和少数类训练语料随机组合的方式训练出来的分类模型的分类精度可能达不到要求,无法实现精准分类。本申请通过训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
具体的,预设的第一分类模型可以是经典的transformer模型,先通过少数类训练语料对transformer模型进行训练,得到初始第一分类模型。其中,transformer模型结构包括encoder(编码层)和decoder(解码层)。通过编码层提取少数类训练语料的语料特 征,并对语料特征进行矢量编码,得到特征矢量,将特征矢量与预先存储在解码层中的特征标签进行特征映射,获取特征映射结果,基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型,可以针对少数类训练语料对应数据类型做出相应响应和输出。
S203,基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型。
其中,基于预设调整规则对初始第一分类模型的损失函数进行调整是指对初始第一分类模型的损失函数反转,例如,初始第一分类模型的损失函数即第一损失函数为L 1,在本申请具体的实施例中,反转后初始第一分类模型的损失函数L 2为1-L 1
具体的,当初始第一分类模型训练完毕后,基于预设调整规则对初始第一分类模型的损失函数进行反转,将多数类训练语料导入损失函数反转后的初始第一分类模型,并基于反向传播算法对损失函数反转后的初始第一分类模型反向迭代,得到第一分类模型,即利用反转后的损失函数鼓励初始第一分类模型朝着排除多数类训练语料的方向学习,得到一个具有排他性的第一分类模型,第一分类模型对于多数类训练语料对应数据类型无法响应,通过第一分类模型少数类训练语料对应数据类型和多数类训练语料对应数据类型,提高了非均衡样本分类模型的精度。
S204,接收语料分类指令,获取与语料分类指令相对应的待分类语料,并通过第一分类模型对待分类语料进行分类。
具体的,当接收到用户的语料分类指令时,获取与语料分类指令相对应的待分类语料,并通过训练好的第一分类模型对待分类语料进行分类。如果第一分类模型没有输出,即认为输入语料属于多数类数据对应数据类型,如果第一分类模型存在输出,即认为输入语料属于少数类数据对应数据类型,通过第一分类模型少数类训练语料对应数据类型和多数类训练语料对应数据类型。
在本实施例中,非均衡样本的分类方法运行于其上的电子设备(例如图1所示的服务器/终端设备)可以通过有线连接方式或者无线连接方式接收语料分类指令。需要指出的是,上述无线连接方式可以包括但不限于3G/4G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
本申请公开了一种非均衡样本的分类方法,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
进一步地,训练语料的语种类型为第一语种,在从预设的语料库获取训练语料的步骤之后,还包括:
计算第一训练语料和第二训练语料的语料相似度,并比对语料相似度与预设相似度阈值的大小;
若语料相似度大于或等于预设相似度阈值,则将训练语料翻译为第二语种,其中,在第二语种的语种环境下,第一训练语料和第二训练语料的语料相似度小于预设相似度阈值。
其中,在本申请具体的实施例中,训练数据集可以是样本严重失衡的数据集,比如说有10万条语料是A类别,而与此同时,只有几条活着几十条语料是B类别,并且A类别中可能可能存在某些语料与B类别中的语料在语法结构上非常接近。例如,
语料一:“今天天气很热”,是指陈述语料类型。
语料二:“今天天气很热吗”,这是疑问语料类型。
针对上述情况,在传统分类模型进行训练时,由于两个语料相似度较高的原因,分类模型可能难以获得分辨上述两个语料的能力,导致模型精度不够,而在本申请中,可以通过语料翻译来解决上述问题。
首先,通过先将汉语语料翻译为成能够拉大语料特征区别的语言,在本申请具体的实施例中,将汉语语料翻译未德语语料。
举例说明,上述的两个语料翻译成德文分别是“Es ist heute sehr heiβ”、“Wie heiβes heute ist”,从这里可以看出,将语料翻译成德文,将在确保原有信息的同时,有效拉大两者的区别。
然后,将分类问题转变为相似度衡量的问题,即将原本传统的分类问题,变成一个衡量输入语料经过处理后,同某一类型语料是否相似的问题,举例说明:
语料二:“今天天气很热吗?”
语料三:“今天你过得快乐吗?”
语料二和语料三为未分类的语料,但是已分类语料中有语料四:“今天天气很冷吗?”,很显然语料二相对于语料三更加接近语料四,因而语料二应当属于语料四所在的数据集合,而语料三不属于语料四所在的数据集合。
在本申请具体的实施例中,服务器内预设有语种翻译映射表,语种翻译映射表中记录了第一语种和第二语种的翻译映射关系,例如“中文-德文”等等,第一语种和第二语种的翻译映射关系可以根据各个语种之间的语种结构差异确定,且具有翻译映射关系的第一语种和第二语种在语种结构上差异较大。在本申请一种具体的实施例中,服务器可以在识别训练语料的第一语种后,通过在语种翻译映射表中查询第一语种所对应的第二语种,然后将获取到的第一语种翻译为查询到的第二语种。举例说明,服务器识别训练语料的第一语种为中文,通过在语种翻译映射表中查询到“中文”语种对应的第二语种为“德文”,然后服务器将中文的训练语料翻译为德文。
在上述实施例中,通过对训练语料进行翻译处理,以拉大训练语料中多数类训练语料和少数类训练语料之间的特征差异,使得训练完成的第一分类模型仅得到对少数类训练语料对应类型的数据响应。在本申请具体的实施例中,由于这里输入的语料是汉语,因此需要挑选相对于汉语在语法结构等方面差异性比较大的语言进行翻译,本申请采用的是将汉语翻译成德语,将汉语翻译成德语以拉大训练语料中多数类训练语料和少数类训练语料之间的特征差异。
进一步地,预设的第一分类模型为包括编码层和解码层,通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型的步骤,具体包括:
通过编码层提取第一训练语料的语料特征,并对语料特征进行矢量编码,得到特征矢量;
将特征矢量与预先存储在解码层中的特征标签进行特征映射,获取特征映射结果;
基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型。
具体的,预设的第一分类模型为包括编码层和解码层,第一分类模型设计的核心思路是使用编码层作对输入语料的矢量进行编码,将其变成特征矢量,而解码层用来构建起这些特征矢量同解码层中的特征标签进行特征映射。
在上述实施例中,如果仅仅使用少数类别语料进行训练,那么transformer模型的编码层和解码层仅会学习适用于这些少数类别的特征矢量提取方法和映射,当输入的语料不属于少数类别时,那么编码层获取不了特征矢量,也无法构建起合理映射的条件。
进一步地,基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型的步骤,具体包括:
构建初始第一分类模型的损失函数,得到第一损失函数,其中,第一损失函数包含对抗因子;
基于第一损失函数计算特征映射结果与预设映射结果的误差,得到映射误差;
基于映射误差和反向传播算法对预设的第一分类模型进行迭代,得到初始第一分类模型。
其中,构建初始第一分类模型的损失函数,得到第一损失函数,其中,第一损失函数包含对抗因子,这里加入对抗因子的目的是方便后续对初始第一分类模型进行反向迭代更新时,拉大映射误差大于预设误差阈,使得初始第一分类模型朝着排除多数类训练语料的方向学习,得到一个具有排他性的第一分类模型,第一分类模型对于多数类训练语料对应数据类型无法响应。
第一损失函数表达式如下:
L 1=L ori+λD
其中,这里的L ori表示的是标准的transformer损失函数,λ是常数,D是经典的对抗损失函数,在本申请中对抗损失函数D根据下述公式进行构建:
Figure PCTCN2021090432-appb-000001
其中,D是对抗损失网络中的决定器,G指的是对抗损失网络中的生成器,在本申请中,G可以是上述的transformer模型,x和z是输入的训练数据,x~p data(x)、z~p noise(z)指的是训练数据x和z服从某种分布,E表示取抗损失网络输出的均值。
具体的,基于构建的第一损失函数计算特征映射结果与预设映射结果的误差,得到映射误差,比对映射误差与预设的预设映射误差阈值,将映射误差与预设映射误差阈值进行比较,若映射误差大于预设映射误差阈值,则通过反向传播算法对初始第一映射误差模型进行迭代更新,直到映射误差小于或等于预设映射误差阈值为止,输出映射误差大于预设映射误差阈值的初始第一分类模型。
进一步地,基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤,具体包括:
基于预设调整规则对初始第一分类模型的损失函数进行反转,得到第二损失函数;
将第二训练语料导入损失函数反转后的初始第一分类模型,获取分类结果;
基于第二损失函数计算分类结果与预设分类结果的误差,得到分类误差;
将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
输出分类误差大于预设分类误差阈值的第一分类模型。
其中,基于预设调整规则对初始第一分类模型的损失函数进行调整是指对初始第一分类模型的损失函数反转,例如,第一损失函数为L 1,在本申请具体的实施例中,反转后初始第一分类模型的损失函数为L 2=1-L 1
具体的,基于预设调整规则对初始第一分类模型的损失函数进行反转,得到第二损失函数;
将第二训练语料导入损失函数反转后的初始第一分类模型,获取分类结果,基于第二损失函数计算分类结果与预设分类结果的误差,得到分类误差,将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失 函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止,输出分类误差大于预设分类误差阈值的第一分类模型。
在上述实施例中,通过对初始第一分类模型的损失函数进行反转,使得初始第一分类模型朝着排除多数类训练语料的方向学习,得到一个具有排他性的第一分类模型,第一分类模型对于多数类训练语料对应数据类型无法响应,通过第一分类模型少数类训练语料对应数据类型和多数类训练语料对应数据类型,提高了非均衡样本分类模型的精度。
进一步地,在基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤之后,还包括:
对第一训练语料进行矢量化处理,得到第一训练语料的语料矢量;
对语料矢量和特征矢量进行矢量拼接,得到语料特征矩阵;
将语料特征矩阵导入预设的第二分类模型,通过第二分类模型的卷积核对语料特征矩阵进行卷积运算,获取卷积运算结果;
基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型。
其中,根据高维流形分类原理,如果在低维情况下无法线性可分的少数类训练语料,在高维情况下可以做到线性可分,这既是说明,高维情况下的样本更容易实现分类。由于少数类训练语料通常数量较少,难以构成训练一个完整分类器的充分数据集,但是在高维条件下,以这些样本作为聚类中心的初始点,应该较为容易找到少数类训练语料的聚类中心。在上述方案中,通过升维操作在一个不完备的数据集上训练出一个单纯的分类模型,至于聚类中心点这是由在模型的损失函数指导下的模型自适应行为。
具体的,在得到第一分类模型之后,还可以继续通过第二分类模型对少数类训练语料进行分类,第二分类模型可以是CNN深度神经网络模型。对第二分类模型进行训练时,输入的矢量包括少数类训练语料对应的语料矢量和上述transformer模型的编码层输出的特征矢量,这里使用特征矢量的原因就在于利用特征矢量获得更加高维的特征,而高维特征有利于少数类训练语料的分类。
在上述实施例中,通过对第一训练语料进行矢量化处理,得到第一训练语料的语料矢量,对语料矢量和特征矢量进行矢量拼接,得到语料特征矩阵,将语料特征矩阵导入预设的第二分类模型,通过第二分类模型的卷积核对语料特征矩阵进行卷积运算,获取卷积运算结果,基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型,第二分类模型可以对少数类训练语料进行分类。
进一步地,基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型的步骤,具体包括:
基于交叉熵损失函数和莱温斯坦距离函数构建第二分类模型的损失函数,得到初始第三损失函数,其中,初始第三损失函数包括交叉熵因子和莱温斯坦因子;
为初始第三损失函数的交叉熵因子和莱温斯坦因子分别赋予相同的初始权重值;
基于卷积运算结果对交叉熵因子和莱温斯坦因子的初始权重值进行调整,直至初始第三损失函数的输出达到最小值,得到第三损失函数;
通过第三损失函数计算卷积运算结果的运算误差,基于运算误差采用反向传播算法对第二分类模型进行迭代更新,得到训练完成的第二分类模型。
具体的,初始第三损失函数的形式如下:
L 3=αL cls+βL lev
这里的α与β是权重系数,在本申请具体的实施例中,α与β的和为1,α与β的初始值可以设为为0.5和0.5。L cls是标准的交叉熵损失函数,而L lve是标准的莱温斯坦距离函数,其中,交叉熵损失函数用于指导分类任务,而莱温斯坦距离函数用于确保聚类 和形成聚类中心。在第二分类模型训练过程中,可以跟据卷积运算结果持续调整权重系数α与β,直至初始第三损失函数的输出达到最小值,将输出达到最小值时的初始第三损失函数确定为第二分类模型的损失函数,即第三损失函数,通过第三损失函数计算卷积运算结果的运算误差,基于运算误差采用反向传播算法对第二分类模型进行迭代更新,得到训练完成的第二分类模型。
在实际应用过程中,样本分类是多种多样的,使得样本权重值计算极其复杂,我们很难去平衡各个种类样本之间的权重。而且针对特征特别相近的训练样本,上述通过设置权重的方式训练的得到分类模型难以对其进行分类,即通过设置权重的方式来实现有偏数据集的分类在很多场景下分类精度达不到要求,因此,现有的通过为不同种类样本进行赋权的非均衡样本的分类存在一定的缺陷。
针对上述技术问题,本申请公开了一种非均衡样本的分类方法、装置、设备和存储介质,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
需要强调的是,为进一步保证上述待分类语料的私密和安全性,上述待分类语料还可以存储于一区块链的节点中。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,该计算机可读指令可存储于一计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。
应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
进一步参考图3,作为对上述图2所示方法的实现,本申请提供了一种非均衡样本的分类装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图3所示,本实施例所述的非均衡样本的分类装置包括:
语料获取模块301,用于从预设的语料库获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料;
第一模型训练模块302,用于通过第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
反转训练模块303,用于基于预设调整规则对初始第一分类模型的损失函数进行调整,将第二训练语料导入损失函数调整后的初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
语料分类模块304,用于接收语料分类指令,获取与语料分类指令相对应的待分类语料,并通过第一分类模型对待分类语料进行分类。
进一步地,训练语料的语种类型为第一语种,该非均衡样本的分类装置还包括:
语料相似度计算模块,用于计算第一训练语料和第二训练语料的语料相似度,并比对语料相似度与预设相似度阈值的大小;
语料翻译模块,用于当语料相似度大于或等于预设相似度阈值时,将训练语料翻译为第二语种,其中,在第二语种的语种环境下,第一训练语料和第二训练语料的语料相似度小于预设相似度阈值。
进一步地,预设的第一分类模型为包括编码层和解码层,第一模型训练模块302具体包括:
特征提取单元,用于通过编码层提取第一训练语料的语料特征,并对语料特征进行矢量编码,得到特征矢量;
特征映射单元,用于将特征矢量与预先存储在解码层中的特征标签进行特征映射,获取特征映射结果;
第一迭代单元,用于基于特征映射结果对预设的第一分类模型进行迭代,得到初始第一分类模型。
进一步地,第一迭代单元具体包括:
第一损失函数构建子单元,用于构建初始第一分类模型的损失函数,得到第一损失函数,其中,第一损失函数包含对抗因子;
映射误差计算子单元,用于基于第一损失函数计算特征映射结果与预设映射结果的误差,得到映射误差;
第一迭代子单元,用于基于映射误差和反向传播算法对预设的第一分类模型进行迭代,得到初始第一分类模型。
进一步地,反转训练模块303具体包括:
函数反转单元,用于基于预设调整规则对初始第一分类模型的损失函数进行反转,得到第二损失函数;
语料分类单元,用于将第二训练语料导入损失函数反转后的初始第一分类模型,获取分类结果;
分类误差计算单元,用于基于第二损失函数计算分类结果与预设分类结果的误差,得到分类误差;
第二迭代单元,用于将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
模型输出单元,用于输出分类误差大于预设分类误差阈值的第一分类模型。
进一步地,该非均衡样本的分类装置还包括:
矢量化模块,用于对第一训练语料进行矢量化处理,得到第一训练语料的语料矢量;
矢量拼接模块,用于对语料矢量和特征矢量进行矢量拼接,得到语料特征矩阵;
卷积运算模块,用于将语料特征矩阵导入预设的第二分类模型,通过第二分类模型的卷积核对语料特征矩阵进行卷积运算,获取卷积运算结果;
模型迭代模块,用于基于卷积运算结果对第二分类模型进行迭代更新,输出训练完成的第二分类模型。
进一步地,模型迭代模块具体包括:
第三损失函数构建单元,用于基于交叉熵损失函数和莱温斯坦距离函数构建第二分类模型的损失函数,得到初始第三损失函数,其中,初始第三损失函数包括交叉熵因子和莱温斯坦因子;
权重赋值单元,用于为初始第三损失函数的交叉熵因子和莱温斯坦因子分别赋予相同的初始权重值;
第三损失函数优化单元,用于基于卷积运算结果对交叉熵因子和莱温斯坦因子的初始权重值进行调整,直至初始第三损失函数的输出达到最小值,得到第三损失函数;
第三迭代单元,用于通过第三损失函数计算卷积运算结果的运算误差,基于运算误差采用反向传播算法对第二分类模型进行迭代更新,得到训练完成的第二分类模型。
本申请公开了一种非均衡样本的分类装置,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
为解决上述技术问题,本申请实施例还提供计算机设备。具体请参阅图4,图4为本实施例计算机设备基本结构框图。
所述计算机设备4包括通过系统总线相互通信连接存储器41、处理器42、网络接口43。需要指出的是,图中仅示出了具有组件41-43的计算机设备4,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。其中,本技术领域技术人员可以理解,这里的计算机设备是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机设备可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机设备可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
所述存储器41至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器41可以是所述计算机设备4的内部存储单元,例如该计算机设备4的硬盘或内存。在另一些实施例中,所述存储器41也可以是所述计算机设备4的外部存储设备,例如该计算机设备4上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器41还可以既包括所述计算机设备4的内部存储单元也包括其外部存储设备。本实施例中,所述存储器41通常用于存储安装于所述计算机设备4的操作系统和各类应用软件,例如非均衡样本的分类方法的计算机可读指令等。此外,所述存储器41还可以用于暂时地存储已经输出或者将要输出的各类数据。
所述处理器42在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器42通常用于控制所述计 算机设备4的总体操作。本实施例中,所述处理器42用于运行所述存储器41中存储的计算机可读指令或者处理数据,例如运行所述非均衡样本的分类方法的计算机可读指令。
所述网络接口43可包括无线网络接口或有线网络接口,该网络接口43通常用于在所述计算机设备4与其他电子设备之间建立通信连接。
本申请公开了一种非均衡样本的分类设备,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
本申请还提供了另一种实施方式,即提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令可被至少一个处理器执行,以使所述至少一个处理器执行如上述的非均衡样本的分类方法的步骤。
本申请公开了一种非均衡样本的分类存储介质,属于人工智能技术领域,本申请通过获取训练语料,其中,训练语料包括第一训练语料和第二训练语料,第一训练语料为少数类训练语料,第二训练语料为多数类训练语料,通过少数类训练语料训练得到初始第一分类模型,通过预设调整规则对初始第一分类模型的损失函数进行反转,然后将多数类训练语料导入损失函数反转后的初始第一分类模型,并对初始第一分类模型进行迭代,得到第一分类模型,获取待分类语料,并通过第一分类模型对待分类语料进行分类。本申请通过预设调整规则对分类模型的损失函数进行反转,然后训练得到一个具有排他性的分类模型,在进行分类任务时,该分类模型仅能对少数类训练语料对应数据类型做出相应响应和输出,而对于多数类训练语料对应数据类型则无法响应,提高了非均衡样本分类模型的精度。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
显然,以上所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例,附图中给出了本申请的较佳实施例,但并不限制本申请的专利范围。本申请可以以许多不同的形式来实现,相反地,提供这些实施例的目的是使对本申请的公开内容的理解更加透彻全面。尽管参照前述实施例对本申请进行了详细的说明,对于本领域的技术人员来而言,其依然可以对前述各具体实施方式所记载的技术方案进行修改,或者对其中部分技术特征进行等效替换。凡是利用本申请说明书及附图内容所做的等效结构,直接或间接运用在其他相关的技术领域,均同理在本申请专利保护范围之内。

Claims (20)

  1. 一种非均衡样本的分类方法,包括:
    从预设的语料库获取训练语料,其中,所述训练语料包括第一训练语料和第二训练语料,所述第一训练语料为少数类训练语料,所述第二训练语料为多数类训练语料;
    通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
    基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
    接收语料分类指令,获取与所述语料分类指令相对应的待分类语料,并通过所述第一分类模型对所述待分类语料进行分类。
  2. 如权利要求1所述的非均衡样本的分类方法,其中,所述训练语料的语种类型为第一语种,在所述从预设的语料库获取训练语料的步骤之后,还包括:
    计算所述第一训练语料和所述第二训练语料的语料相似度,并比对所述语料相似度与预设相似度阈值的大小;
    若所述语料相似度大于或等于预设相似度阈值,则将所述训练语料翻译为第二语种,其中,在所述第二语种的语种环境下,所述第一训练语料和所述第二训练语料的语料相似度小于预设相似度阈值。
  3. 如权利要求1所述的非均衡样本的分类方法,其中,所述预设的第一分类模型为包括编码层和解码层,所述通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型的步骤,具体包括:
    通过所述编码层提取所述第一训练语料的语料特征,并对所述语料特征进行矢量编码,得到特征矢量;
    将所述特征矢量与预先存储在所述解码层中的特征标签进行特征映射,获取特征映射结果;
    基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  4. 如权利要求3所述的非均衡样本的分类方法,其中,所述基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型的步骤,具体包括:
    构建所述初始第一分类模型的损失函数,得到第一损失函数,其中,所述第一损失函数包含对抗因子;
    基于第一损失函数计算所述特征映射结果与预设映射结果的误差,得到映射误差;
    基于所述映射误差和反向传播算法对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  5. 如权利要求4所述的非均衡样本的分类方法,其中,基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤,具体包括:
    基于预设调整规则对所述初始第一分类模型的损失函数进行反转,得到第二损失函数;
    将所述第二训练语料导入损失函数反转后的所述初始第一分类模型,获取分类结果;
    基于第二损失函数计算所述分类结果与预设分类结果的误差,得到分类误差;
    将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
    输出分类误差大于预设分类误差阈值的第一分类模型。
  6. 如权利要求3所述的非均衡样本的分类方法,其中,在所述基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤之后,还包括:
    对所述第一训练语料进行矢量化处理,得到所述第一训练语料的语料矢量;
    对所述语料矢量和所述特征矢量进行矢量拼接,得到语料特征矩阵;
    将所述语料特征矩阵导入预设的第二分类模型,通过所述第二分类模型的卷积核对所述语料特征矩阵进行卷积运算,获取卷积运算结果;
    基于所述卷积运算结果对所述第二分类模型进行迭代更新,输出训练完成的所述第二分类模型。
  7. 如权利要求6所述的非均衡样本的分类方法,其中,所述基于所述卷积运算结果对所述第二分类模型进行迭代更新,输出训练完成的所述第二分类模型的步骤,具体包括:
    基于交叉熵损失函数和莱温斯坦距离函数构建所述第二分类模型的损失函数,得到初始第三损失函数,其中,所述初始第三损失函数包括交叉熵因子和莱温斯坦因子;
    为所述初始第三损失函数的交叉熵因子和莱温斯坦因子分别赋予相同的初始权重值;
    基于所述卷积运算结果对所述交叉熵因子和所述莱温斯坦因子的初始权重值进行调整,直至所述初始第三损失函数的输出达到最小值,得到第三损失函数;
    通过所述第三损失函数计算所述卷积运算结果的运算误差,基于所述运算误差采用反向传播算法对所述第二分类模型进行迭代更新,得到训练完成的所述第二分类模型。
  8. 一种非均衡样本的分类装置,包括:
    语料获取模块,用于从预设的语料库获取训练语料,其中,所述训练语料包括第一训练语料和第二训练语料,所述第一训练语料为少数类训练语料,所述第二训练语料为多数类训练语料;
    第一模型训练模块,用于通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
    反转训练模块,用于基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
    语料分类模块,用于接收语料分类指令,获取与所述语料分类指令相对应的待分类语料,并通过所述第一分类模型对所述待分类语料进行分类。
  9. 一种设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现如下所述的非均衡样本的分类方法:
    从预设的语料库获取训练语料,其中,所述训练语料包括第一训练语料和第二训练语料,所述第一训练语料为少数类训练语料,所述第二训练语料为多数类训练语料;
    通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
    基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
    接收语料分类指令,获取与所述语料分类指令相对应的待分类语料,并通过所述第一分类模型对所述待分类语料进行分类。
  10. 如权利要求9所述的设备,其中,所述训练语料的语种类型为第一语种,在所述从预设的语料库获取训练语料的步骤之后,还包括:
    计算所述第一训练语料和所述第二训练语料的语料相似度,并比对所述语料相似度与预设相似度阈值的大小;
    若所述语料相似度大于或等于预设相似度阈值,则将所述训练语料翻译为第二语种,其中,在所述第二语种的语种环境下,所述第一训练语料和所述第二训练语料的语料相似度小于预设相似度阈值。
  11. 如权利要求9所述的设备,其中,所述预设的第一分类模型为包括编码层和解码层,所述通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型的步骤,具体包括:
    通过所述编码层提取所述第一训练语料的语料特征,并对所述语料特征进行矢量编码,得到特征矢量;
    将所述特征矢量与预先存储在所述解码层中的特征标签进行特征映射,获取特征映射结果;
    基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  12. 如权利要求11所述的设备,其中,所述基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型的步骤,具体包括:
    构建所述初始第一分类模型的损失函数,得到第一损失函数,其中,所述第一损失函数包含对抗因子;
    基于第一损失函数计算所述特征映射结果与预设映射结果的误差,得到映射误差;
    基于所述映射误差和反向传播算法对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  13. 如权利要求12所述的设备,其中,基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤,具体包括:
    基于预设调整规则对所述初始第一分类模型的损失函数进行反转,得到第二损失函数;
    将所述第二训练语料导入损失函数反转后的所述初始第一分类模型,获取分类结果;
    基于第二损失函数计算所述分类结果与预设分类结果的误差,得到分类误差;
    将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
    输出分类误差大于预设分类误差阈值的第一分类模型。
  14. 如权利要求11所述的设备,其中,在所述基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤之后,还包括:
    对所述第一训练语料进行矢量化处理,得到所述第一训练语料的语料矢量;
    对所述语料矢量和所述特征矢量进行矢量拼接,得到语料特征矩阵;
    将所述语料特征矩阵导入预设的第二分类模型,通过所述第二分类模型的卷积核对所述语料特征矩阵进行卷积运算,获取卷积运算结果;
    基于所述卷积运算结果对所述第二分类模型进行迭代更新,输出训练完成的所述第二分类模型。
  15. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下所述的非均衡样本的分类方法:
    从预设的语料库获取训练语料,其中,所述训练语料包括第一训练语料和第二训练语料,所述第一训练语料为少数类训练语料,所述第二训练语料为多数类训练语料;
    通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型;
    基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型;
    接收语料分类指令,获取与所述语料分类指令相对应的待分类语料,并通过所述第一分类模型对所述待分类语料进行分类。
  16. 如权利要求15所述的计算机可读存储介质,其中,所述训练语料的语种类型为第一语种,在所述从预设的语料库获取训练语料的步骤之后,还包括:
    计算所述第一训练语料和所述第二训练语料的语料相似度,并比对所述语料相似度与预设相似度阈值的大小;
    若所述语料相似度大于或等于预设相似度阈值,则将所述训练语料翻译为第二语种,其中,在所述第二语种的语种环境下,所述第一训练语料和所述第二训练语料的语料相似度小于预设相似度阈值。
  17. 如权利要求15所述的计算机可读存储介质,其中,所述预设的第一分类模型为包括编码层和解码层,所述通过所述第一训练语料对预设的第一分类模型进行训练,得到初始第一分类模型的步骤,具体包括:
    通过所述编码层提取所述第一训练语料的语料特征,并对所述语料特征进行矢量编码,得到特征矢量;
    将所述特征矢量与预先存储在所述解码层中的特征标签进行特征映射,获取特征映射结果;
    基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述基于所述特征映射结果对所述预设的第一分类模型进行迭代,得到初始第一分类模型的步骤,具体包括:
    构建所述初始第一分类模型的损失函数,得到第一损失函数,其中,所述第一损失函数包含对抗因子;
    基于第一损失函数计算所述特征映射结果与预设映射结果的误差,得到映射误差;
    基于所述映射误差和反向传播算法对所述预设的第一分类模型进行迭代,得到初始第一分类模型。
  19. 如权利要求18所述的计算机可读存储介质,其中,基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤,具体包括:
    基于预设调整规则对所述初始第一分类模型的损失函数进行反转,得到第二损失函数;
    将所述第二训练语料导入损失函数反转后的所述初始第一分类模型,获取分类结果;
    基于第二损失函数计算所述分类结果与预设分类结果的误差,得到分类误差;
    将分类误差与预设分类误差阈值进行比较,若分类误差小于或等于预设分类误差阈值,则通过反向传播算法对损失函数反转后的初始第一分类模型进行迭代更新,直到分类误差大于预设分类误差阈值为止;
    输出分类误差大于预设分类误差阈值的第一分类模型。
  20. 如权利要求17所述的计算机可读存储介质,其中,在所述基于预设调整规则对所述初始第一分类模型的损失函数进行调整,将所述第二训练语料导入损失函数调整后的所述初始第一分类模型,并基于反向传播算法对初始第一分类模型进行迭代更新,得到第一分类模型的步骤之后,还包括:
    对所述第一训练语料进行矢量化处理,得到所述第一训练语料的语料矢量;
    对所述语料矢量和所述特征矢量进行矢量拼接,得到语料特征矩阵;
    将所述语料特征矩阵导入预设的第二分类模型,通过所述第二分类模型的卷积核对所述语料特征矩阵进行卷积运算,获取卷积运算结果;
    基于所述卷积运算结果对所述第二分类模型进行迭代更新,输出训练完成的所述第二分类模型。
PCT/CN2021/090432 2020-12-30 2021-04-28 一种非均衡样本的分类方法、装置、设备及存储介质 Ceased WO2022142010A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011617671.4A CN112732913B (zh) 2020-12-30 2020-12-30 一种非均衡样本的分类方法、装置、设备及存储介质
CN202011617671.4 2020-12-30

Publications (1)

Publication Number Publication Date
WO2022142010A1 true WO2022142010A1 (zh) 2022-07-07

Family

ID=75610366

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/090432 Ceased WO2022142010A1 (zh) 2020-12-30 2021-04-28 一种非均衡样本的分类方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN112732913B (zh)
WO (1) WO2022142010A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115641465A (zh) * 2022-09-09 2023-01-24 西安电子科技大学 一种基于Transformer轻量化模型的遥感图像分类方法
CN119624627A (zh) * 2024-12-06 2025-03-14 中国工商银行股份有限公司 贷款质量评估方法、装置、电子设备、介质及产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095928A (zh) * 2016-06-12 2016-11-09 国家计算机网络与信息安全管理中心 一种事件类型识别方法及装置
CN110276075A (zh) * 2019-06-21 2019-09-24 腾讯科技(深圳)有限公司 模型训练方法、命名实体识别方法、装置、设备及介质
CN110569508A (zh) * 2019-09-10 2019-12-13 重庆邮电大学 融合词性和自注意力机制的情感倾向性分类方法及系统
US20200034482A1 (en) * 2018-07-26 2020-01-30 International Business Machines Corporation Verifying and correcting training data for text classification
CN111310814A (zh) * 2020-02-07 2020-06-19 支付宝(杭州)信息技术有限公司 利用不平衡正负样本对业务预测模型训练的方法及装置
CN111400443A (zh) * 2020-03-04 2020-07-10 北京松果电子有限公司 信息处理方法、装置及存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190156204A1 (en) * 2017-11-20 2019-05-23 Koninklijke Philips N.V. Training a neural network model
CN109815332B (zh) * 2019-01-07 2023-06-20 平安科技(深圳)有限公司 损失函数优化方法、装置、计算机设备及存储介质
CN109784421A (zh) * 2019-01-30 2019-05-21 北京朗镜科技有限责任公司 一种识别模型的构建方法及装置
CN110163261B (zh) * 2019-04-28 2024-06-21 平安科技(深圳)有限公司 不平衡数据分类模型训练方法、装置、设备及存储介质
CN111191685A (zh) * 2019-12-13 2020-05-22 山东众阳健康科技集团有限公司 一种损失函数动态加权的方法
CN111368903B (zh) * 2020-02-28 2021-08-27 深圳前海微众银行股份有限公司 模型性能优化方法、装置、设备及存储介质
CN112054967A (zh) * 2020-08-07 2020-12-08 北京邮电大学 网络流量分类方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095928A (zh) * 2016-06-12 2016-11-09 国家计算机网络与信息安全管理中心 一种事件类型识别方法及装置
US20200034482A1 (en) * 2018-07-26 2020-01-30 International Business Machines Corporation Verifying and correcting training data for text classification
CN110276075A (zh) * 2019-06-21 2019-09-24 腾讯科技(深圳)有限公司 模型训练方法、命名实体识别方法、装置、设备及介质
CN110569508A (zh) * 2019-09-10 2019-12-13 重庆邮电大学 融合词性和自注意力机制的情感倾向性分类方法及系统
CN111310814A (zh) * 2020-02-07 2020-06-19 支付宝(杭州)信息技术有限公司 利用不平衡正负样本对业务预测模型训练的方法及装置
CN111400443A (zh) * 2020-03-04 2020-07-10 北京松果电子有限公司 信息处理方法、装置及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115641465A (zh) * 2022-09-09 2023-01-24 西安电子科技大学 一种基于Transformer轻量化模型的遥感图像分类方法
CN119624627A (zh) * 2024-12-06 2025-03-14 中国工商银行股份有限公司 贷款质量评估方法、装置、电子设备、介质及产品

Also Published As

Publication number Publication date
CN112732913B (zh) 2023-08-22
CN112732913A (zh) 2021-04-30

Similar Documents

Publication Publication Date Title
CN113434636B (zh) 基于语义的近似文本搜索方法、装置、计算机设备及介质
CN111967266B (zh) 中文命名实体识别系统、模型构建方法和应用及相关设备
CN112633973B (zh) 一种商品推荐方法及其相关设备
WO2022142014A1 (zh) 基于多模态信息融合的文本分类方法、及其相关设备
CN114780727A (zh) 基于强化学习的文本分类方法、装置、计算机设备及介质
CN114780746A (zh) 基于知识图谱的文档检索方法及其相关设备
CN106649272B (zh) 一种基于混合模型的命名实体识别方法
WO2022007438A1 (zh) 情感语音数据转换方法、装置、计算机设备及存储介质
CN113051368B (zh) 双塔模型训练方法、检索方法、装置及电子设备
WO2021056710A1 (zh) 多轮问答识别方法、装置、计算机设备及存储介质
US20170150235A1 (en) Jointly Modeling Embedding and Translation to Bridge Video and Language
CN113505601A (zh) 一种正负样本对构造方法、装置、计算机设备及存储介质
CN110827929A (zh) 疾病分类编码识别方法、装置、计算机设备及存储介质
WO2022048363A1 (zh) 网站分类方法、装置、计算机设备及存储介质
CN112084752B (zh) 基于自然语言的语句标注方法、装置、设备及存储介质
WO2020147409A1 (zh) 一种文本分类方法、装置、计算机设备及存储介质
WO2021139107A1 (zh) 情感智能识别方法、装置、电子设备及存储介质
CN114238656A (zh) 基于强化学习的事理图谱补全方法及其相关设备
CN113887237A (zh) 多意图文本的槽位预测方法、装置及计算机设备
US12424010B2 (en) Character recognition model training method and apparatus, character recognition method and apparatus, device and storage medium
WO2021072863A1 (zh) 文本相似度计算方法、装置、电子设备及计算机可读存储介质
CN114637831A (zh) 基于语义分析的数据查询方法及其相关设备
CN112329454A (zh) 语种识别方法、装置、电子设备及可读存储介质
CN111898379A (zh) 槽填充模型训练方法和自然语言理解模型
CN113704466A (zh) 基于迭代网络的文本多标签分类方法、装置及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21912772

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21912772

Country of ref document: EP

Kind code of ref document: A1