A rumor detection method and system based on prompt learning and meta-learning in a low-resource environment

By adopting prompt learning and meta-learning methods in a low-resource environment, and using a combination of soft and hard prompt templates and meta-learning mechanisms, the adaptability and accuracy of the rumor detection model are improved, and the problem of insufficient rumor detection accuracy in a low-resource environment is solved.

CN119961456BActive Publication Date: 2025-08-19湖南工商大学
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510446008.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-08-19
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

In a low-resource environment, there are fewer data samples for rumor detection, and how to improve detection accuracy and accuracy is a technical problem that needs to be solved urgently.

Method used

Using a method based on prompt learning and meta-learning, the rumor detection task is transformed into a mask prediction task by designing a combination of soft and hard-core prompt template, and feature learning is performed using a two-way long and short-term memory network, a multi-layer perceptron and mask language model. The model parameters are optimized through the meta-learning mechanism to build an anti-noise prototype expressor to improve the adaptability of the detection model.

Benefits of technology

Under the conditions of limited labeling data, the adaptability and accuracy of rumor detection are improved, effectively solving the detection problems in low-resource environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961456B_ABST
    Figure CN119961456B_ABST
Patent Text Reader

Abstract

The present invention discloses a rumor detection method and system based on prompt learning and meta-learning in a low-resource environment. The method includes obtaining input text to be detected, soft prompt parameters for guiding the rumor detection task, and a detection model; inputting the input text and soft prompt parameters into the detection model to obtain the detection model output result; the detection model includes a bidirectional long short-term memory network for modeling contextual information of the soft prompt parameters; a two-layer multi-layer perceptron for adding nonlinear features to the soft prompt parameters after context modeling; a masked language model for performing a mask prediction task on a prompt text composed of the soft prompt parameters with added nonlinear features and the input text, and predicting the soft prompt parameters in the prompt text; a prototype expressor for mapping the prediction results of the masked language model to corresponding category labels; and determining the rumor detection result based on the output result. The solution of the present invention can improve the accuracy of rumor detection in a low-resource environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rumor detection, and in particular to a rumor detection method and system based on prompt learning and meta-learning in a low-resource environment. Background Art

[0002] Rumor detection is crucial in today's era of information explosion. By identifying and curbing the spread of false information, it can effectively prevent social panic, public crises and the collapse of trust, especially in emergencies (such as epidemics and disasters), to ensure the accuracy of key information; at the same time, it maintains the order of the digital space, reduces economic losses and social divisions caused by rumors, and promotes information fairness through technical means (such as multilingual models and low-resource algorithms), building a defense barrier against rumors for different regions and cultural groups. It is the cornerstone of digital social governance and security.

[0003] However, in some specific areas, data samples for rumor detection are currently scarce, and these environments are low-resource. Improving the precision and accuracy of rumor detection in these low-resource environments is a pressing technical challenge. Summary of the Invention

[0004] To solve the above technical problems, an embodiment of the present invention provides a rumor detection method and system based on prompt learning and meta-learning in a low-resource environment.

[0005] The technical solution of the embodiment of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a rumor detection method based on prompt learning and meta-learning in a low-resource environment, the method comprising:

[0007] Obtaining input text to be detected, soft prompt parameters, and a detection model; the soft prompt parameters are used to guide the rumor detection task;

[0008] The input text and the soft prompt parameters are input into the detection model to obtain the output result of the detection model; wherein the detection model includes a prompt model and a prototype expressor; the prompt model includes a bidirectional long short-term memory network, a two-layer multi-layer perceptron and a masked language model; the bidirectional long short-term memory network is used to model the context information of the soft prompt parameters; the two-layer multi-layer perceptron is used to add nonlinear features to the soft prompt parameters after context modeling; the masked language model is used to perform a mask prediction task on the prompt text composed of the soft prompt parameters with added nonlinear features and the input text, and predict the soft prompt parameters in the prompt text; the prototype expressor is used to map the prediction results of the masked language model to corresponding category labels;

