CN115017290A - File question-answering system optimization method and device based on cooperative confrontation training - Google Patents

File question-answering system optimization method and device based on cooperative confrontation training Download PDF

Info

Publication number
CN115017290A
CN115017290A CN202210828777.1A CN202210828777A CN115017290A CN 115017290 A CN115017290 A CN 115017290A CN 202210828777 A CN202210828777 A CN 202210828777A CN 115017290 A CN115017290 A CN 115017290A
Authority
CN
China
Prior art keywords
archive
question
answering system
sample
bias
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.)
Granted
Application number
CN202210828777.1A
Other languages
Chinese (zh)
Other versions
CN115017290B (en
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.)
Zhejiang Xinghan Information Technology Ltd By Share Ltd
Original Assignee
Zhejiang Xinghan Information Technology Ltd By Share 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 Zhejiang Xinghan Information Technology Ltd By Share Ltd filed Critical Zhejiang Xinghan Information Technology Ltd By Share Ltd
Priority to CN202210828777.1A priority Critical patent/CN115017290B/en
Publication of CN115017290A publication Critical patent/CN115017290A/en
Application granted granted Critical
Publication of CN115017290B publication Critical patent/CN115017290B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The invention provides a method and a device for optimizing a file question-answering system based on cooperative confrontation training, which relate to the technical field of computers and comprise the following steps: generating an equivalent archive question-answering system according to an archive data set and an archive feature vector which are acquired in advance; generating a G-type bias archive sample and an O-type bias archive sample for an equivalent archive question-answering system; constructing a plurality of G-type-O type bias archive sample pairs according to the similarity of the samples to obtain a plurality of bias archive sample pair sets for collaborative countermeasure training; and performing cooperative confrontation training on the set by using the bias archive sample to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system. The method solves the problems that the existing file question-answering system is easily influenced by bias factors, low in stability and not fair enough in decision result, achieves the technical effects of eliminating the bias of the original file question-answering system and improving the accuracy of the returned result of the question-answering system.

Description

