Training methods and devices for text discrimination models; text discrimination methods and devices

By combining generator and discriminator training methods, the generator generates target text data and updates the initial model, which solves the problem of insufficient fairness of AI models in predicting fraudulent activities in telecommunications SMS messages and improves the accuracy and fairness of the model.

CN116881774BActive Publication Date: 2026-03-10CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing AI models, in the scenario of predicting fraudulent activities in telecommunications SMS messages, fail to fully consider fairness, resulting in biased and discriminatory predictions that affect accuracy.

Method used

A combined training method using a generator and two discriminators is adopted. The generator generates target text data, and the discrimination results of the first and second discriminators are used to update the generator and the initial model. This ensures that the generated target text data is sufficiently close to the reference text data on the initial model, thereby improving the accuracy and fairness of the model.

Benefits of technology

It improves the accuracy and fairness of the text discrimination model, reduces biased and discriminatory predictions, and enhances the overall performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116881774B_ABST
    Figure CN116881774B_ABST
Patent Text Reader

Abstract

This disclosure relates to the field of machine learning technology, specifically to a training method and apparatus for a text discrimination model, a computer-readable storage medium, and an electronic device. The method includes: acquiring a training dataset, which includes basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data; converting the basic text data using a generator to obtain target text data; using the target text data and the reference text data as input data to a first discriminator to obtain a first discrimination result; inputting the target text data into an initial model to obtain a second label, and using the first label and the second label as input to a second discriminator to obtain a second discrimination result; updating the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result, and updating the initial model based on the updated generator and training data to obtain a text discrimination model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of machine learning technology, and more specifically, to a training method and apparatus for a text discrimination model, a text discrimination method and apparatus, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Artificial intelligence technology can help network operators provide better service quality and improve operational reliability. However, the fairness of machine learning is often not given sufficient attention in this process. For example, in the scenario of predicting fraud in telecommunications SMS messages, the keywords contained in the SMS messages often have domain characteristics, thus containing many words involving fairness or sensitivity, such as user phone numbers, names, and regions. Without considering fairness, the AI ​​model will directly learn from this data involving user privacy and fairness judgments to identify fraud, even if the model has a good accuracy rate.

[0003] However, in practical applications, these models may produce incorrect, biased, or even discriminatory predictions due to model bias, resulting in poor model accuracy.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this disclosure is to provide a training method for a text discrimination model, a training device for a text discrimination model, a text discrimination method and a text discrimination device, a computer-readable storage medium and an electronic device, thereby overcoming, to at least a certain extent, the technical problem of poor accuracy in related technologies.

[0006] According to a first aspect of this disclosure, a method for training a text discrimination model is provided, comprising: acquiring a training dataset, the training dataset including basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data; converting the basic text data using a generator to obtain target text data; using the target text data and the reference text data as input data to a first discriminator to obtain a first discrimination result; inputting the target text data into an initial model to obtain a second label, and using the first label and the second label as input to a second discriminator to obtain a second discrimination result; updating the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result, and updating the initial model based on the updated generator and training data to obtain a text discrimination model.

[0007] According to a second aspect of this disclosure, a text discrimination method is provided, comprising: acquiring a text to be discriminated, and inputting the text to be discriminated into a generator to obtain a target discriminated text corresponding to the text to be discriminated; inputting the text to be discriminated and the target discriminant model into a text discrimination model to obtain a discrimination result; wherein the text discrimination model is obtained by the training method of the aforementioned text discrimination model.

[0008] According to a third aspect of this disclosure, a training apparatus for a text discrimination model is provided, comprising: a data acquisition module for acquiring a training dataset, the training dataset including basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data; a data conversion module for converting the basic text data through a generator to obtain target text data; a text discrimination model for using the target text data and reference text data as input data to a first discriminator to obtain a first discrimination result; a label discrimination module for inputting the target text data into the initial model to obtain a second label, and using the first label and the second label as input to a second discriminator to obtain a second discrimination result; and a model training module for updating the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result, and updating the initial model based on the updated generator and training data to obtain the text discrimination model.