[0009] Determine the rumor detection result corresponding to the input text according to the category label output by the detection model.

[0010] In one embodiment, the prompt text is:

[0011]

[0012] in, For the prompt text, is a special token for the masked language model, x is the input text, is a fixed anchor mark, represents a trainable vector filled with soft hint parameters, Indicates a sentence separator or end-of-sequence marker.

[0013] In one embodiment, obtaining soft prompt parameters and a detection model includes:

[0014] Randomly draw samples from the source data multiple times to construct the meta-prompt task set;

[0015] For each meta-prompt task in the meta-prompt task set, obtaining a corresponding task dataset, wherein the task dataset includes a support set and a query set;

[0016] Acquire an initial prompt model, and perform a first-order gradient multi-step parameter update on initial soft prompt parameters and initial mask language model parameters in the initial prompt model using the support set to obtain updated first soft prompt parameters and first mask language model parameters;

[0017] Inputting the first soft prompt parameter and the first mask language model parameter into the initial prompt model, and performing a second-order gradient multi-step parameter update on the first soft prompt parameter and the first mask language model parameter in the input initial prompt model using a query set to obtain updated second soft prompt parameter and second mask language model parameter;

[0018] Inputting the second mask language model parameters into the initial prompt model, and obtaining a detection model based on the input initial prompt model and the prototype expressor;

[0019] The second soft prompt parameter is used as the final soft prompt parameter.

[0020] In one embodiment, performing a first-order gradient multi-step parameter update on initial soft prompt parameters and initial mask language model parameters in the initial prompt model using the support set includes:

[0021] Use the following calculation formula to perform first-order gradient multi-step parameter update:

[0022]

[0023]

[0024] in, For the The masked language model parameters of the step, For the Soft hint parameters for the step, For the -1 step masked language model parameters; For the - Soft prompt parameters for step 1, is the learning rate when updating the model parameters on the support set, symbol represents the gradient operation, is the loss function, Meta prompt task The support set, To enter -1 step mask language model parameters and Hint model with soft hint parameters of -1 step.

[0025] In one embodiment, a second-order gradient multi-step parameter update is performed on the first soft prompt parameter and the first mask language model parameter in the input initial prompt model using the query set, including:

[0026] The following calculation formula is used to perform second-order gradient multi-step parameter update:

[0027]

[0028] in, For soft prompt parameters, arrow Indicates assignment or update of value. is the learning rate when updating the model parameters on the query set, Soft prompt parameter The second derivative of represents the gradient operation, is the loss function, Meta prompt task The query set, For the prompt model, Representation meta-cue task The corresponding soft prompt parameters, is the identity matrix, is the learning rate when updating the model parameters on the support set, Indicates the parameters on the query set The gradient of the loss function, represents the loss function on the support set, Represents the parameters on the query set The gradient of the loss function, Express Seek the derivative, Indicates the parameters Compute the Hessian matrix.

[0029] In one embodiment, the stopping condition for the second-order gradient multi-step parameter update is:

[0030]

[0031] in, Represent the model parameters θ and soft prompt parameters The optimal value of is the loss function, Meta prompt task The query set, Prompt model.

[0032] In one embodiment, mapping the prediction results of the masked language model to corresponding category labels includes:

[0033] For each category label, construct the corresponding category prototype;

[0034] Encoding the prediction result of the masked language model into a feature representation, and calculating the similarity between the feature representation and the category prototype;

[0035] Determine a category label corresponding to the prediction result of the masked language model according to the similarity.

[0036] In one embodiment, for each category label, a corresponding category prototype is constructed, including:

[0037] The initial prototype is obtained by calculating the average embedding value for all samples of each category label in the support set:

[0038]

[0039] in, represents the initial prototype, Indicates that the support set category label is The sample set, Indicates that the category label is No. samples;

[0040] Calculate the attention weight of each sample based on the initial prototype;

[0041]

[0042] in, represents the Euclidean distance; Indicates that the category label is No. samples;