File question-answering system optimization method and device based on cooperative confrontation training
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for optimizing an archive question-answering system based on cooperative confrontation training.
Background
With the rapid development of deep learning technology, deep learning models are widely applied to various fields, including crime prediction, criminal arrest, enterprise recruitment, salary assessment, vehicle search and the like. The archive question-answering system based on deep learning can meet the information query requirements of managers on persons with key attributes and relevant skills, can assist the public security system to quickly locate relevant suspicious persons and target vehicles, and can help users who lose vehicles to quickly find the vehicles and the like. However, in the application process, the return result of the file questioning and answering system often has problems such as bias and discrimination, for example, in the traffic file questioning and answering system, the prediction result of the target vehicle may be affected by factors such as vehicle texture, vehicle color and vehicle shape.
That is to say, the existing archive question-answering system based on deep learning is susceptible to bias factors, and has the problems of low stability and impartial decision result.
Disclosure of Invention
The invention aims to provide a method and a device for optimizing an archive question-answering system based on cooperative confrontation training, so as to solve the technical problems that the prior art is easily influenced by bias factors, low in stability and not fair in decision result.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for optimizing an archive question-answering system based on collaborative confrontation training, including:
generating an equivalent archive question-answering system according to the pre-acquired archive data set and the archive feature vector;
generating a G-type bias archive sample and an O-type bias archive sample for the equivalent archive question-answering system;
constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive sample and the O type bias archive sample to obtain a plurality of bias archive sample pair sets for collaborative countermeasure training;
and performing cooperative confrontation training on the set by using the bias archive sample to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system.
In some possible embodiments, before generating the equivalent archive question answering system according to the archive data set and the archive feature vector acquired in advance, the method includes:
acquiring an archive data set; the archival data set includes a training set and a test set; converting archive sample data in a text form into archive feature vectors by using a feature embedding technology word2vec algorithm; determining an original archive question-answering system according to the archive question-answering system model; the archival question-answering system model includes a long-short term memory model LSTM.
In some possible embodiments, the generating an equivalent archive question-answering system from the pre-acquired archive data set and the archive feature vectors comprises: inputting the file feature vectors into the original file question-answering system to generate an output confidence coefficient of each file feature vector; and training the original archive question-answering system by using the archive feature vectors and the output confidence coefficient to generate an equivalent archive question-answering system.
In some possible embodiments, generating G-type bias profile samples and O-type bias profile samples for the equivalent profile question-answering system comprises:
generating a G-type bias archive sample aiming at the equivalent archive question-answering system based on gradient attack; generating an O-shaped bias archive sample aiming at the equivalent archive question-answering system based on optimization attack; respectively establishing corresponding bias archive sample training data sets based on the G-type bias archive sample and the O-type bias archive sample; wherein the gradient attack comprises: adding a first perturbation to the sample to increase a loss of the equivalence profile question answering system; the optimization attack comprises the following steps: a second perturbation is added to the sample to cause the equivalent archive question-answering system to give an error label.
In some possible embodiments, constructing a plurality of G-O type bias profile sample pairs according to the similarity of the samples to obtain a plurality of bias profile sample pair sets for collaborative confrontation training, includes:
constructing a plurality of G-type-O type prejudice archive sample pairs according to the similarity of the samples;
calculating the fairness contribution value of each G-O type prejudice archive sample to the equivalent archive question-answering system;
and performing descending arrangement on the G-type-O-type bias archive samples according to the fairness contribution value to generate a plurality of bias archive sample pair sets for collaborative countermeasure training.
In some possible embodiments, performing collaborative confrontation training on a set using the bias profile sample includes: and taking the plurality of G-type-O type bias archive sample pairs as training samples, and inputting the training samples into the equivalent archive question-answering system for training.
In some possible embodiments, the method further comprises:
testing the fair file question-answering system by using a test set;
when the test result meets the equal probability of the fairness evaluation index, the model is considered to be fair after training; the formula for the chance equality is:
Figure P_220714114720418_418182001
wherein the content of the first and second substances,
Figure F_220714114718725_725329001
representing model predictions, A is a sensitive attribute, Y represents a tag in the dataset, Y represents a target tag and Y represents a target tag
Figure M_220714114720482_482139001
Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
In a second aspect, an embodiment of the present invention provides an archive question-answering system optimization device based on collaborative confrontation training, including:
the system comprises a questioning and answering system generating module, a document feature vector generating module and a document data set generating module, wherein the questioning and answering system generating module is used for generating an equivalent document questioning and answering system according to a document data set and a document feature vector which are acquired in advance;
the data set establishing module is used for generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system;
the sample pair set generation module is used for constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive sample and the O type bias archive sample to obtain a plurality of bias archive sample pair sets used for collaborative confrontation training;
and the training module is used for performing collaborative confrontation training on the set by utilizing the bias archive sample so as to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system.
In some possible embodiments, the method further comprises: the test module is used for testing the fair file question-answering system by using a test set; when the test result meets the equal probability of the fairness evaluation index, the model is considered to be fair after training; the formula for the chance equality is:
Figure F_220714114718819_819069002
wherein, the first and the second end of the pipe are connected with each other,
Figure F_220714114718946_946045003
representing model predictions, A is a sensitive attribute, Y represents a tag in the dataset, Y represents a target tag and Y represents a target tag
Figure M_220714114720513_513382001
Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program operable on the processor, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing machine executable instructions that, when invoked and executed by a processor, cause the processor to perform the method of any of the first aspects.
The invention provides a method and a device for optimizing a file question-answering system based on cooperative confrontation training, which comprises the following steps: generating an equivalent archive question-answering system according to the pre-acquired archive data set and the archive feature vector; generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system; constructing a plurality of G-type-O type bias archive sample pairs according to the similarity of the samples to obtain a plurality of bias archive sample pair sets for collaborative countermeasure training; and performing cooperative confrontation training on the set by using the prejudice file sample to eliminate the prejudice of the original file question-answering system so as to obtain a fair file question-answering system. The method solves the problems that the existing file question-answering system is easily influenced by bias factors, has low stability and impartial decision results, and achieves the technical effects of eliminating the bias of the original file question-answering system and improving the accuracy of the returned results of the question-answering system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flow chart of an archive question-answering system optimization method based on collaborative confrontation training according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an archival question-answering system model based on collaborative confrontation training according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for optimizing a document question-answering system based on collaborative confrontation training;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
With the rapid development of deep learning technology, deep learning models are widely applied to various fields, including crime prediction, criminal arrest, enterprise recruitment, salary assessment, vehicle search and the like. The file question-answering system based on deep learning can meet the information query requirement of managers on personnel with key attributes and relevant skills, can assist a public security system to quickly locate relevant suspicious personnel and target vehicles, and can help users who lose vehicles to quickly find the vehicles and the like. However, in the application process, the return result of the file questioning and answering system often has problems such as bias and discrimination, for example, in the traffic file questioning and answering system, the prediction result of the target vehicle may be affected by factors such as vehicle texture, vehicle color and vehicle shape. That is to say, the existing archive question-answering system based on deep learning is susceptible to bias factors, and has the problems of low stability and impartial decision result.
Based on the above, the embodiment of the invention provides a method and a device for optimizing a file questioning and answering system based on collaborative confrontation training, so as to solve the problems that the existing file questioning and answering system is easily influenced by biased factors, low in stability and not fair in decision result.
To facilitate understanding of the present embodiment, first, a detailed description is given to an archive question-answering system optimization method based on collaborative confrontation training disclosed in the embodiment of the present invention, referring to a flowchart of an archive question-answering system optimization method based on collaborative confrontation training shown in fig. 1, where the method may be executed by an electronic device and mainly includes the following steps S110 to S140:
s110: generating an equivalent archive question-answering system according to the pre-acquired archive data set and the archive feature vector;
the archive data set is a data set formed by aiming at existing archive data, and contains all sample information of an existing archive, for example, sample attributes of each individual in the traffic archive data set include a brand, a model, a vehicle texture, a vehicle color, a vehicle shape and the like, the sample attributes also include sensitive attributes, and any one or more of the attributes can be used as the sensitive attributes according to actual application scenes, for example, the vehicle texture is the sensitive attributes.
S120: generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system;
s130: constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive sample and the O type bias archive sample to obtain a plurality of bias archive sample pair sets for collaborative countermeasure training;
s140: and performing cooperative confrontation training on the set by using the prejudice file sample to eliminate the prejudice of the original file question-answering system so as to obtain a fair file question-answering system.
As an embodiment, before the step S110 generates the equivalent archive question-answering system, the method further includes:
(1) acquiring an archive data set; the archive data set comprises a training set and a test set;
(2) converting archive sample data in a text form into archive feature vectors by using a feature embedding technology word2vec algorithm;
(3) determining an original archive question-answering system according to the archive question-answering system model; the archival question-and-answer system model includes a long-short term memory model LSTM.
Wherein, according to the archives data set and archives eigenvector generation equivalent archives inquiry-answering system that acquire in advance, include: firstly, inputting the file feature vectors into an original file question-answering system to generate an output confidence coefficient of each file feature vector; and then training the original file question-answering system by using the file characteristic vector and the output confidence coefficient to generate an equivalent file question-answering system.
As a specific example, generating G-type bias profile samples and O-type bias profile samples for an equivalent profile question-answering system includes:
1) generating a G-type bias archive sample aiming at an equivalent archive question-answering system based on gradient attack;
2) generating an O-shaped bias archive sample aiming at an equivalent archive question-answering system based on optimization attack;
3) respectively establishing corresponding bias archive sample training data sets based on the G-type bias archive sample and the O-type bias archive sample;
wherein the gradient attack comprises: adding a first perturbation to the sample to increase the loss of the equivalent archive question-answering system; the optimization attack comprises the following steps: adding a second perturbation to the sample to make the equivalent archive question-answering system give an error label, wherein the second perturbation is generally an imperceptible perturbation added to the sample, so that the model can give an error label with high confidence. Specifically, the disturbances are usually adjusted according to different demand scenarios corresponding to the corresponding threshold ranges. For example: when the first disturbance magnitude is from the threshold value A to the threshold value B, the loss of the model can be increased; and when the second disturbance is smaller than the threshold value C, the second disturbance is an imperceptible disturbance added to the sample.
In an embodiment, the constructing a plurality of G-O type bias profile sample pairs according to the similarity of the samples in the step S130 to obtain a plurality of bias profile sample pair sets for collaborative countermeasure training includes:
(1) constructing a plurality of G-type-O type bias archive sample pairs according to the similarity of the samples;
sample pair definition: hypothesis sample
Figure F_220714114719039_039757004
Structure of
Figure F_220714114719137_137441005
Wherein the third dimension is the sensitive property, that is x and x' are identical except for the opposite sensitive property, and the other properties are considered similar.
Wherein the sensitive attribute may be vehicle texture, vehicle color, vehicle shape, and the like.
(2) Calculating the fairness contribution value of each G-O type prejudice archive sample to the equivalent archive question-answering system;
the fairness contribution value can be calculated according to the following method, specifically including: and sequencing the sample pairs from large to small according to the similarity sequencing, calculating an accumulated value of probability difference (A =0, Y = 0) - (A =1, Y = 1) | of each sample pair, and dividing the accumulated value by the total number of the samples to obtain a fairness contribution value of each sample pair. Where (a =0, Y = 0) is the probability that the value of the dimension sensitivity attribute is 0 while the label is 0, and (a =1, Y = 1) is the probability that the value of the dimension sensitivity attribute is 1 while the label is 1.
Where a is 0, that is, the sensitivity attribute value is 0, and a is 1, that is, the sensitivity attribute value is 1. Y is 0, namely the label is 0 and corresponds to the marked negative sample in the archive data set; y ═ 1, i.e. label 1, corresponds to the marked positive exemplars in the archive dataset.
(3) And performing descending order on the G-type-O-type bias archive sample pairs according to the fairness contribution value to generate a plurality of bias archive sample pair sets for collaborative countermeasure training.
That is, the indexes of the sample pairs with the cumulative percentage of more than 80% in the above all sample pair fairness contribution values are determined, and the first 80% is the descending order of the required G-O type bias profile sample pairs from large to small.
In one embodiment, the performing collaborative countermeasure training on the set using the biased profile samples in step S140 includes: and taking a plurality of G-type-O type bias archive sample pairs as training samples, and inputting the training samples into an equivalent archive question-answering system for training.
In an embodiment, the above method for optimizing a dossier question-answering system based on collaborative confrontation training may further include:
testing a fair file question-answering system by using a test set;
when the test result meets the equal probability of the fairness evaluation index, the model is considered to be fair after training; the chance equality formula is:
Figure F_220714114719231_231162006
wherein the content of the first and second substances,
Figure F_220714114719358_358209007
representing model predictions, A is a sensitive attribute, Y represents a tag in the dataset, Y represents a target tag and Y represents a target tag
Figure M_220714114720544_544659001
Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
As a specific example, with reference to the schematic structural diagram of the archival question-and-answer system model based on the collaborative countermeasure training shown in fig. 2, a archival question-and-answer system optimization method based on the collaborative countermeasure training shown in fig. 3 is introduced, and a specific flow of the archival question-and-answer system optimization method based on the collaborative countermeasure training is as follows:
1) data pre-processing
1.1) training the dataset with the archival dataset:
and adopting the archive data set as a training data set of an archive question-answering system optimization method based on cooperative confrontation training. The archive data set is a data set formed by aiming at the existing archive data, and contains all sample information of the existing archive, for example, the sample attribute of each individual in the traffic archive data set comprises the existing brand, model, vehicle texture, vehicle color, vehicle shape and the like, and the sample attribute also comprises a sensitive attribute, for example, the vehicle texture is a sensitive attribute.
However, research studies have found that the sensitive property of vehicle texture is often biased in the archival data set.
1.2) partitioning the data set:
the archive data set is composed of 10000 samples, and the invention takes 5: a scale of 1 divides the training set and the test set.
1.3) acquiring file feature vectors:
aiming at the existing archive data set, converting archive sample data in a text form into archive feature vectors by using a feature embedding technology word2vec algorithm; the model structure of word2vec consists of input, middle layers, and output. The input is a One-Hot vector; the middle layer is a hidden layer without an activation function; the dimensionality of the output layer is the same as that of the input layer, and Softmax regression is adopted. The Loss function is generally cross entropy, and a gradient descent algorithm is adopted to update the weight.
2) Model construction
2.1) selecting archive question-answering system model
The LSTM is used as an archive question-answering system model, and Long-short term memory (LSTM) is a special RNN and mainly aims to solve the problems of gradient extinction and gradient explosion in the Long sequence training process. In short, LSTM can perform better in longer sequences than normal RNNs.
2.2) constructing an equivalent archive question-answering system
Aiming at the existing archive data set, converting archive sample data in a text form into archive feature vectors by using a feature embedding technology word2vec algorithm; then inputting the file feature vectors into an original file question-answering system to obtain the output confidence of each file feature vector; then, training a new archive question-answering system by using the archive characteristic vectors and the output confidence coefficient, wherein the new archive question-answering system is an equivalent archive question-answering system; the equivalent archive question-answering system and the original archive question-answering system have the same network structure, but the used training data labels are different, and the weight parameters in the network are also different.
3) Model depolarization
3.1) creating G-type bias archive samples
And generating a bias archive sample aiming at the equivalent archive question-answering system based on the gradient attack, and establishing a G-type bias archive sample training data set. Modifying the vehicle texture information in the existing archive sample data set, and converting the modified archive sample data into archive feature vectors by using a word2vec algorithm; inputting the characteristic vectors into an equivalent archive question-answering system, deriving a system input layer by a system output layer to obtain gradient information, and calculating disturbance by utilizing the gradient information to obtain a bias sample archive; and repeating the operation to calculate the bias sample file corresponding to each original file, and establishing a bias sample file training data set named as a G-type bias sample file training data set.
3.2) establishing O-type bias archive sample
And generating a bias sample file aiming at the equivalent file question-answering system based on optimization attack, and establishing an O-shaped bias sample file training data set. Modifying the vehicle texture information in the existing archive data set, and converting the modified archive text data into a feature vector by using a word2vec function; inputting the characteristic vectors into an equivalent archive question-answering system, and calculating disturbance by using random noise optimization to obtain a bias sample archive, wherein an optimization object is a confidence value of an output layer of the equivalent archive question-answering system; and repeating the operation to calculate the bias sample file corresponding to each original file, and establishing a bias sample file training data set named as an O-shaped bias sample file training data set.
3.2) Debias operation
And establishing an ordered sample pair set for collaborative confrontation training according to the G-type bias sample archive training data set and the O-type bias sample archive training data set. Establishing G-type-O type sample pairs according to the similarity of the samples, and calculating the fairness contribution value of each pair of G-type-O type sample pairs to an equivalent archive question-answering system; and performing descending sequencing on the G-type-O-type sample pairs according to the contribution values to obtain an ordered sample pair set for the cooperative countermeasure training.
And performing G-type and O-type cooperative confrontation training by utilizing the ordered sample pair set to eliminate the prejudice of the original file question-answering system, thereby obtaining a fair file question-answering system. The cooperative confrontation training process is to input the mixture of the G-type bias sample file, the O-type bias sample file and the original sample file into the model for training.
4) Test model
Inputting the test set divided in step 1.2) into the model shown in FIG. 2
Figure F_220714114719451_451928008
And when the test result of the test set meets the fairness evaluation index chance equality, the model is considered to be fair after training.
Wherein, the formula of chance equality is:
Figure F_220714114719549_549069009
in the above formula, the first and second carbon atoms are,
Figure F_220714114719642_642779010
representing model prediction, wherein A is a sensitive attribute, Y represents a label in a data set, Y represents a target label and belongs to Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
According to the optimization method of the archive question-answering system based on the countermeasure samples, the G-type and O-type collaborative countermeasure training is carried out by utilizing the ordered sample pair set to eliminate the prejudice of the original archive question-answering system, and the fair archive question-answering system is obtained.
Firstly, finding out the prejudice and discrimination existing in an archive question-answering system based on a confrontation sample according to known sensitivity attributes, and positioning a corresponding prejudice nerve layer; and then, the confrontation sample and the normal sample are mixed to retrain the bias neural layer in the file question-answering system, so that bias factors in the file question-answering system are eliminated quickly and lightly, and a set of file question-answering system capable of making fair decision is obtained.
In addition, the embodiment of the present invention further provides an archive question-answering system optimization device based on collaborative confrontation training, including:
the system comprises a question-answering system generating module, a file characteristic vector generating module and a file data set generating module, wherein the question-answering system generating module is used for generating an equivalent file question-answering system according to a file data set and a file characteristic vector which are acquired in advance;
the data set establishing module is used for generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system and establishing a corresponding bias archive sample training data set;
the sample pair set generation module is used for constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive samples and the O type bias archive samples to obtain a plurality of bias archive sample pair sets used for collaborative confrontation training;
and the training module is used for performing collaborative confrontation training on the set by utilizing the bias archive samples so as to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system.
In one embodiment, the apparatus may further include: the test module is used for testing the fair file question-answering system by using a test set; when the test result meets the equal probability of the fairness evaluation index, the model is considered to be fair after training; the chance equality formula is:
Figure F_220714114719739_739456011
wherein the content of the first and second substances,
Figure F_220714114719866_866408012
representing model predictions, A being a sensitive attribute, Y representing a label in the dataset, Y representingA target tag and Y belongs to Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
The archive question-answering system optimizing device based on collaborative confrontation training provided by the embodiment of the application can be specific hardware on equipment or software or firmware installed on the equipment and the like. The device provided by the embodiment of the present application has the same implementation principle and technical effect as the foregoing method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the foregoing method embodiments where no part of the device embodiments is mentioned. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. The device for optimizing the file questioning and answering system based on the cooperative countermeasure training provided by the embodiment of the application has the same technical characteristics as the method for optimizing the file questioning and answering system based on the cooperative countermeasure training provided by the embodiment, so that the same technical problems can be solved, and the same technical effect can be achieved.
The embodiment of the application further provides an electronic device, and specifically, the electronic device comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above described embodiments.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 400 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected through the bus 42; the processor 40 is arranged to execute executable modules, such as computer programs, stored in the memory 41.
The Memory 41 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, etc. may be used.
The bus 42 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The memory 41 is used for storing a program, the processor 40 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 40, or implemented by the processor 40.
The processor 40 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 40. The Processor 40 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in a memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the method in combination with the hardware thereof.
Corresponding to the method, the embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores machine executable instructions, and when the computer executable instructions are called and executed by a processor, the computer executable instructions cause the processor to execute the steps of the method.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters indicate like items in the figures, and thus once an item is defined in a figure, it need not be further defined or explained in subsequent figures, and moreover, the terms "first," "second," "third," etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for optimizing a file question-answering system based on collaborative confrontation training is characterized by comprising the following steps:
generating an equivalent archive question-answering system according to the pre-acquired archive data set and the archive feature vector;
generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system;
constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive samples and the O type bias archive samples to obtain a plurality of bias archive sample pair sets for collaborative confrontation training;
and performing cooperative confrontation training on the set by using the bias archive sample to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system.
2. The method of claim 1, wherein before generating the equivalent archive question answering system from the pre-acquired archive data sets and archive eigenvectors, comprising:
acquiring an archive data set; the archival data set includes a training set and a test set;
converting archive sample data in a text form into archive feature vectors by using a feature embedding technology word2vec algorithm;
determining an original archive question-answering system according to the archive question-answering system model; the archival question-answering system model includes a long-short term memory model LSTM.
3. The method of claim 2, wherein generating an equivalent archive question answering system from the pre-acquired archive data sets and archive eigenvectors comprises:
inputting the file feature vectors into the original file question-answering system to generate an output confidence coefficient of each file feature vector;
and training the original archive question-answering system by using the archive feature vectors and the output confidence coefficient to generate an equivalent archive question-answering system.
4. The method of claim 3, wherein generating G-type and O-type bias profile samples for the equivalent profile question answering system comprises:
generating a G-type bias archive sample aiming at the equivalent archive question-answering system based on gradient attack;
generating an O-shaped bias archive sample aiming at the equivalent archive question-answering system based on optimization attack;
respectively establishing corresponding bias archive sample training data sets based on the G-type bias archive sample and the O-type bias archive sample;
wherein the gradient attack comprises: adding a first perturbation to the sample to increase the loss of the equivalence profile question-answering system; the optimization attack comprises the following steps: a second perturbation is added to the sample to cause the equivalent archive question-answering system to give an error label.
5. The method of claim 1, wherein constructing a plurality of G-O bias profile sample pairs according to sample similarity to obtain a plurality of bias profile sample pair sets for collaborative confrontation training comprises:
constructing a plurality of G-type-O type bias archive sample pairs according to the similarity of the samples;
calculating the fairness contribution value of each G-O type prejudice archive sample to the equivalent archive question-answering system;
and performing descending arrangement on the G-type-O-type bias archive samples according to the fairness contribution value to generate a plurality of bias archive sample pair sets for collaborative countermeasure training.
6. The method of claim 1, wherein utilizing the bias profile sample for collaborative countermeasure training of a set comprises:
and taking the plurality of G-O type bias archive sample pairs as training samples, and inputting the training samples into the equivalent archive question-answering system for training.
7. The method of claim 1, further comprising:
testing the fair file question-answering system by using a test set;
when the test result meets the equal probability of the fairness evaluation index, the model is considered to be fair after training; the formula for the chance equality is:
Figure F_220714114716765_765830001
wherein the content of the first and second substances,
Figure F_220714114716859_859630002
representing model predictions, A is a sensitive attribute, Y represents a tag in the dataset, Y represents a target tag and Y represents a target tag
Figure M_220714114717236_236563001
Y {0, 1 }; and when the results of the left side and the right side of the above formula are equal, the model is considered to achieve the depolarization effect.
8. An archive question-answering system optimization device based on cooperative confrontation training is characterized by comprising:
the system comprises a question-answering system generating module, a file characteristic vector generating module and a file data set generating module, wherein the question-answering system generating module is used for generating an equivalent file question-answering system according to a file data set and a file characteristic vector which are acquired in advance;
the data set establishing module is used for generating a G-type bias archive sample and an O-type bias archive sample aiming at the equivalent archive question-answering system;
the sample pair set generation module is used for constructing a plurality of G-O type bias archive sample pairs according to the similarity of the G type bias archive sample and the O type bias archive sample to obtain a plurality of bias archive sample pair sets used for collaborative confrontation training;
and the training module is used for performing collaborative confrontation training on the set by utilizing the bias archive sample so as to eliminate the bias of the original archive question-answering system and obtain a fair archive question-answering system.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program operable on the processor, and wherein the processor implements the steps of the method of any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium having stored thereon machine executable instructions which, when invoked and executed by a processor, cause the processor to execute the method of any of claims 1 to 7.
CN202210828777.1A 2022-07-15 2022-07-15 File question-answering system optimization method and device based on cooperative confrontation training Active CN115017290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210828777.1A CN115017290B (en) 2022-07-15 2022-07-15 File question-answering system optimization method and device based on cooperative confrontation training

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210828777.1A CN115017290B (en) 2022-07-15 2022-07-15 File question-answering system optimization method and device based on cooperative confrontation training