[0009] According to a fourth aspect of this disclosure, a training apparatus for a text discrimination model is provided, comprising: a text generation module for acquiring a text to be discriminated and inputting the text to be discriminated into a generator to obtain a target discriminated text corresponding to the text to be discriminated; and a text discrimination module for inputting the text to be discriminated and the target discrimination model into a text discrimination model to obtain a discrimination result; wherein the text discrimination model is obtained by a training method for a text discrimination model.

[0010] According to a fifth aspect of this disclosure, a computer-readable storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described above.

[0011] According to a sixth aspect of this disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method described above.

[0012] An embodiment of this disclosure provides a training method for a text discrimination model. The generator is trained using the first and second discrimination results of a first and a second discriminator, and the updated generator is used to update the initial model. The first discrimination result is used to determine the accuracy of the target text data generated by the generator, and the second discrimination result is used to ensure that the target text data and the reference text data are sufficiently close in distance on the initial model. This assists the generator in generating a dataset that ensures the accuracy of the initial model, thereby improving the accuracy of the obtained text discrimination model.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0014] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0015] Figure 1 A schematic diagram of an exemplary system architecture to which embodiments of the present disclosure may be applied is shown.

[0016] Figure 2 The flowchart illustrates a method for training a text discrimination model according to an exemplary embodiment of the present disclosure.

[0017] Figure 3 The diagram illustrates the data flow of a training method for a text discrimination model in an exemplary embodiment of the present disclosure.

[0018] Figure 4 The diagram illustrates the data flow of a training method for another text discrimination model in an exemplary embodiment of this disclosure.

[0019] Figure 5 The flowchart illustrating the text discrimination method in an exemplary embodiment of this disclosure is shown schematically.

[0020] Figure 6 This schematic diagram illustrates the composition of a training apparatus for a text discrimination model in an exemplary embodiment of the present disclosure.

[0021] Figure 7 The schematic diagram illustrates the composition of the text discrimination device in an exemplary embodiment of the present disclosure.

[0022] Figure 8 A schematic diagram of an electronic device to which embodiments of the present disclosure may be applied is shown. Detailed Implementation

[0023] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0024] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0025] In the telecommunications sector, artificial intelligence (AI) technology can help network operators provide better service quality and improve operational reliability. However, the fairness of machine learning is often overlooked in this process. For example, in the scenario of predicting fraudulent SMS messages, the keywords contained in the messages often have domain-specific characteristics, including many words related to fairness or sensitivity, such as user phone numbers, names, and regions. Without considering fairness, AI models will directly learn from this data involving user privacy and fairness judgments to identify fraud. Even if the model achieves good accuracy, in practical applications, model bias can lead to incorrect, biased, or even discriminatory predictions, which can cause significant harm to users and companies. On the other hand, private data often contains relevant information needed for model decision-making. Including this information in the training data often plays a crucial role in improving the model's accuracy. Therefore, directly removing sensitive information to ensure model fairness often leads to a decline in the model's performance. Thus, how to ensure the accuracy of AI models while simultaneously guaranteeing model fairness has become a pressing issue for the industry.

[0026] To address the aforementioned shortcomings, this disclosure provides a training method for a text discrimination model. Figure 1A schematic diagram of a system architecture for implementing the above-described text discrimination model training method is shown. This system architecture 100 may include a terminal 110 and a server 120. The terminal 110 may be a smartphone, tablet, desktop computer, laptop, or other terminal device. The server 120 generally refers to the backend system providing training-related services for the text discrimination model in this exemplary embodiment, and may be a single server or a cluster of multiple servers. The terminal 110 and the server 120 can be connected via a wired or wireless communication link for data interaction.

[0027] In one implementation, the training method of the text discrimination model described above can be executed by the terminal 110. For example, the user uses the terminal 110 to obtain a training dataset, wherein the training dataset includes basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data. The terminal 110 converts the basic text data through a generator to obtain target text data; the target text data and the reference text data are used as input data for the first discriminator to obtain a first discrimination result; the target text data is input to the initial model to obtain a second label, and the first label and the second label are used as input to the second discriminator to obtain a second discrimination result; the generator, the first discriminator, and the second discriminator are updated based on the first discrimination result and the second discrimination result, and the initial model is updated based on the updated generator and training data to obtain a text discrimination model, and the text discrimination model is output.