[0043] According to the attention weight of each sample, the optimized category prototype of each sample is calculated using the following formula:

[0044]

[0045] in, Represents a prototype.

[0046] In one embodiment, calculating the similarity between the feature representation and the category prototype includes:

[0047] The similarity between the feature representation and the category prototype is calculated using the following formula:

[0048]

[0049] in, Represents a query sample Belong to category The probability score of Represents the feature representation of the encoded prediction result of the masked language model, represents the set of all category labels, Expressed in natural logarithm The exponential function with base , It is the cosine similarity calculation formula.

[0050] An embodiment of the present invention also provides a rumor detection system based on prompt learning and meta-learning in a low-resource environment, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, it executes the steps of the above-mentioned method.

[0051] The embodiments of the present invention have the following beneficial effects:

[0052] The embodiment of the present invention utilizes prompt text with soft prompt parameters and a mask language model to convert the rumor detection task into a mask prediction task, so that the detection model can perform effective feature learning and task adaptation with the help of the mask language model in the detection model under limited labeled data conditions, thereby improving the adaptability and detection accuracy of the detection model to the rumor detection task in the absence of a large amount of labeled data. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 Schematic diagram of the process of rumor detection method based on prompt learning and meta-learning in a low-resource environment according to an embodiment of the present invention;

[0054] Figure 2 This is a diagram of the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments.

[0056] The embodiment of the present invention provides a rumor detection method based on prompt learning and meta-learning in a low-resource environment. Figure 1 As shown, the method includes:

[0057] Step 101: Obtain input text to be detected, soft prompt parameters, and a detection model; the soft prompt parameters are used to guide the rumor detection task;

[0058] Step 102: Input the input text and the soft prompt parameters into the detection model to obtain the detection model output result; wherein the detection model includes a prompt model and a prototype expressor; the prompt model includes a bidirectional long short-term memory network, a two-layer multilayer perceptron and a masked language model; the bidirectional long short-term memory network is used to model the context information of the soft prompt parameters; the two-layer multilayer perceptron is used to add nonlinear features to the soft prompt parameters after context modeling; the masked language model is used to perform a mask prediction task on the prompt text composed of the soft prompt parameters with added nonlinear features and the input text, and predict the soft prompt parameters in the prompt text; the prototype expressor is used to map the prediction results of the masked language model to corresponding category labels;

[0059] Step 103: Determine the rumor detection result corresponding to the input text according to the category label output by the detection model.

[0060] The method in this embodiment combines prompt learning and meta-learning to solve the low-resource problem faced by social media rumor detection.

[0061] Specifically, in the prompt learning phase, this embodiment transforms rumor detection into a pre-training task (e.g., masked language modeling) by designing a combination of soft and hard templates. This approach, by constructing task-specific prompt templates, enables the detection model to effectively learn features and adapt to the task using the masked language model within the detection model, even with limited labeled data.

[0062] In the meta-learning part, this embodiment proposes a meta-prompt learning framework, which aims to improve the adaptability of the detection model to rumor detection tasks in the absence of a large amount of labeled data through effective knowledge transfer and meta-learning mechanism (meta-learning includes meta-training and meta-testing).

[0063] Specifically, the method of this embodiment includes the following contents:

[0064] Step 1: Design a combination of soft and hard prompt template

[0065] 1.1 Template Construction

[0066] This embodiment proposes a soft prompt template with an anchor mark, and the prompt mark is composed of a soft prompt mark (representing a soft prompt parameter ) and anchor tags (representing embeddings fixed to specific words). The combination of hard and soft hint templates makes the model more flexible while retaining enough semantic information to trigger the masked language model to generate correct predictions.

[0067] Taking the news headline classification task and a commonly used masked language model BERT as an example, the text after using the soft hint template is as follows:

[0068]

[0069] in, is the prompt text, [CLS] is a special marker for the mask language model, For input text, This post is a fixed anchor mark, and the filling of the [MASK] position here is not completed by a fixed vocabulary, but by a trainable vector (soft prompt parameter ) to indicate the guidance of the task, and [SEP] indicates a sentence separation or sequence end marker.

[0070] Step 2: Use the mask hint model to predict tags and convert the rumor detection task into a pre-training task.

[0071] 2.1 Overall Architecture of the Detection Model

[0072] The detection model in this embodiment includes a prompt model and prototype expressors, where the prompt model Including: Bidirectional Long Short-Term Memory Network (BiLSTM), two-layer Multi-layer Perceptron (MLP), and Masked Language Model (BERT).

[0073] Prompt Model The learnable parameters are divided into two parts: the masked language model BERT parameters and soft prompt parameters (Parameters used to generate soft hint embeddings).

[0074] To enhance the hint representation, the soft hint parameter A two-layer bidirectional long short-term memory network (BiLSTM) is first used to model the context information and capture the sequence dependency within the prompt vector. The output of the BiLSTM is then fed into a two-layer multi-layer perceptron (MLP) for further processing and giving the prompt vector richer nonlinear features, thereby obtaining an enhanced prompt vector. Such a transformation enables it to smoothly escape from the local minimum. Next, With the original input text Splicing to form a complete prompt text , for low-resource rumor detection. Input to a masked language model (such as BERT), which will Perform language modeling tasks on it, such as predicting the filler word at the [MASK] position.

[0075] The prototype expressor is used to map the model output to specific category labels.

[0076] 2.2 Post Encoder

[0077] In prompt learning, the masked language model (MLM) is based on the prompt text The predicted [MASK] placeholder is propagated layer by layer through the self-attention mechanism. Contained in the prompt text In the [MASK] layer-by-layer propagation, the self-attention mechanism is used to make the final [MASK] integrate the information embedded in the input text, anchor mark (hard prompt) and soft prompt. Therefore, the hidden state of the [MASK] mark in the last layer of the mask language model BERT is As input text Then, the final feature representation is obtained by linear transformation . Using a masked language model, the rumor detection task can be converted into a pre-training task (masked language modeling).

[0078]

[0079] in, is the weight matrix.

[0080] This embodiment uses the idea of prompt learning and designs a template to convert the classification task (i.e., determining whether a given text is a rumor or not) into a fill-in-the-blank task (such as predicting [MASK]). In this way, the classification task is aligned with the pre-training task, thereby narrowing the gap between the tasks and further stimulating the potential of the masked language model (BERT).

[0081] Since hint-based methods, especially those adopting soft hints, are very sensitive to parameter initialization, an optimization-based meta-learning approach is introduced into the hint method to find better initialization points for the hint model and further explore its capabilities in low-resource scenarios.

[0082] In Steps 3 and 4 below, we will first introduce the hint tuning objective, then describe how to construct the meta-hint task, and finally, explain the parameter update strategy in detail.

[0083] Step 3: Set the hint tuning target (i.e., the tuning target for the meta-training task).

[0084] For any low-resource task given in the source data , get the task dataset corresponding to the task Represents the training sample. Tip: The tuning objective can be formulated as follows (principle: minimizing the loss function is equivalent to maximizing the conditional probability predicted by the model):

[0085]

[0086] in, To indicate the tuning target, is the loss function, is the prompt model, is the conditional probability, which is determined by the masked language model parameters and soft prompt parameters composition.

[0087] In low-resource scenarios, Contains little labeled data, so the model parameters and soft prompt parameters The initialization of is crucial to the performance of the model.

[0088] Step 4: Based on the prompt tuning objective, a low-resource meta-prompt task set is constructed to meta-learn the prompt model in order to find a better initialization point for the prompt-based model.

[0089] 4.1 Constructing the Meta-hint Task

[0090] In order to find a better initialization point, this embodiment uses posts from source data (crawled from social media) Randomly draw samples to construct the meta-prompt task set , where N is the number of meta-prompt tasks. For each meta-prompt task , the meta prompt task Corresponding task dataset Further divided into two disjoint subsets: support set and queryset .

[0091] That is, each meta-prompt task The sampling is:

[0092]

[0093] In the low-resource setting, the meta-training and meta-testing tasks are sampled from different domains to prevent the model from simply memorizing the training samples.

[0094] 4.2 Applying Meta-Learning to Hint Models

[0095] Meta-learning includes meta-training and meta-testing. Meta-training is used to perform first-order gradient multi-step parameter updates on the support set to determine the first parameters of the prompt model. and The meta-test is the first parameter and Based on this, the second-order gradient multi-step parameter update is performed, and the prompt tuning target determined above is used as the stop update condition, and the final parameter obtained by stopping the update is used as the optimal initial parameter and .

[0096] Meta-training

[0097] In the meta-training part, this embodiment uses first-order gradient to update parameters on the support set.

[0098] For each given meta-prompt task , clone the parameters of the related model that has been trained and is similar to the meta-prompt task (by cloning some or all parameters, the model can be trained faster on a new but related task instead of training from scratch. This method is particularly suitable for cases where the amount of data for the target task is small), and obtain the initial parameters of the prompt model for this meta-training and . Reuse support set Update initial parameters and During the meta-training process, the initial parameters and There will be multiple steps of gradient parameter update, each step is updated as follows:

[0099]

[0100]

[0101] in, For The learning rate when updating model parameters is represents the gradient operation, Indicates the number of inner steps.

[0102] Here, the stopping condition for parameter update can comprehensively consider the fixed step limit (most common), gradient change, loss reduction, and computing resource constraints, and be adjusted according to the experimental situation.

[0103] The final parameters obtained after stopping the update are used as the initial parameters of the meta-test for subsequent meta-tests.

[0104] Meta-testing

[0105] In the meta-test part, this embodiment uses second-order gradient optimization to find the best parameters on the query set.

[0106] make For hint models in querysets The learning rate when updating model parameters, H is the Hessian matrix. In the query set The second-order gradient calculated above is formalized as follows:

[0107]

[0108] in, Soft prompt parameter The second derivative of Meta-cue task Corresponding soft prompt parameters, arrow Indicates assignment / update value, Represents the parameters on the query set The gradient of the loss function, is the identity matrix, represents the inner loop learning rate on the support set, represents the loss function on the support set, Prompt the model in the query set during meta-training The learning rate when updating model parameters, Represents the parameters on the query set The gradient of the loss function, Express Seek the derivative, Indicates the parameters Compute the Hessian matrix.

[0109] In the meta-test part, the prompt tuning target mentioned above is used as the stop update condition of the meta-test, that is, the update is stopped when the prompt tuning target is reached, and the parameters of the last step are obtained. and As the optimal initial parameters of the prompt model.

[0110] That is, stop updating the target:

[0111]

[0112] in, Represent the model parameters and soft prompt embed The optimal value of .

[0113] Step 5: Build a prototype expressor to create a category prototype

[0114] 5.1 Prototype Construction Strategy

[0115] The Prototypical Verbalizer is the bridge between the prompt model output and the final task label. It is responsible for mapping the results predicted by the prompt model into specific category labels.

[0116] This example proposes a prototype expressor method. It uses training data to build prototypes for corresponding categories and designs two contrastive learning losses to guide the optimization process. Considering the impact of noise in scenarios with limited training data, a noise-resistant prototype construction strategy is also designed to automatically assign weights to samples to obtain more effective prototypes.

[0117] This embodiment decides to introduce prototypes into the language generator to solve the overfitting problem when the training data is limited. This is because the prototype network can alleviate the overfitting problem to a certain extent through a metric-based method.

[0118] The basic unit of meta-learning is meta-task. For each meta-task, we construct corresponding category prototypes for the two categories (rumors and non-rumors) of its support set. ,in .

[0119] A category prototype is a conceptual unit that summarizes the overall information of a category. Previous prototype network work mainly computes prototypes by averaging the embeddings of all samples in a category. In scenarios with limited samples, noisy data can severely affect the accuracy of the prototype. Therefore, this example proposes a noise-resistant prototype construction strategy that automatically assigns different weights to each sample as an attention mechanism to improve the robustness of the model.

[0120] (1) First, we obtain the prototype by averaging the embeddings of posts in each category:

[0121]

[0122] in, Supports centralized categories The sample set, Indicates that it belongs to the category label The first (rumor or not) Sample posts.

[0123] (2) Calculating sample weights (attention allocation)

[0124] Before building a noise-resistant prototype, calculate the weight of each sample , that is, the contribution of the sample to the final prototype. Uncertainty weighting based on distance. For a sample ,If its distance from other similar samples is large, it may be a noise sample.

[0125]

[0126] in, represents the Euclidean distance, Indicates that it belongs to the category label The first (rumor or not) Sample posts, Indicates that it belongs to the category label The first (rumor or not) Sample posts, Represents the aforementioned prototype;

[0127]

[0128] in, Supports centralized categories The sample set, Indicates that it belongs to the category label The first (rumor or not) The existing technology directly calculates by averaging, which contains noise. The calculation method proposed in this embodiment has the effect of noise resistance.

[0129] 5.2 Contrastive Learning Loss Guided Prototype Construction

[0130] To better optimize prototype construction, this embodiment extracts low-level and high-level information from the relationships between posts and between posts and prototypes to assist in model optimization. Specifically, this embodiment implements a two-level contrastive learning loss to guide parameter optimization:

[0131] (1) Instance-level contrastive learning: Posts belonging to the same category should have higher similarity. This example optimizes the objective by minimizing the following loss function:

[0132]

[0133] in, Represents the set of posts with the same label on the support set , Represents the set of posts with different labels on the support set , is a temperature hyperparameter that controls the model’s ability to distinguish negative samples. is the cosine similarity. This loss function aims to increase the similarity between similar posts, reduce the similarity between heterogeneous posts, and ensure local smoothness, thereby assisting prototype construction.

[0134] (2) Prototype-level contrastive learning: Prototype Should be labeled The posts with higher similarity have higher similarity. This embodiment optimizes the objective by minimizing the following loss function:

[0135]

[0136] in, represents the support set, Indicates support for centralized labeling The sample set, Get all possible category indices (including the correct category and other categories), represents the true category to which the sample belongs, It's a prototype The estimated concentration ratio, The larger it is, the smaller the concentration is. represents the estimated concentration ratio, represents the set of all categories, Represents the prototype of a category.

[0137] This embodiment estimates the :

[0138]

[0139] in, To support centralized labeling The sample collection.

[0140] The centrality estimate will adjust the weight of the similarity calculation between the post vector and the prototype. ) will reduce the similarity, making the embedding Closer to the prototype, and smaller Can avoid embedding Too close to the prototype. This can encourage the model to generate a prototype with a more balanced concentration. In addition, according to the model verification formula, this embodiment can find that when =1 (derived from the formula at the prototype level), The essence of is the cross-entropy loss function. Compared with the contrastive loss between instances, it can utilize prototype information, which often contains more extensive and stable semantic information. This parameter-free prototype classifier often performs better than a parameterized linear classifier in few-shot scenarios. Finally, this embodiment combines these two losses to obtain the final optimization goal:

[0141]

[0142] Step 6: The prompt model encodes the new post into a feature representation and calculates its similarity with the category prototype to obtain a probability score.

[0143] 6.1 Reasoning

[0144] During the inference phase, this embodiment obtains probability scores using a metric-based approach. For each category (rumor and non-rumor), a corresponding category prototype is constructed during the training process. For a new post, the prompt model first encodes it into a feature representation and calculates the similarity between the post and each category prototype. The similarity is calculated using the cosine similarity metric. By calculating the similarity between the input post and each category prototype, the prototype expressor can assess the likelihood that the post belongs to a different category. For example, if the post's representation is closer to the prototype of the "rumor" category, the post is classified as a rumor; otherwise, it is classified as non-rumor.

[0145] For query samples ,category The probability score is:

[0146]

[0147] This is the feature representation of the output of the masked language model post encoder , Represents the prototype mentioned above, Get all possible category indices (including the correct category and other categories), Represents the set of all categories.

[0148] Then make predictions using the argmax function:

[0149]

[0150] Under the masked language model MLM, given the input ,category The posterior probability (PosteriorProbability).

[0151] During the inference phase, this example proposes a probability scoring method based on metric learning. By calculating the similarity between the input sample and the prototype vector, the model can output a probability score for each category, thereby achieving accurate rumor detection.

[0152] The embodiment of the present invention utilizes prompt text with soft prompt parameters and a mask language model to convert the rumor detection task into a mask prediction task, so that the detection model can perform effective feature learning and task adaptation with the help of the mask language model in the detection model under limited labeled data conditions, thereby improving the adaptability and detection accuracy of the detection model to the rumor detection task in the absence of a large amount of labeled data.

[0153] In order to implement the method of an embodiment of the present invention, an embodiment of the present invention also provides a rumor detection system based on prompt learning and meta-learning in a low-resource environment, including: a processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, it executes the steps of the above-mentioned method.

[0154] The above-mentioned system provided in this embodiment and the above-mentioned method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0155] To implement the method of an embodiment of the present invention, an embodiment of the present invention further provides a computer program product. The computer program product includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of the above method.

[0156] Based on the hardware implementation of the above program modules and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides an electronic device (computer device). Specifically, in one embodiment, the computer device can be a terminal, and its internal structure diagram can be as follows: Figure 2As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown in the figure) connected via a system bus. The processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor A01, the method of any of the above embodiments is implemented. The display screen A04 of the computer device can be a liquid crystal display or an electronic ink display. The input device A05 of the computer device can be a touch layer covering the display screen, or it can be a key, trackball, or touchpad provided on the computer device housing, or it can be an external keyboard, touchpad, or mouse.

[0157] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0158] The device provided by an embodiment of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method of any one of the above embodiments is implemented.

[0159] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0160] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0161] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0162] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0163] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0164] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0165] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0166] It is understood that the memory of the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); magnetic surface memory may be magnetic disk or tape memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.

[0167] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0168] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A rumor detection method based on prompt learning and meta-learning in a low-resource environment, characterized by: The method comprises: Obtaining input text to be detected, soft prompt parameters, and a detection model; the soft prompt parameters are used to guide the rumor detection task; The input text and the soft prompt parameters are input into the detection model to obtain the output result of the detection model; wherein the detection model includes a prompt model and a prototype expressor; the prompt model includes a bidirectional long short-term memory network, a two-layer multi-layer perceptron and a masked language model; the bidirectional long short-term memory network is used to model the context information of the soft prompt parameters; the two-layer multi-layer perceptron is used to add nonlinear features to the soft prompt parameters after context modeling; the masked language model is used to perform a mask prediction task on the prompt text composed of the soft prompt parameters with added nonlinear features and the input text, and predict the soft prompt parameters in the prompt text; the prototype expressor is used to map the prediction results of the masked language model to corresponding category labels; Determine the rumor detection result corresponding to the input text according to the category label output by the detection model.

2. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 1 is characterized in that The prompt text is: in, is the prompt text, [CLS] is a special marker for the mask language model, To input text, is a fixed anchor mark, represents a trainable vector filled with soft hint parameters, Indicates a sentence separator or end-of-sequence marker.

3. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 1 is characterized in that Get soft prompt parameters and detection model, including: Randomly draw samples from the source data multiple times to construct the meta-prompt task set; For each meta-prompt task in the meta-prompt task set, obtaining a corresponding task dataset, wherein the task dataset includes a support set and a query set; Acquire an initial prompt model, and perform a first-order gradient multi-step parameter update on initial soft prompt parameters and initial mask language model parameters in the initial prompt model using the support set to obtain updated first soft prompt parameters and first mask language model parameters; Inputting the first soft prompt parameter and the first mask language model parameter into the initial prompt model, and performing a second-order gradient multi-step parameter update on the first soft prompt parameter and the first mask language model parameter in the input initial prompt model using a query set to obtain updated second soft prompt parameter and second mask language model parameter; Inputting the second mask language model parameters into the initial prompt model, and obtaining a detection model based on the input initial prompt model and the prototype expressor; The second soft prompt parameter is used as the final soft prompt parameter.

4. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 3 is characterized in that Performing a first-order gradient multi-step parameter update on initial soft prompt parameters and initial mask language model parameters in the initial prompt model using the support set, including: Use the following calculation formula to perform first-order gradient multi-step parameter update: in, For the The masked language model parameters of the step, For the Soft hint parameters for the step, For the -1 step masked language model parameters; For the -1 step soft hint parameter, is the learning rate when updating the model parameters on the support set, symbol represents the gradient operation, is the loss function, Meta prompt task The support set, To enter -1 step mask language model parameters and Hint model with soft hint parameters of -1 step.

5. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 3 is characterized in that The query set is used to perform a second-order gradient multi-step parameter update on the first soft prompt parameter and the first mask language model parameter in the initial prompt model after input, including: The following calculation formula is used to perform second-order gradient multi-step parameter update: in, For soft prompt parameters, arrow Indicates assignment or update of value. is the learning rate when updating the model parameters on the query set, Soft prompt parameter The second derivative of represents the gradient operation, is the loss function, Meta prompt task The query set, For the prompt model, Representation meta-cue task The corresponding soft prompt parameters, is the identity matrix, is the learning rate when updating the model parameters on the support set, Indicates the parameters on the query set The gradient of the loss function, represents the loss function on the support set, Represents the parameters on the query set The gradient of the loss function, Express Seek the derivative, Indicates the parameters Compute the Hessian matrix.

6. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 5 is characterized in that The stopping condition for the second-order gradient multi-step parameter update is: in, Represent the model parameters and soft prompt parameters The optimal value of is the loss function, Meta prompt task The query set, Prompt model.

7. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 1 is characterized in that Mapping the prediction results of the masked language model to the corresponding category labels includes: For each category label, construct the corresponding category prototype; Encoding the prediction result of the masked language model into a feature representation, and calculating the similarity between the feature representation and the category prototype; Determine a category label corresponding to the prediction result of the masked language model according to the similarity.

8. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 7 is characterized in that For each category label, construct the corresponding category prototype, including: The initial prototype is obtained by calculating the average embedding value for all samples of each category label in the support set: in, represents the initial prototype, Indicates that the support set category label is The sample set, Indicates that the category label is No. samples; Calculate the attention weight of each sample based on the initial prototype; in, represents the Euclidean distance; Indicates that the category label is No. samples; According to the attention weight of each sample, the optimized category prototype of each sample is calculated using the following formula: in, Represents a prototype.

9. The rumor detection method based on prompt learning and meta-learning in a low-resource environment according to claim 8 is characterized in that Calculating the similarity between the feature representation and the category prototype, including: The similarity between the feature representation and the category prototype is calculated using the following formula: in, Represents a query sample Belong to category The probability score of Represents the feature representation of the encoded prediction result of the masked language model, represents the set of all category labels, Expressed in natural logarithm The exponential function with base , is the cosine similarity calculation formula, is a category label among all possible category indices, Represents the prototype of a certain category label among all category labels.

10. A rumor detection system based on prompt learning and meta-learning in a low-resource environment, characterized by: include: A processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, the steps of the method according to any one of claims 1 to 9 are performed.

Citation Information

Patent Citations

  • Pre-training language model processing method based on comparative learning and intelligent question answering system

    CN114528383A

  • Large model text classification method and system based on alignment strategy

    CN119474390A