Publications (2)

Publication Number Publication Date
CN115017290A true CN115017290A (en) 2022-09-06
CN115017290B CN115017290B (en) 2022-11-08

Family

ID=83081180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210828777.1A Active CN115017290B (en) 2022-07-15 2022-07-15 File question-answering system optimization method and device based on cooperative confrontation training

Country Status (1)

Country Link
CN (1) CN115017290B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111898731A (en) * 2020-06-24 2020-11-06 北京航空航天大学 Bias-based universal countermeasure patch generation method and device
CN112115963A (en) * 2020-07-30 2020-12-22 浙江工业大学 Method for generating unbiased deep learning model based on transfer learning
US20210097405A1 (en) * 2019-10-01 2021-04-01 International Business Machines Corporation Bias Identification in Cognitive Computing Systems
US20210357508A1 (en) * 2020-05-15 2021-11-18 Deutsche Telekom Ag Method and a system for testing machine learning and deep learning models for robustness, and durability against adversarial bias and privacy attacks
CN114419379A (en) * 2022-03-30 2022-04-29 浙江大学 System and method for improving fairness of deep learning model based on antagonistic disturbance
CN114462466A (en) * 2021-12-06 2022-05-10 浙江工业大学 Deep learning-oriented data depolarization method
CN114492830A (en) * 2021-12-16 2022-05-13 浙江工业大学 Deep learning model depolarization method and device based on individual discrimination example pair generation
CN114626507A (en) * 2022-03-15 2022-06-14 西安交通大学 Method, system, device and storage medium for generating confrontation network fairness analysis

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210097405A1 (en) * 2019-10-01 2021-04-01 International Business Machines Corporation Bias Identification in Cognitive Computing Systems
US20210357508A1 (en) * 2020-05-15 2021-11-18 Deutsche Telekom Ag Method and a system for testing machine learning and deep learning models for robustness, and durability against adversarial bias and privacy attacks
CN111898731A (en) * 2020-06-24 2020-11-06 北京航空航天大学 Bias-based universal countermeasure patch generation method and device
CN112115963A (en) * 2020-07-30 2020-12-22 浙江工业大学 Method for generating unbiased deep learning model based on transfer learning
CN114462466A (en) * 2021-12-06 2022-05-10 浙江工业大学 Deep learning-oriented data depolarization method
CN114492830A (en) * 2021-12-16 2022-05-13 浙江工业大学 Deep learning model depolarization method and device based on individual discrimination example pair generation
CN114626507A (en) * 2022-03-15 2022-06-14 西安交通大学 Method, system, device and storage medium for generating confrontation network fairness analysis
CN114419379A (en) * 2022-03-30 2022-04-29 浙江大学 System and method for improving fairness of deep learning model based on antagonistic disturbance

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王仲林 等: ""Siasmese-ELECTRA网络结合对抗训练的FAQ问答模型研究"", 《软件导刊》 *

