Method and system for constructing zero-shot stance detection model and computer device
Patent Information
- Application Number
- CN202310426300.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-04-20
AI Technical Summary
[0004]然而,通过对抗学习从文本中提取主题不变性特征,而立场检测的特点是基于主题的,而受TOAD模型的结构影响导致其在训练的时候会弱化文本与主题之间的相关性,同时TOAD模型在训练过程中需要提供待预测话题相关的未标注文本来辅助训练,否则会严重影响模型的性能,而现实生活中话题与文本几乎是无穷的,导致难以收集到所有的数据
(1)本发明提出了一种能够捕获文本与话题融合特征的同时结合立场不变特征的全新的零样本立场模型,并且不需要基于大量的未标注数据来辅助训练模型。
Smart Images

Figure CN117909725B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method, system, and computer device for constructing a zero-sample stance detection model. Background Technology
[0002] Adversarial learning is a machine learning technique that aims to deceive the model by providing deceptive input. The existing TOAD model uses adversarial learning and domain transfer structures to treat each topic as a domain, learning topic-invariant features in text that express stance across different topics. The TOAD model focuses on mining features in text that express stance but are unrelated to the topic. During classification, it simply concatenates topic vectors with stance features and uses a large amount of unlabeled data on the same topics as the test set to assist in training the topic discriminator. Specifically, the model consists of four components (DocumentEncoder, Transformation, Stance Classifier, Topic Discriminator). The model first processes the topic and text using the Document Encoder to generate topic vectors and text vectors. Then, the Transformation performs a linear transformation on the text vectors, which are then fed into the Stance Classifier and Topic Discriminator respectively. Adversarial learning improves the stance classification performance of the Stance Classifier while maximizing the Topic Discriminator's ability to discriminate topics.
[0003] During adversarial learning, the TOAD model is able to extract topic-invariant features from the text. In the final stage, it performs zero-shot stance detection by concatenating the topic-invariant features with the topic vector output by the Document Encoder. At the same time, the TOAD model needs to be provided with unlabeled text related to the topic to be predicted to assist in training; otherwise, the performance of the TOAD model will be severely affected.
[0004] However, adversarial learning extracts topic-invariant features from text, while stance detection is topic-based. Due to the structure of the TOAD model, it weakens the correlation between text and topic during training. At the same time, the TOAD model requires unlabeled text related to the topic to be predicted to assist in training, otherwise it will seriously affect the performance of the model. In real life, topics and texts are almost infinite, making it difficult to collect all the data. Summary of the Invention
[0005] Based on this, the purpose of this invention is to propose a method, system, and computer device for constructing a zero-shot stance detection model, which can capture the fusion features between the topic and the text and then combine them with topic-invariant features to improve the performance of the model in the zero-shot stance detection task, and overcome the shortcomings of the traditional TOAD model, which requires the provision of unlabeled text related to the topic to be predicted to assist in training.
[0006] According to the present invention, a method for constructing a zero-sample stance detection model includes: Obtain dataset samples, which include several examples, each of which includes a topic name and text content. Then, perform fusion encoding on the topic name and text content to obtain a fusion vector, a topic vector, and a text vector. Based on the domain transfer structure of adversarial learning, topic-invariant features are extracted from the topic vector and text vector, and the topic-invariant features are linearly transformed to obtain linearly transformed features. The linear transformation feature and the fusion vector are concatenated to obtain the concatenated feature, which is then input into the stance classifier. The linear transformation feature is input into the topic discriminator for training the zero-shot stance model. The zero-shot position model is trained in different modes during the training phase by using hyperparameter scheduling with control scheduling, so that the zero-shot position model can be trained in dynamic adjustment under different modes.
[0007] Furthermore, in the step of fusing and encoding the topic name and text content: The fusion coding loss is denoted as: in, The cross-entropy function represents the cross-entropy loss function, where · represents the fusion coding loss. This represents the position label predicted by the zero-sample position model. A label indicating one's true stance.
[0008] Further, the step of extracting topic-invariant features from the topic vector and text vector based on the domain transfer structure of adversarial learning, and performing a linear transformation on the topic-invariant features to obtain linearly transformed features includes: The topic vector and the text vector of the fused encoding input are encoded using bidirectional conditional encoding; The step of encoding the topic vector and the text vector of the fused encoding input using bidirectional conditional encoding includes: The topic vector is encoded into topic features using a first Bi-LSTM, and then the text vector is encoded using a second Bi-LSTM conditioned on the topic features. Simultaneously, scaling dot product attention is applied to the output of the second Bi-LSTM with the topic features as the query to generate a stance feature of the text vector on the topic vector, wherein the stance feature is the topic-invariant feature.
[0009] Further, the step of extracting topic-invariant features from the topic vector and text vector based on the domain transfer structure of adversarial learning, and performing a linear transformation on the topic-invariant features to obtain linearly transformed features includes: The topic-invariant features are linearly transformed according to the following formula: in, Indicates the characteristics of linear transformation. Indicates the characteristic of topic invariability. This represents the weight matrix for linear transformation of topic-invariant features.
[0010] Further, the steps of concatenating the linear transformation features and the fusion vector to obtain concatenated features, and inputting the concatenated features into the stance classifier, and inputting the linear transformation features into the topic discriminator for zero-shot stance model training, include: The hidden states of each Bi-LSTM are reconstructed using a nonlinear transformation, and adversarial learning is employed to train the zero-shot stance model by combining the losses of individual components. The losses in the joint confrontation mode are denoted as: This represents the intermediate loss in the joint confrontation mode. , All of these represent fixed hyperparameters. This represents the reconstruction loss of the first Bi-LSTM. This represents the reconstruction loss of the second Bi-LSTM. This represents the loss of the weight matrix under the linear transformation of topic-invariant features. This represents the position classifier loss. Let represent the total loss in the joint adversarial mode, λ represent the L2 regularization coefficient, Θ represent the trainable parameters of the fusion encoding module of the zero-shot stance model, and ρ represent the weights of the topic discriminator loss. This indicates the loss of the topic discriminator. This indicates L2 regularization.
[0011] Furthermore, the loss in the solo adversarial mode is denoted as: The individual confrontation mode is a special case of the joint confrontation mode. This indicates the loss in the solo combat mode.
[0012] Furthermore, the step of using hyperparameter scheduling with controlled scheduling to train the zero-shot position model in different modes during the training phase, so as to enable the zero-shot position model to be trained through dynamic adjustment in different modes, includes: Input hyperparameters η and μ to tune λ and ρ in the zero-shot position model, enabling training of the zero-shot position model in dynamic tuning across different modes, resulting in the loss of the final zero-shot position model: in, This represents the loss of the final zero-sample position model. η represents the F1 score of the model on the training set at the end of the current Epoch, and both η and μ range from (0, 1).
[0013] In another aspect, the present invention provides a system for constructing a zero-sample position model, the system comprising: Example content encoding module is used to obtain dataset samples, which include several examples. Each example includes a topic name and text content. The topic name and text content are fused and encoded to obtain a fused vector, a topic vector, and a text vector. The position feature extraction module is used to extract topic-invariant features from the topic vector and text vector according to the domain transfer structure of adversarial learning, and to perform a linear transformation on the topic-invariant features to obtain linearly transformed features. The training execution module is used to concatenate the linear transformation features and the fusion vector to obtain concatenated features, which are then input into the stance classifier. The linear transformation features are input into the topic discriminator for training the zero-shot stance model. The mode scheduling module is used to schedule the zero-shot position model in different modes during the training phase using hyperparameter control scheduling, so that the zero-shot position model can be trained in dynamic adjustment of different modes.
[0014] In another aspect, the present invention provides a storage medium, including storage of one or more programs that, when executed, implement the method for constructing a zero-sample position detection model as described above.
[0015] The invention also provides a computer device, the computer device including a memory and a processor, wherein: The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the method for constructing the zero-sample position detection model as described above.
[0016] Compared with the prior art, the present invention has the following advantages: (1) This invention proposes a novel zero-sample stance model that can capture text and topic fusion features while combining stance-invariant features, and does not require a large amount of unlabeled data to assist in training the model.
[0017] (2) By setting dynamic scheduling parameters, the model can dynamically schedule different modes of the model to participate in training during the training phase, so that it can learn better features and further improve the performance of the model.
[0018] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by means of embodiments of the invention. Attached Figure Description
[0019] Figure 1 This is a flowchart of the method for constructing the zero-sample stance detection model proposed in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the dynamic retrieval process in the first embodiment of the present invention; Figure 3 This is a schematic diagram of the zero-sample position model proposed in the first embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the zero-sample position model construction system proposed in the second embodiment of the present invention.
[0020] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0021] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0023] Please see Figure 1 The diagram shows a flowchart of the method for constructing a zero-sample stance detection model in the first embodiment of the present invention. The method includes steps S01 to S04, wherein: Step S01: Obtain dataset samples, which include several examples. Each example includes a topic name and text content. The topic name and text content are fused and encoded to obtain a fused vector, a topic vector, and a text vector. In this embodiment, the zero-shot position model to be constructed includes three modes: fusion encoding mode, joint adversarial mode, and individual adversarial mode. In this step, a large-scale pre-trained model is first used as an encoder to fuse and encode the topics and text in the examples, obtaining fusion vectors, topic vectors, and text vectors. The topic vector representation and text vector representation are then used as inputs for adversarial learning. Simultaneously, the fusion vector is input into a single-layer feedforward neural network for training in the fusion encoding mode.
[0024] Furthermore, in the fusion coding mode, its fusion coding loss is denoted as: in, Indicates the fusion coding loss, Represents the cross-entropy loss function. This represents the position label predicted by the zero-sample position model. A label indicating one's true stance.
[0025] Step S02: Extract topic-invariant features from the topic vector and text vector according to the domain transfer structure of adversarial learning, and perform a linear transformation on the topic-invariant features to obtain linearly transformed features: Adversarial learning's domain transfer structure is used to extract topic-invariant features (topic-independent features) from the text vector, independent of the topic vector, while the fused vector incorporates these features. Specifically, for each example, the fused input topic vector representation and text vector representation are encoded using bidirectional conditional coding (Bi-Cond), as follows: The topic vector is encoded into topic features using a first Bi-LSTM, and then the text vector is encoded using a second Bi-LSTM conditioned on the topic features. Simultaneously, scaling dot product attention is applied to the output of the second Bi-LSTM with the topic features as the query to generate a stance feature of the text vector on the topic vector, wherein the stance feature is the topic-invariant feature.
[0026] Furthermore, the topic-invariant features are linearly transformed according to the following formula: ; in, Indicates the characteristics of linear transformation. Indicates the characteristic of topic invariability. The weight matrix represents the linear transformation performed on topic-invariant features. By applying linear changes to topic-invariant features, the topic discriminator can generate topic-invariant representations without making large adjustments to these features.
[0027] Step S03: Concatenate the linear transformation feature and the fusion vector to obtain the concatenated feature, and input the concatenated feature into the stance classifier. The linear transformation feature is input into the topic discriminator for training the zero-shot stance model. It should be noted that both the stance classifier and the topic discriminator are composed of two layers of feedforward neural networks using the ReLU activation function.
[0028] To prevent the topic discriminator from corrupting the Bi-LSTM output during training, the hidden states of each Bi-LSTM need to be reconstructed using a non-linear transformation, and adversarial learning is employed to train the zero-shot stance model by combining the losses of individual components. The losses in the joint confrontation mode are denoted as: This represents the intermediate loss in the joint confrontation mode. , All of these represent fixed hyperparameters. This represents the reconstruction loss of the first Bi-LSTM. This represents the reconstruction loss of the second Bi-LSTM. This represents the loss of the weight matrix under the linear transformation of topic-invariant features. This represents the position classifier loss. Let represent the total loss in the joint adversarial mode, λ represent the L2 regularization coefficient, Θ represent the trainable parameters of the fusion encoding module of the zero-shot stance model, and ρ represent the weights of the topic discriminator loss. This indicates the loss of the topic discriminator. This indicates L2 regularization.
[0029] Furthermore, the reconstruction loss is the mean square error between the reconstructed vector and the original vector under the same nonlinearity. The Bi-LSTM reconstruction loss is denoted as... and The calculation formula is as follows: in, MSE (·) represents the mean squared error function, tan h (·) represents a nonlinear transformation function. This represents the output of the second Bi-LSTM, where b represents the bias number. This represents the output of the first Bi-LSTM. Represents topic vectors, Represents a text vector.
[0030] Adversarial learning is used to train by combining the losses of individual components to maximize the topic discriminator loss while minimizing the position classifier loss.
[0031] It should also be noted that the individual adversarial mode can be considered a special case of the joint adversarial mode, and the loss in the individual adversarial mode is denoted as: The individual confrontation mode is a special case of the joint confrontation mode. This indicates the loss in the solo combat mode.
[0032] Step S04: Use hyperparameter scheduling of control scheduling to schedule the zero-shot position model in different modes during the training phase, so that the zero-shot position model can be trained in dynamic adjustment of different modes.
[0033] Please see Figure 2 The diagram illustrates the dynamic scheduling process in this embodiment. Due to the instability of the adversarial learning training process, the model cannot converge in the short term, ultimately affecting its performance. Therefore, this embodiment further explores a dynamic scheduling learning strategy to leverage the advantages of each module and improve the overall model performance. Specifically, the model first trains the encoding module to fine-tune using fused representations, enhancing the encoder's feature representation capabilities. Based on this, the model trains the joint adversarial module. In this stage, the encoder participates in adversarial learning to ensure that the model's ability to learn the stance expressed by the text for a given topic is not weakened. Simultaneously, to prevent the model from updating too quickly, λ and ρ are adjusted slowly as the Epoch increases. Finally, the model trains individual adversarial modes. In this stage, the encoder parameters are frozen, and the model focuses on extracting general representations. Utilizing the instability of adversarial learning during training, dynamic scheduling hyperparameters η and μ are set to allow the model to train in dynamic adjustments across different modes, resulting in a final zero-sample stance model, the structure of which is shown below. Figure 3 As shown, further, the loss of the final zero-sample position model is: in, This represents the loss of the final zero-sample position model. η represents the F1 score of the model on the training set at the end of the current Epoch, and both η and μ range from (0, 1).
[0034] Compared with the prior art, the present invention has the following advantages: (1) This invention proposes a novel zero-sample stance model that can capture text and topic fusion features while combining stance-invariant features, and does not require a large amount of unlabeled data to assist in training the model.
[0035] (2) By setting dynamic scheduling parameters, the model can dynamically schedule different modes of the model to participate in training during the training phase, so that it can learn better features and further improve the performance of the model.
[0036] Please see Figure 4 The diagram shows a structural schematic of the zero-sample position model construction system in the second embodiment of the present invention. The system includes: Example content encoding module 10 is used to obtain dataset samples, which include several examples. Each example includes a topic name and text content. The topic name and text content are fused and encoded to obtain a fusion vector, a topic vector, and a text vector. The position feature extraction module 20 is used to extract topic-invariant features from the topic vector and text vector according to the domain transfer structure of adversarial learning, and to perform a linear transformation on the topic-invariant features to obtain linear transformation features. Furthermore, the position feature extraction module 20 also includes: A bidirectional encoding unit is used to encode the topic vector and the text vector of the fused encoding input using bidirectional conditional encoding; A linear transformation unit is used to perform a linear transformation on the topic-invariant features according to the following formula: ; in, Indicates the characteristics of linear transformation. Indicates the characteristic of topic invariability. This represents the weight matrix for linear transformation of topic-invariant features.
[0037] Furthermore, the bidirectional coding unit further includes: The position feature production subunit is used to encode the topic vector into topic features using a first Bi-LSTM, and then encode the text vector using a second Bi-LSTM conditioned on the topic features. Simultaneously, scaling dot product attention is applied to the output of the second Bi-LSTM with the topic features as the query to generate position features of the text vector to the topic vector, wherein the position features are topic-invariant features.
[0038] The training execution module 30 is used to concatenate the linear transformation features and the fusion vector to obtain concatenated features, and input the concatenated features into the stance classifier. The linear transformation features are input into the topic discriminator for training the zero-shot stance model. Furthermore, the training execution module 30 includes: The reconstructed execution unit is used to reconstruct the hidden state of each Bi-LSTM using a nonlinear transformation, and to train the zero-shot stance model by combining the losses of individual components using adversarial learning. The losses in the joint confrontation mode are denoted as: This represents the intermediate loss in the joint confrontation mode. , All of these represent fixed hyperparameters. This represents the reconstruction loss of the first Bi-LSTM. This represents the reconstruction loss of the second Bi-LSTM. This represents the loss of the weight matrix under the linear transformation of topic-invariant features. This represents the position classifier loss. Let represent the total loss in the joint adversarial mode, λ represent the L2 regularization coefficient, Θ represent the trainable parameters of the fusion encoding module of the zero-shot stance model, and ρ represent the weights of the topic discriminator loss. This indicates the loss of the topic discriminator. This indicates L2 regularization.
[0039] The loss in the one-on-one combat mode is denoted as: The individual confrontation mode is a special case of the joint confrontation mode. This indicates the loss in the solo combat mode.
[0040] The mode scheduling module 40 is used to use hyperparameter scheduling of the zero-shot position model in different modes during the training phase, so that the zero-shot position model can be trained in dynamic adjustment of different modes.
[0041] The parameter tuning execution unit is used to input hyperparameters η and μ to tune λ and ρ in the zero-shot position model, so that the zero-shot position model can be trained in dynamic tuning under different modes to obtain the loss of the final zero-shot position model: in, This represents the loss of the final zero-sample position model. η represents the F1 score of the model on the training set at the end of the current Epoch, and both η and μ range from (0, 1).
[0042] In another aspect, the present invention also proposes a storage medium on which one or more programs are stored, which, when executed by a processor, implement the above-described method for constructing a zero-sample position detection model.
[0043] In another aspect, the present invention also proposes a computer device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-described method for constructing a zero-sample position detection model.
[0044] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain stored, communicated, propagated, or transmitted programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0045] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0046] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0047] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0048] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for constructing a zero-shot stance detection model, characterized in that, The method includes: Obtain dataset samples, which include several examples, each of which includes a topic name and text content. Then, perform fusion encoding on the topic name and text content to obtain a fusion vector, a topic vector, and a text vector. Based on the domain transfer structure of adversarial learning, topic-invariant features are extracted from the topic vector and text vector, and the topic-invariant features are linearly transformed to obtain linearly transformed features. The linear transformation feature and the fusion vector are concatenated to obtain the concatenated feature, which is then input into the stance classifier. The linear transformation feature is input into the topic discriminator for training the zero-shot stance model. By controlling the hyperparameters of the scheduling, the zero-shot position model is dynamically scheduled in different modes during the training phase, so that the zero-shot position model can be trained in dynamic adjustment of different modes. In the step of fusing and encoding the topic name and text content: The fusion coding loss is denoted as: in, Indicates the fusion coding loss, Represents the cross-entropy loss function. This represents the position label predicted by the zero-sample position model. Labels indicating true stance; The steps for dynamically scheduling the zero-shot stance model in different modes during the training phase by controlling the scheduling hyperparameters, so that the zero-shot stance model can be trained in dynamic adjustment of different modes, include: Input hyperparameters η and μ to tune λ and ρ in the zero-shot position model, enabling training of the zero-shot position model in dynamic tuning across different modes, resulting in the loss of the final zero-shot position model: in, This represents the loss of the final zero-sample position model. This represents the F1 score of the model evaluated on the training set at the end of the current epoch, where η and μ both range from (0, 1). This represents the total loss under the joint confrontation mode. denoted by λ, where λ represents the L2 regularization coefficient, and ρ represents the weight of the topic discriminator loss.
2. The method for constructing a zero-sample stance detection model according to claim 1, characterized in that, The steps of extracting topic-invariant features from the topic vector and text vector based on the domain transfer structure of adversarial learning, and performing a linear transformation on the topic-invariant features to obtain linearly transformed features include: The topic vector and the text vector of the fused encoding input are encoded using bidirectional conditional encoding; The step of encoding the topic vector and the text vector of the fused encoding input using bidirectional conditional encoding includes: The topic vector is encoded into topic features using a first Bi-LSTM, and then the text vector is encoded using a second Bi-LSTM conditioned on the topic features. Simultaneously, scaling dot product attention is applied to the output of the second Bi-LSTM with the topic features as the query to generate a stance feature of the text vector on the topic vector, wherein the stance feature is the topic-invariant feature.
3. The method for constructing a zero-sample stance detection model according to claim 2, characterized in that, The steps of extracting topic-invariant features from the topic vector and text vector based on the domain transfer structure of adversarial learning, and performing a linear transformation on the topic-invariant features to obtain linearly transformed features include: The topic-invariant features are linearly transformed according to the following formula: ; in, Indicates the characteristics of a linear transformation. Indicates the characteristic of topic invariability. This represents the weight matrix for linear transformation of topic-invariant features.
4. The method for constructing a zero-sample stance detection model according to claim 3, characterized in that, The steps of concatenating the linear transformation features and the fusion vector to obtain concatenated features, inputting the concatenated features into the stance classifier, and inputting the linear transformation features into the topic discriminator for training the zero-shot stance model include: The hidden states of each Bi-LSTM are reconstructed using a nonlinear transformation, and adversarial learning is employed to train the zero-shot stance model by combining the losses of individual components. The losses in the joint confrontation mode are denoted as: This represents the intermediate loss in the joint confrontation mode. , All of these represent fixed hyperparameters. This represents the reconstruction loss of the first Bi-LSTM. This represents the reconstruction loss of the second Bi-LSTM. This represents the loss of the weight matrix under the linear transformation of topic-invariant features. This represents the position classifier loss. Let represent the total loss in the joint adversarial mode, λ represent the L2 regularization coefficient, Θ represent the trainable parameters of the fusion encoding module of the zero-shot stance model, and ρ represent the weights of the topic discriminator loss. This indicates the loss of the topic discriminator. This indicates L2 regularization.
5. The method for constructing a zero-sample stance detection model according to claim 4, characterized in that, The loss in the one-on-one combat mode is denoted as: The individual adversarial mode is a special case of the joint adversarial mode. This indicates the loss in the solo combat mode.
6. A system for constructing a zero-sample stance detection model, characterized in that, The system includes: Example content encoding module is used to obtain dataset samples, which include several examples. Each example includes a topic name and text content. The topic name and text content are fused and encoded to obtain a fused vector, a topic vector, and a text vector. The position feature extraction module is used to extract topic-invariant features from the topic vector and text vector according to the domain transfer structure of adversarial learning, and to perform a linear transformation on the topic-invariant features to obtain linearly transformed features. The training execution module is used to concatenate the linear transformation features and the fusion vector to obtain concatenated features, which are then input into the stance classifier. The linear transformation features are input into the topic discriminator for training the zero-shot stance model. The mode scheduling module is used to dynamically schedule different modes of the zero-shot position model during the training phase by controlling the scheduling hyperparameters, so that the zero-shot position model can be trained in dynamic adjustment of different modes. In the step of fusing and encoding the topic name and text content: The fusion coding loss is denoted as: in, Indicates the fusion coding loss, Represents the cross-entropy loss function. This represents the position label predicted by the zero-sample position model. Labels indicating true stance; The step of dynamically scheduling the zero-shot position model in different modes during the training phase by controlling the scheduling hyperparameters, so that the zero-shot position model can be trained in dynamic adjustment of different modes, includes: Input hyperparameters η and μ to tune λ and ρ in the zero-shot position model, enabling training of the zero-shot position model in dynamic tuning across different modes, resulting in the loss of the final zero-shot position model: in, This represents the loss of the final zero-sample position model. This represents the F1 score of the model evaluated on the training set at the end of the current epoch, where η and μ both range from (0, 1). This represents the total loss under the joint confrontation mode. denoted by λ, where λ represents the L2 regularization coefficient, and ρ represents the weight of the topic discriminator loss.
7. A storage medium, characterized in that, include: The storage medium stores one or more programs that, when executed by a processor, implement the method for constructing a zero-sample position detection model as described in any one of claims 1-5.
8. A computer device, characterized in that, The computer device includes a memory and a processor, wherein: The memory is used to store computer programs; When the processor executes the computer program stored in the memory, it implements the method for constructing the zero-sample position detection model according to any one of claims 1-5.
Citation Information
Patent Citations
Multi-view social media user standing detection method and device
CN114357290A