[0028] In one implementation, the training method of the text discrimination model described above can be executed by server 120. For example, a user uses terminal 110 to obtain a training dataset, which includes basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data. Terminal 110 then uploads the training dataset to server 120, where server 120 uses a generator to convert the basic text data into target text data; uses the target text data and reference text data as input data to a first discriminator to obtain a first discrimination result; inputs the target text data into an initial model to obtain a second label, and uses the first label and the second label as input to a second discriminator to obtain a second discrimination result; updates the generator, the first discriminator, and the second discriminator based on the first and second discrimination results, and updates the initial model based on the updated generator and training data to obtain a text discrimination model, which is then returned to terminal 110.

[0029] As can be seen from the above, the execution subject of the text discrimination model method in this exemplary embodiment can be the aforementioned terminal 110 or server 120, and this disclosure does not limit it in this regard.

[0030] The following is combined Figure 2The training method of the text discrimination model in this exemplary embodiment will be described. Figure 2 An exemplary flow of the training method for the text discrimination model is shown, which may include steps S210 to S250.

[0031] In step S210, a training dataset is obtained, which includes basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data.

[0032] In one example implementation of this disclosure, a training dataset may first be obtained, wherein the training dataset may include basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data.

[0033] The aforementioned basic text data may be data that does not include user privacy data, while the reference text data is the truth value privacy data corresponding to the aforementioned basic text data.

[0034] For example, if the above text discrimination is applied to determine whether a text message is a scam, the basic text data can be the text message itself, but does not include data such as user name, phone number, ID number, age, etc. The reference text data includes data such as user name, phone number, ID number, age, etc., and the first tag can be the probability that the text message is a scam.

[0035] It should be noted that the type of the basic text data mentioned above can be other types of data, and no specific limitation is made in this example implementation.

[0036] In step S220, the basic text data is transformed by the generator to obtain the target text data.

[0037] In this example implementation, refer to Figure 3 As shown, a generator can be used to generate target text data corresponding to the basic text data. Specifically, the target text data generated by the generator is the reference privacy data corresponding to the aforementioned basic text data.

[0038] Specifically, the aforementioned basic text data can be fair data, while the aforementioned target text data is fake unfair data generated from fair data.

[0039] For example, if the above text discrimination is applied to determine whether a text message is a scam, the basic text data can be the text message itself, but does not include data such as user name, phone number, ID number, age, etc. The target text data can include fake user name, phone number, ID number, age, and other reference privacy data generated by the generator.

[0040] In step S230, the target text data and the reference text data are used as input data for the first discriminator to obtain the first discrimination result.

[0041] In one exemplary embodiment of this disclosure, reference is made to Figure 3 As shown, the target text data is fake unfair data generated by the generator, and the reference text data is real unfair data. The target text data and the reference text data can then be input into the first discriminator to obtain a first discrimination result. This result is used to determine whether the true privacy data and the reference privacy data are the same.

[0042] Specifically, the target text vector corresponding to the target text data and the reference text vector corresponding to the reference text data can be obtained first. The first discriminator is used to determine the distance between the reference text vector and the target text vector. The distance can be cosine distance or Euclidean distance. The calculation method of cosine distance or Euclidean distance can refer to relevant technologies, and is not specifically limited in this example implementation.

[0043] In this example implementation, a preset distance threshold can be determined. The specific value of the preset distance threshold can be customized according to user needs, and is not specifically limited in this example implementation.

[0044] The first discrimination result can be determined based on the distance and the preset distance threshold. Specifically, when the distance is less than the preset distance threshold, the target text data is determined to meet the preset conditions.

[0045] In step S240, the target text data is input into the initial model to obtain the second label, and the first label and the second label are used as inputs to the second discriminator to obtain the second discrimination result.

[0046] After obtaining the target text data mentioned above, refer to Figure 3 As shown, the target text data can be input into the initial model to obtain the second label. After obtaining the second label, the first label and the second label can be input into the second discriminator to obtain the second discrimination result.

[0047] Specifically, the second discriminator is used to determine whether the first label and the second label meet a preset condition, wherein the preset condition may be that the first label and the second label are equal within a threshold range.

[0048] In step S250, the generator, the first discriminator, and the second discriminator are updated based on the first and second discrimination results, and the initial model is updated based on the updated generator and the training data to obtain a text discrimination model.

[0049] In one example embodiment of this disclosure, after obtaining the first discrimination result and the second discrimination result, the generator, the first discriminator and the second discriminator can be updated based on the first discrimination result and the second discrimination result.

[0050] Specifically, this may include steps S310 to S340.

[0051] In step S310, the first loss function corresponding to the first discriminator is determined based on the first discrimination result, the generator output, and the training dataset.

[0052] In this example implementation, firstly, an adversarial generative neural network fairness model is trained. The adversarial generative neural network consists of two parts: a generator and a first discriminator. The training process is a game-like process. During adversarial training, the generator can iterate from the first discriminator to obtain the optimal state. At the same time, the first discriminator can continuously optimize to distinguish between the generated target sample data and the reference text data. The loss functions of the generator and the first discriminator are as follows:

[0053]

[0054] Where E (expected value) and D (discriminator) are defined, Log is the logarithmic function, G represents the generator, LG is the generator's loss function, and LD is the discriminator's loss function.

[0055] The generator can iterate from the feedback of the first discriminator to obtain the optimal state, while the first discriminator can continuously optimize to distinguish between the generated target text data and the reference text data. The loss function is as follows:

[0056]

[0057]

[0058] Where z is p z (z) Noise data in a distribution where x is p data(z) Real sample data in the distribution. To generate target text data from the base text data, a generator can be used to generate target text data contained in the sensitive data from the normal distribution. To ensure high-information-content relevance features, a first discriminator is used to distinguish the generated target text data from the reference text data. After the adversarial training process in this procedure, the final generator can be obtained to generate relevant information contained in the target text data for the initial model to model. A conditional generative adversarial network can be used to introduce information from the base text data, so that the generated target text data has good initial information content. It takes an additional condition c as input to both the generator and the discriminator, so the loss function of this discriminator can be described as:

[0059]

[0060] Where p unfair (x) represents the data distribution of the reference text data, p fair (c) represents the data distribution of the basic text data. The generator's loss function can be described as:

[0061]

[0062] In step S320, the second loss function corresponding to the second discriminator is determined based on the second discrimination result, the generator output, the initial model output, and the training dataset.

[0063] Furthermore, to improve the performance of the obtained text discrimination model, a second discriminator can be used to determine the distance between the first label and the second label, thereby further ensuring that the generator produces target text data that allows the text discrimination model to perform well. The second prime loss function of the second discriminator can be expressed as:

[0064]

[0065] in,: unfair-M (x) represents the first label mentioned above: G-unfair-M (3) indicates the second label mentioned above.

[0066] In step S330, the third loss function of the generator is determined based on the first discrimination result, the second discrimination result, the generator output, and the initial model output.

[0067] In this example implementation, the third loss function of the generator can be determined based on the first discrimination result, the second discrimination result, the generator output, and the initial model output. Specifically, the third loss function of the generator can be expressed as follows:

[0068]

[0069] In step S340, the first discriminator, the second discriminator, and the generator are updated based on the first loss function, the second loss function, and the third loss function, respectively.

[0070] In one exemplary embodiment of this disclosure, reference is made to Figure 3 As shown, after obtaining the first loss function, the second loss function, and the third loss function, the generator, the first discriminator, and the second discriminator can be updated by memorizing the first loss function, the second loss function, and the third loss function.

[0071] Specifically, the generator, the first discriminator, and the second discriminator are updated until the distance between the first label and the second label is equal within a threshold range, and the distance between the target text data and the reference text data is less than a preset threshold.

[0072] In one exemplary embodiment of this disclosure, reference is made to Figure 4 As shown, the training dataset may also include the third label corresponding to the basic text data. After obtaining the updated generator, the basic text data can be input into the updated generator to obtain the target text data. Then, the target text data and the basic text data are input into the initial model to obtain the fourth label.