Also Published As

Publication number Publication date
CN115017290B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
CN113822494B (en) Risk prediction method, device, equipment and storage medium
US20240012928A1 (en) Differentially Private Processing and Database Storage
CN105426356B (en) A kind of target information recognition methods and device
US20190138743A1 (en) Differentially Private Processing and Database Storage
US10546106B2 (en) Biometric verification
CN104537252A (en) User state single-classification model training method and device
CN111611374A (en) Corpus expansion method and device, electronic equipment and storage medium
CN109190698B (en) Classification and identification system and method for network digital virtual assets
EP3591545A1 (en) Method for co-clustering senders and receivers based on text or image data files
CN113434684B (en) Rumor detection method, system, equipment and storage medium for self-supervision learning
CN111340144A (en) Risk sample detection method and device, electronic equipment and storage medium
CN106203165A (en) The big data analysis method for supporting of information based on credible cloud computing
CN113807073B (en) Text content anomaly detection method, device and storage medium
CN113591892A (en) Training data processing method and device
CN110427496B (en) Knowledge graph expansion method and device for text processing
CN115017290B (en) File question-answering system optimization method and device based on cooperative confrontation training
CN115310606A (en) Deep learning model depolarization method and device based on data set sensitive attribute reconstruction
CN112308153B (en) Firework detection method and device
CN111667339B (en) Defamation malicious user detection method based on improved recurrent neural network
CN114626626A (en) Model training method and device, storage medium and electronic equipment
CN111209567B (en) Method and device for judging perceptibility of improving robustness of detection model
CN114528908A (en) Network request data classification model training method, classification method and storage medium
CN113705692A (en) Emotion classification method and device based on artificial intelligence, electronic equipment and medium
CN110262906B (en) Interface label recommendation method and device, storage medium and electronic equipment
CN115204436A (en) Method, device, equipment and medium for detecting abnormal reasons of business indexes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant