A false review detection method based on transfer learning and feature fusion
By employing transfer learning and feature fusion in fake review detection, this paper utilizes BERT and SKEP models to extract semantic and sentiment features of reviews, and combines them with MLP (Multilayer Perceptron) for detection. This solves the problems of low accuracy and poor robustness in fake review detection, and achieves more efficient fake review identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TOBACCO ZHEJIANG IND CO LTD
- Filing Date
- 2023-01-31
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies for detecting fake reviews have low accuracy and poor system robustness, making it difficult to effectively distinguish between genuine and fake reviews.
This paper employs transfer learning and feature fusion to obtain semantic and sentiment features from the comment dataset. It then uses BERT and SKEP models to extract features and combines them with an MLP (Multilayer Perceptron) for detection. By fusing comment features and sentiment features, a prototype representation for comment classification is obtained. Finally, the MLP is used to detect fake comments.
It improves the accuracy and robustness of fake review detection, and enhances the ability to identify fake reviews.
Smart Images

Figure CN115982643B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for detecting fake comments based on transfer learning and feature fusion, belonging to the field of data analysis technology. Background Technology
[0002] In the information age, online reviews influence every aspect of people's daily behavior. From online shopping to career choices, people rely on the experience of others to make judgments. While new social media technologies facilitate information sharing, they also allow misinformation to spread rapidly through online media, meaning that social media platforms can be manipulated. Many unscrupulous businesses or individuals deliberately publish fake reviews for profit, severely interfering with consumers' normal judgment and undermining fair market competition. Social bots (automated social media accounts) can amplify the spread of fake news through recommendation functions. These fake reviews are mixed in with genuine reviews, constantly mimicking their grammar and wording, making them increasingly realistic and harder to detect.
[0003] In reality, many factors influence the authenticity of comments. Relying solely on the linguistic features of the comment content to determine its authenticity ignores other attribute information, which leads to low accuracy in identifying fake comments and poor system robustness.
[0004] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a fake review detection method based on transfer learning and feature fusion, which solves the problems of low accuracy and poor robustness of current fake review identification.
[0006] To achieve the above objectives / to solve the above technical problems, the present invention is implemented using the following technical solution:
[0007] A method for detecting fake reviews based on transfer learning and feature fusion includes:
[0008] Obtain the semantic and sentiment features of the comment text in the comment dataset;
[0009] The semantic and sentiment features of the comment text are concatenated to obtain the comment features;
[0010] Input the comment features into the prototype network to obtain the prototype representation of comment classification;
[0011] Obtain the semantic features of the topic text;
[0012] The prototype representation of comment classification and the semantic features of topic text are input into an MLP multilayer perceptron for detection;
[0013] The MLP (Multilayer Perceptron) outputs the detection results.
[0014] Optionally, the method for obtaining the semantic features of comment text in the comment dataset specifically includes:
[0015] Load the tokenizer into the BERT pre-trained model;
[0016] The Tokenizer adds [CLS] and [SEP] tags to the beginning and end of the comment text;
[0017] Build BertModel, and add a fully connected layer after BertModel;
[0018] Input the comment text into BertModel to obtain the semantic feature vector of the comment text.
[0019] Optionally, the method for obtaining the sentiment features of comment texts in the comment dataset specifically includes:
[0020] Construct the SKEP sentiment feature extractor;
[0021] Input the comment text into the SKEP sentiment feature extractor to obtain the sentiment feature vector of the comment text.
[0022] Furthermore, the method for constructing the SKEP sentiment feature extractor specifically includes:
[0023] Load the built-in dataset ChnSentiCorp from paddlenlp into memory;
[0024] Load the SkepTokenizer module from paddlenlp to convert text string data in ChnSentiCorp into dictionary IDs;
[0025] A DataLoader is constructed based on the data loaded into memory, and the DataLoader divides the data in batches.
[0026] The pre-divided data is input into the SKEP model. The semantic understanding framework of the SKEP model encodes each token of the text and generates a corresponding vector sequence.
[0027] Define the train function to train the SKEP model.
[0028] Furthermore, the calculation formula for obtaining comment features is as follows:
[0029]
[0030] Among them, X i Y is the i-th semantic feature vector; i Let be the i-th sentiment feature vector; K be the convolution kernel; c be the number of semantic feature vectors; and p be the number of sentiment feature vectors.
[0031] Furthermore, the method for obtaining the prototype representation of comment categories specifically includes:
[0032] Obtain sentiment category tags;
[0033] Construct a classification dataset that includes comment features and sentiment classification labels;
[0034] The classification dataset is input into the prototype network to compute the prototype representation of the comment classification.
[0035] Furthermore, the sentiment classification label is the output vector corresponding to the CLS position.
[0036] Furthermore, the calculation formula for the prototype network is as follows:
[0037]
[0038] Where t is the sentiment category label; Z i S is the feature of the i-th comment; k For a dataset with K categories; |S k | represents the number of samples in category k; This refers to the embedding function.
[0039] Furthermore, the detection method of the MLP multilayer perceptron specifically includes:
[0040] Obtain the encoded representation of the topic text
[0041] Obtain the encoded representation of the topic text Distance between each prototype representation;
[0042] Obtain the probability that the topic text is represented by different prototypes;
[0043] Select the encoding representation of the topic text The prototype representation with the smallest distance is used as the classification of the topic text, and the probability corresponding to the prototype representation with the smallest distance is used as the detection result.
[0044] Furthermore, the formula for calculating the probability of the topic text being represented by different prototypes is:
[0045]
[0046] Where c is the number of categories; y i This represents the output value for the i-th category.
[0047] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0048] This invention extracts semantic and sentiment features from comment texts in a comment dataset, and then merges these features to obtain comment characteristics. A prototype network is then used to obtain a prototype representation for comment classification. By inputting this prototype representation along with the obtained semantic features of the topic text into an MLP (Multilayer Perceptron) for detection, the invention avoids relying on a single factor, improves detection accuracy, and solves the problems of low accuracy and poor robustness in identifying fake comments. Attached Figure Description
[0049] Figure 1 This is a flowchart of a fake comment detection method based on transfer learning and feature fusion provided in an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram of semantic feature extraction using a BERT model, based on a method for detecting fake reviews using transfer learning and feature fusion, provided in an embodiment of the present invention.
[0051] Figure 3 This is a schematic diagram of the SKEP model framework, which is a method for detecting fake comments based on transfer learning and feature fusion, provided in an embodiment of the present invention.
[0052] Figure 4 This is a schematic diagram of an MLP framework for a fake comment detection method based on transfer learning and feature fusion provided in an embodiment of the present invention. Detailed Implementation
[0053] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0054] Example
[0055] like Figure 1 As shown, a method for detecting fake reviews based on transfer learning and feature fusion includes:
[0056] Obtain the semantic and sentiment features of the comment text in the comment dataset;
[0057] like Figure 2 As shown, specifically, a tokenizer is loaded into the BERT pre-trained model;
[0058] The Tokenizer adds [CLS] and [SEP] tags to the beginning and end of the comment text;
[0059] Build a BertModel, add a fully connected layer after the BertModel, and adjust the dimensions of the output feature;
[0060] After inputting the comment text into BertModel, the output is obtained. The 0th dimension of the output is the semantic feature, that is, the semantic feature vector of the comment text.
[0061] Construct the SKEP sentiment feature extractor;
[0062] like Figure 3 As shown, specifically, the built-in dataset ChnSentiCorp of paddlenlp is loaded into memory;
[0063] Load the SkepTokenizer module from paddlenlp to convert text string data from ChnSentiCorp into dictionary IDs;
[0064] A DataLoader is constructed based on the data loaded into memory, and the DataLoader divides the data in batches.
[0065] The pre-divided data is input into the SKEP model. The semantic understanding framework of the SKEP model encodes each token of the text and generates a corresponding vector sequence. Since the Tokenizer adds [CLS] and [SEP] markers at the beginning and end of the comment text, the output vector corresponding to the CLS position can represent the complete semantics of the sentence. Therefore, this vector will be used for sentiment classification.
[0066] Define the environment for training the SKEP model, including: configuring training parameters, configuring model parameters, defining the instantiated object of the model, and specifying the optimization algorithm for model training iterations; define the train function to train the SKEP model, and print logs every log_steps during the training process to observe the model training effect.
[0067] The comment text is input into the SKEP sentiment feature extractor to obtain the sentiment feature vector of the comment text; specifically, any text string with sentiment is input, such as: "This cigarette tastes very good, has exquisite packaging, and is reasonably priced", and the goal is to output the sentiment category contained in this text description for sentiment feature extraction.
[0068] The semantic features and sentiment features of the comment text are concatenated to obtain the comment features. The formula for calculating the comment features is as follows:
[0069]
[0070] Among them, X i Y is the i-th semantic feature vector; i Let be the i-th sentiment feature vector; K be the convolution kernel; c be the number of semantic feature vectors; p be the number of sentiment feature vectors;
[0071] By using a splicing layer, the semantic and sentiment features of the comment text are fused, and the similarity of the comment text is effectively improved by fusing semantic and sentiment features.
[0072] The comment features are input into the prototype network to obtain the prototype representation of comment classification; specifically:
[0073] Obtain the sentiment classification label, which is the output vector corresponding to the CLS position;
[0074] Construct a classification dataset containing comment features and sentiment classification labels. The samples within this dataset are represented as {(z1,t1), (z2,t2), ..., (z...}. n ,t n )};
[0075] The classification dataset is input into the prototype network to calculate the prototype representation of the comment classification. The calculation formula for the prototype network is as follows:
[0076]
[0077] Where t is the sentiment category label; Z i S is the feature of the i-th comment; k For a dataset with K categories; |S k | represents the number of samples in category k; The embedding function uses an encoding method for each sample. We learn the encoded representation of each sample (information extraction); for example, we can use convolution operations to extract the encoded information of comments. After learning the encoded representation of each sample, we sum and average the encoded representations of all samples under each category, and use the result as the prototype representation of the category.
[0078] Obtain the semantic features of the topic text;
[0079] The prototype representation of comment classification and the semantic features of topic text are input into an MLP multilayer perceptron for detection;
[0080] like Figure 4As shown, the Multi-Layer Perceptron (MLP) is a generalization of the Perceptron Learning Algorithm (PLA). Its most prominent feature is the presence of multiple layers of neurons, hence it is also called a deep neural network. An MLP is derived from stacked PLAs; when PLAs are deepened to many layers, an MLP is obtained. Neural network layers can be divided into three layers: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, and from each local perspective, it is a linear model plus an activation function.
[0081] Specifically, obtain the encoded representation of the topic text.
[0082] Obtain the encoded representation of the topic text The distance between each prototype representation; specifically, for this new topic sample, the embedding function is used to generate its encoded representation. Then, the distance between the encoded representation of the new sample and the prototype representation of each category is calculated, and the category to which the query sample belongs is determined by the minimum distance; there are no special requirements for the distance calculation, and Euclidean distance or cosine similarity can be used.
[0083] To obtain the probability that a topic text is represented by different prototypes, the specific formula for calculating the probability of a topic text being represented by different prototypes is as follows:
[0084]
[0085] Where c is the number of categories; y i This represents the output value for the i-th category;
[0086] Select the encoding representation of the topic text The prototype representation with the smallest distance is used as the classification of the topic text, and the probability corresponding to the prototype representation with the smallest distance is used as the detection result;
[0087] The MLP (Multilayer Perceptron) outputs the detection results.
[0088] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting fake reviews based on transfer learning and feature fusion, characterized in that, include: Obtain the semantic and sentiment features of the comment text in the comment dataset; The method for obtaining the semantic features of comment text in the comment dataset specifically includes: Load the tokenizer into the BERT pre-trained model; The Tokenizer adds [CLS] and [SEP] tags to the beginning and end of the comment text; Build BertModel, and add a fully connected layer after BertModel; Input the comment text into BertModel to obtain the semantic feature vector of the comment text; The method for obtaining the sentiment features of comment texts in the comment dataset specifically includes: Construct the SKEP sentiment feature extractor; Input the comment text into the SKEP sentiment feature extractor to obtain the sentiment feature vector of the comment text; The semantic and sentiment features of the comment text are concatenated to obtain the comment features; Input the comment features into the prototype network to obtain the prototype representation of comment classification; The calculation formula for the prototype network is: ; in, A prototype representation for categorizing comments. For classification datasets Chinese Classification The number of samples, For the first One comment feature, For the first Sentiment classification labels for each comment feature. This is the encoded representation calculated using the embedding function; Obtain the semantic features of the topic text; The prototype representation of comment classification and the semantic features of topic text are input into an MLP multilayer perceptron for detection; The detection method of the MLP multilayer perceptron specifically includes: Obtain the encoded representation of the topic text ; Obtain the encoded representation of the topic text Distance between each prototype representation; Obtain the probability that the topic text is represented by different prototypes; Select the encoding representation of the topic text The prototype representation with the smallest distance is used as the classification of the topic text, and the probability corresponding to the prototype representation with the smallest distance is used as the detection result; The MLP (Multilayer Perceptron) outputs the detection results.
2. The method for detecting fake reviews based on transfer learning and feature fusion according to claim 1, characterized in that, The method for constructing the SKEP sentiment feature extractor specifically includes: Load the built-in dataset ChnSentiCorp from paddlenlp into memory; Load the SkepTokenizer module from paddlenlp to convert text string data in ChnSentiCorp into dictionary IDs; A DataLoader is constructed based on the data loaded into memory, and the DataLoader divides the data in batches. The pre-divided data is input into the SKEP model. The semantic understanding framework of the SKEP model encodes each token of the text and generates a corresponding vector sequence. Define the train function to train the SKEP model.
3. The method for detecting fake reviews based on transfer learning and feature fusion according to claim 1, characterized in that, The formula for calculating the features of the comments is as follows: ; in, As a comment feature, The first semantic feature Dimension value, The first of the emotional characteristics Dimension value, The number of dimensions of the semantic features. The number of dimensions for emotional features. For the convolution kernel Dimension value, For the convolution kernel The value of the dimension.
4. The method for detecting fake reviews based on transfer learning and feature fusion according to claim 3, characterized in that, The method for obtaining the prototype representation of comment categories specifically includes: Obtain sentiment category tags; Construct a classification dataset that includes comment features and sentiment classification labels; The classification dataset is input into the prototype network to compute the prototype representation of the comment classification.
5. The method for detecting fake reviews based on transfer learning and feature fusion according to claim 4, characterized in that, The sentiment classification label is the output vector corresponding to the CLS position.
6. The method for detecting fake reviews based on transfer learning and feature fusion according to claim 1, characterized in that, The formula for calculating the probability of topic text being represented by different prototypes is: ; in, The number of categories; For the first Output values for each category.