[0073] After obtaining the third and fourth labels, the initial model can be updated using the third and fourth labels until the initial model meets the preset conditions to obtain the text discrimination model, which can make the obtained text discrimination model more accurate.

[0074] In summary, in this exemplary embodiment, the generator is trained using the first and second discrimination results of the first and second discriminators, and the updated generator is used to update the initial model. The first discrimination result determines the accuracy of the target text data generated by the generator, while the second discrimination result ensures that the target text data and the reference text data are sufficiently close in distance on the initial model. This assists the generator in generating a dataset that guarantees the accuracy of the initial model, thereby improving the accuracy of the obtained text discrimination model. Furthermore, after updating the generator, training the initial model using the target text data obtained from the updated generator further improves the accuracy of the obtained text discrimination model.

[0075] Furthermore, this disclosure also provides a new text discrimination method, referring to... Figure 5 As shown, the above text discrimination method may include steps S510 to S520.

[0076] In step S510, the text to be judged is obtained and input into the generator to obtain the target text corresponding to the text to be judged.

[0077] In this example implementation, the generator is an updated generator in the training method of the text discrimination model. It can obtain the text to be discriminated and then input the text to be discriminated into the generator to generate the target discriminated text corresponding to the text to be discriminated.

[0078] For example, if the above text discrimination is applied to determine whether a text message is a scam text message, the text to be discriminated against can be the text message itself, but does not include data such as user name, phone number, ID number, age, etc. The target text to be discriminated against can include fake user name, phone number, ID number, age, and other reference privacy data generated by the generator.

[0079] In step S520, the text to be judged and the target text to be judged are input into the text judgment model to obtain the judgment result.

[0080] The text discrimination model can be obtained by the training method of the text discrimination model mentioned above.

[0081] After obtaining the target text, the text to be judged and the target text can be input into the text discrimination model to obtain the discrimination result.

[0082] It should be noted that the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0083] Further reference Figure 6 As shown, this example embodiment also provides a text discrimination model training device 600, including a data acquisition module 610, a data conversion module 620, a text discrimination module 630, a label discrimination module 640, and a model training module 650. Wherein:

[0084] The data acquisition module 610 can be used to acquire a training dataset, which includes basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data; the data conversion module 620 can be used to convert the basic text data to obtain target text data through a generator; the text discrimination module 630 can be used to use the target text data and reference text data as input data to the first discriminator to obtain a first discrimination result; the label discrimination module 640 can be used to input the target text data into the initial model to obtain a second label, and use the first label and the second label as input to the second discriminator to obtain a second discrimination result; the model training module 650 can be used to update the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result, and update the initial model based on the updated generator and training data to obtain a text discrimination model.

[0085] In one example implementation, the data conversion module 620 can be configured to generate target text data, including reference privacy data, corresponding to the base text data via a generator.

[0086] In one example implementation, the text discrimination module 630 can be configured to acquire the target text vector corresponding to the target text data and the reference text vector corresponding to the reference text data; determine the distance between the reference text vector and the target text vector using a first discriminator; and determine a first discrimination result based on the distance and a preset distance threshold.

[0087] In one example implementation, the model training module 650 can be configured to determine a first loss function corresponding to the first discriminator based on a first discrimination result, the generator's output, and the training dataset; determine a second loss function corresponding to the second discriminator based on a second discrimination result, the generator's output, the initial model's output, and the training dataset; determine a third loss function for the generator based on the first discrimination result, the second discrimination result, the generator's output, and the initial model's output; and update the first discriminator, the second discriminator, and the generator based on the first loss function, the second loss function, and the third loss function, respectively.

[0088] In one example implementation, the training dataset also includes a third label corresponding to the basic text data. The model training module 650 can be configured to input the basic text data into the updated generator to obtain target text data; input the target text data and the basic text data into the initial model to obtain a fourth label; and update the initial model using the third label and the fourth label to obtain a text discrimination model.

[0089] Further reference Figure 7 As shown, this example embodiment also provides a text discrimination device 700, including a text generation module 710 and a text discrimination module 720.

[0090] The text generation module 710 can be used to acquire the text to be judged and input the text to be judged into the generator to obtain the target text to be judged. The text judgment module 720 can be used to input the text to be judged and the target text to be judged into the text judgment model to obtain the judgment result. The text judgment model is obtained by the training method. The generator mentioned above is the updated generator in the training method of the text judgment model.

[0091] The specific details of each module in the above-mentioned device have been described in detail in the method section of the implementation. For any undisclosed details, please refer to the implementation content of the method section, and therefore will not be repeated here.

[0092] Exemplary embodiments of this disclosure also provide an electronic device for performing the training method of the text discrimination model described above. This electronic device may be the terminal 110 or the server 120 described above. Generally, the electronic device may include a processor and a memory, the memory for storing executable instructions of the processor, and the processor configured to perform the training method of the text discrimination model by executing the executable instructions.

[0093] The following is based on Figure 8 Taking a mobile terminal 800 as an example, the construction of this electronic device will be described by way of example. Those skilled in the art will understand that, apart from components specifically designed for mobile purposes, Figure 8 The structure can also be applied to fixed types of equipment.

[0094] like Figure 8 As shown, the mobile terminal 800 may specifically include: a processor 801, a memory 802, a bus 803, a mobile communication module 804, an antenna 1, a wireless communication module 805, an antenna 2, a display screen 806, a camera module 807, an audio module 808, a power module 809, and a sensor module 810.

[0095] Processor 801 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, an encoder, a decoder, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). The training method of the text discrimination model in this exemplary embodiment can be executed by an AP, GPU, or DSP. When the method involves neural network-related processing, it can be executed by an NPU.

[0096] The processor 801 can be connected to the memory 802 or other components via the bus 803.

[0097] The memory 802 can be used to store computer executable program code, which includes instructions. The processor 801 executes various functional applications and data processing of the mobile terminal 800 by running the instructions stored in the memory 802. The memory 802 can also store application data, such as images, videos, and other files.

[0098] The communication functions of the mobile terminal 800 can be implemented through a mobile communication module 804, antenna 1, a wireless communication module 805, antenna 2, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 804 can provide 2G, 3G, 4G, and 5G mobile communication solutions for use on the mobile terminal 800. The wireless communication module 805 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication for use on the mobile terminal 800.

[0099] The display screen 806 is used to implement display functions, such as displaying the user interface, images, and videos. The camera module 807 is used to implement shooting functions, such as capturing images and videos. The audio module 208 is used to implement audio functions, such as playing audio and capturing voice. The power module 209 is used to implement power management functions, such as charging the battery, supplying power to the device, and monitoring battery status. The sensor module 810 may include a depth sensor 8101, a pressure sensor 8102, a gyroscope sensor 8103, a barometric pressure sensor 8104, etc., to implement corresponding sensing and detection functions.

[0100] Those skilled in the art will understand that various aspects of this disclosure can be implemented as a system, method, or program product. Therefore, various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as a "circuit," "module," or "system."

[0101] Exemplary embodiments of this disclosure also provide a computer-readable storage medium having a program product stored thereon capable of implementing the methods described above in this specification. In some possible embodiments, various aspects of this disclosure may also be implemented as a program product including program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0102] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0103] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.

[0104] Furthermore, program code for performing the operations of this disclosure can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0105] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0106] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A training method for a text discrimination model, characterized in that, The method comprises: obtaining a training data set, the training data set comprising basic text data, reference text data corresponding to the basic text data, and first labels corresponding to the reference text data; converting the basic text data by a generator to obtain target text data; inputting the target text data and the reference text data into a first discriminator to obtain a first discrimination result; inputting the target text data into an initial model to obtain second labels, and inputting the first labels and the second labels into a second discriminator to obtain a second discrimination result; updating the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result, and updating the initial model based on the updated generator and the training data to obtain a text discrimination model; wherein the reference text data is true value privacy data corresponding to the basic text data, and the first discrimination result is obtained by inputting the target text data and the reference text data into the first discriminator, comprising: obtaining a target text vector corresponding to the target text data and a reference text vector corresponding to the reference text data; determining the distance between the reference text vector and the target text vector by using the first discriminator; and determining the first discrimination result based on the distance and a preset distance threshold; the updating of the generator, the first discriminator, and the second discriminator based on the first discrimination result and the second discrimination result comprises: determining a first loss function corresponding to the first discriminator according to the first discrimination result, the output of the generator, and the training data set; determining a second loss function corresponding to the second discriminator according to the second discrimination result, the output of the generator, the output of the initial model, and the training data set; determining a third loss function of the generator according to the first discrimination result, the second discrimination result, the output of the generator, and the output of the initial model; and updating the first discriminator, the second discriminator, and the generator based on the first loss function, the second loss function, and the third loss function respectively.

2. The method of claim 1, wherein, The training data set further comprises third labels corresponding to the basic text data; the updating of the initial model based on the updated generator and the training data to obtain the text discrimination model comprises: inputting the basic text data into the updated generator to obtain the target text data; inputting the target text data and the basic text data into the initial model to obtain fourth labels; updating the initial model by using the third labels and the fourth labels to obtain the text discrimination model.

3. The method of claim 1, wherein, the conversion of the basic text data by the generator to obtain the target text data comprises: generating target text data including reference privacy data corresponding to the basic text data by the generator.

4. A text discrimination method characterized by comprising: The method comprises: obtaining a text to be discriminated, and inputting the text to be discriminated into a generator to obtain target discrimination text corresponding to the text to be discriminated; inputting the to-be-judged text and the target judgment text into the text judgment model to obtain a judgment result; The text judgment model is obtained by the training method of the text judgment model in any one of claims 1 to 3, wherein the generator is the updated generator in the training method of the text judgment model in any one of claims 1 to 3.

5. A training device for a text discrimination model, characterized in that, Comprising: a data acquisition module configured to acquire a training data set, the training data set comprising basic text data, reference text data corresponding to the basic text data, and a first label corresponding to the reference text data; a data conversion module configured to convert the basic text data into target text data by using a generator; a text judgment model configured to input the target text data and the reference text data into a first discriminator to obtain a first judgment result; a label judgment module configured to input the target text data into an initial model to obtain a second label, and input the first label and the second label into a second discriminator to obtain a second judgment result; a model training module configured to update the generator, the first discriminator, and the second discriminator based on the first judgment result and the second judgment result, and update the initial model based on the updated generator and the training data to obtain a text judgment model; wherein the reference text data is true value privacy data corresponding to the basic text data, and the first judgment result is obtained by inputting the target text data and the reference text data into the first discriminator, including: obtaining a target text vector corresponding to the target text data and a reference text vector corresponding to the reference text data; determining a distance between the reference text vector and the target text vector by using the first discriminator; and determining the first judgment result based on the distance and a preset distance threshold; the updating of the generator, the first discriminator, and the second discriminator based on the first judgment result and the second judgment result includes: determining a first loss function corresponding to the first discriminator according to the first judgment result, an output of the generator, and the training data set; determining a second loss function corresponding to the second discriminator according to the second judgment result, the output of the generator, an output of the initial model, and the training data set; determining a third loss function of the generator according to the first judgment result, the second judgment result, the output of the generator, and the output of the initial model; and updating the first discriminator, the second discriminator, and the generator based on the first loss function, the second loss function, and the third loss function, respectively.

6. A text discrimination device, characterized by comprising: Comprising: a text generation module configured to acquire to-be-judged text, and input the to-be-judged text into a generator to obtain target judgment text corresponding to the to-be-judged text; a text judgment module configured to input the to-be-judged text and the target judgment text into the text judgment model to obtain a judgment result; The text discrimination model is obtained by the training method of the text discrimination model in any one of claims 1 to 3, wherein the generator is the updated generator in the training method of the text discrimination model in any one of claims 1 to 3.

7. A computer readable storage medium having stored thereon a computer program, characterized in that, The program, when executed by a processor, implements the method of any one of claims 1 to 4.

8. An electronic device, comprising: Comprise: one or more processors; and a memory for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image generation method of generative adversarial network based on dual discriminators

    CN108460717A

  • Training method and device as well as computer equipment and readable storage medium

    CN108846124A