A fake review detection method based on graph attention neural network
By constructing a fake film review detection model based on graph attention neural networks, and using web crawlers to collect data and combining TF-IDF and BERT models to extract feature vectors, the problem of poor fake film review detection performance was solved, achieving more efficient fake film review identification and improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN UNIV
- Filing Date
- 2023-03-16
- Publication Date
- 2026-04-10
AI Technical Summary
Existing methods for detecting fake film reviews perform poorly in film reviews, making it difficult to effectively identify fake reviews, which affects the credibility of platforms and consumer rights, and the film industry faces the risk of bad money driving out good.
A detection model based on graph attention neural network is constructed. Data is collected by web crawler to build a film review dataset. Feature vectors are extracted using the TF-IDF algorithm and BERT model. The model is then combined with node-level and meta-path attention mechanisms to detect fake film reviews.
It improves the accuracy and effectiveness of detecting fake film reviews, provides better detection results, and offers an effective means to enhance the credibility of film review platforms and protect consumer rights.
Smart Images

Figure CN116166806B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the network security technical field in computer science and technology, in particular to a fake review detection method based on a graph attention neural network. BACKGROUND
[0002] With the rapid development of economy, the living standards of the people have been greatly improved, and people's requirements for the quality of life are also getting higher and higher. This has played a great role in promoting the development of the entertainment industry in China. Watching movies is one of the common leisure ways in people's daily life. In recent years, with the development of online ticket purchase and online review platform, consumers can more conveniently select movies, purchase tickets and the like.
[0003] However, at the same time, while online ticket purchase brings convenience to people, it also brings many drawbacks. The rapid development of the film industry in recent years has not only brought huge economic benefits, but also made the vicious competition in the film market more serious. The phenomenon of film manufacturers asking people to post fake reviews and malicious reviews occurs from time to time. In the long run, the proliferation of fake reviews will not only affect the credibility of the platform, resulting in damage to the interests of the platform, but also affect the interests of consumers. More seriously, the reckless fake reviews are likely to cause the situation of inferior coins driving out good coins in the film industry, which will impact the development of the entire film industry.
[0004] At present, there have been many related works on fake review detection, but they basically focus on fake reviews on e-commerce platforms. Since there are certain differences between movie reviews and traditional product reviews, the classic fake review detection method performs poorly in fake movie reviews. SUMMARY
[0005] In view of the above problems, the purpose of the application is to provide a fake review detection method based on a graph attention neural network, which uses a method of capturing node context semantic information in a heterogeneous graph to detect fake reviews, and has better detection effect. The technical scheme is as follows:
[0006] A fake review detection method based on a graph attention neural network, comprising the following steps:
[0007] Step 1: data set construction
[0008] A targeted crawler is designed to collect basic information of various themes of movies, related movie review information and basic information of users publishing comments in a certain period of time on a certain movie platform, and the comment text data is labeled to construct a review data set;
[0009] Step 2: feature extraction
[0010] According to the movie brief of the movie, the keywords are extracted, and then the TF-IDF algorithm is used to generate the movie feature vector; a series of data of the user's level, the number of film watching and the past comments are normalized to obtain the user feature vector; the ConSERT framework based on the BERT model is used to extract the sentence vector of the comment text to obtain the comment feature vector;
[0011] Step 3: detection model
[0012] A detection model based on a graph attention neural network is constructed, and the extracted movie feature vector, user feature vector and comment feature vector are spliced as the input of the model; a node-level attention mechanism is used to learn the weight of the neighbor based on the meta path, and the node embedding obtained in the first step is weighted and combined to obtain the final node embedding for the classification task; the meta path based attention mechanism is used again to distinguish the different meta paths, learn the weight of the different meta paths, and combine the node embedding obtained in the first step to obtain the final node embedding for the classification task, and finally output the detection result.
[0013] Further, the step 1 specifically comprises:
[0014] Step 1.1: a URL is constructed using the movie name, and a Request object is constructed using the Requests library to request resources from the server, and after returning the movie related information, the returned web page is parsed using the BeautifulSoup library to obtain the movie ID corresponding to the movie name;
[0015] Step 1.2: using the API interface of the movie platform, combining the movie ID to construct a URL, using Request to request resources, returning a JSON file containing movie detailed information and movie comment information;
[0016] Step 1.3: combining the user ID information obtained from the movie comment information, obtaining the JSON file of the user's home page to obtain the user information;
[0017] Step 1.4: data labeling standard for fake movie reviews is formulated, and the extracted movie comment records are labeled.
[0018] Further, the movie detailed information includes: movie ID, movie rating, director, leading actor, movie rating distribution, movie release time, movie type, movie viewing number and movie watching number; the movie comment information includes: comment content, comment rating, comment like number, comment reply number, comment time, comment username; the user information includes: user ID, user level, ticket purchase information, total number of user comments, total number of user topics, number of movies the user wants to watch, number of movies the user has watched.
[0019] Further, the extraction of the movie feature vector in step 2 specifically comprises:
[0020] Step 2.1.1: For a given movie synopsis text Perform data preprocessing operations including word segmentation, part-of-speech tagging and stop word removal to obtain candidate keywords, that is ;
[0021] Step 2.1.2: Calculate the term frequency TF of the word in the text ;
[0022] Step 2.1.3: Calculate the inverse text frequency of the word , the number of documents in which the word appears in the corpus, and the total number of documents;
[0023] Step 2.1.4: Calculate the TF-IDF value of the word , and then calculate the TF-IDF values of all candidate keywords;
[0024] Step 2.1.5: Sort the candidate keyword calculation results in descending order to obtain the top N words as the movie synopsis text keywords.
[0025] Further, the extraction of the user review vector in step 2 uses a ConSERT framework based on a BERT model, which fine-tunes the BERT model, including:
[0026] A data augmentation module is used to generate different input samples for the embedding layer;
[0027] A shared BERT encoder is used to calculate the sentence representation for each input review text; during training, the average pooling of the last layer embedding is used to obtain the sentence representation;
[0028] A contrastive loss layer is set on top of the BERT encoder to maximize the consistency between a sentence representation and its corresponding augmented sentence, while minimizing its similarity with other sentence representations in the same batch;
[0029] For each input review text , the fine-tuned BERT model first passes it to the data augmentation module, which applies two transformations , to generate two types of embeddings , , where , It is the sequence length. It is a hidden dimension; subsequently All data are fed into a shared BERT encoder, where they are encoded by multiple transformer blocks within BERT. The encoded results are then processed by average pooling to produce sentence vectors. .
[0030] Furthermore, step 3 specifically includes:
[0031] Step 3.1: Set the movie node User nodes Comment nodes The heterogeneous graph formed serves as the input to the model; the task target node... The resulting sentence vector is represented as n is the total number of target nodes C;
[0032] There are two metapaths. This indicates that the two comments were posted by the same user; This indicates that the two comments were posted by users who have watched the same movie. Indicates reverse relation;
[0033] Step 3.2: Node embedding based on node attention mechanism
[0034] Step 3.2.1: Find a given pair of metapaths Connected nodes Node-level attention value This value also means the node For nodes The importance of is calculated as follows:
[0035] (1);
[0036] in, The features of node i and node j are respectively. Represents a deep neural network that performs node-level attention; given a meta-path , This is shared for all node pairs based on metapaths;
[0037] Step 3.2.2: Process the obtained attention values Performing a normalization operation yields the normalized attention coefficients, as shown in the following formula:
[0038] (2);
[0039] in, the normalized attention coefficient, an activation function, a meta-path the transpose of the node-level attention vector, denotes a connection, a node based on the neighbor nodes of the meta-path
[0040] Step 3.2.2: The meta-path based embedding of a node is obtained by a weighted sum of the attention coefficient of the node and the feature embeddings of its surrounding neighbors, followed by an activation function, to obtain a feature representation of the node , as shown in the following formula:
[0041] (3);
[0042] After obtaining the features of all nodes, the feature corresponding to each node under the meta-path is obtained; similarly, given a meta-path set , the node embedding of groups is obtained, denoted as ;
[0043] Step 3.3: Node embedding based on meta-path attention mechanism
[0044] Step 3.3.1: Select all nodes under a meta-path , and pass each node through a fully connected layer, an activation function, and then multiply it by a learnable parameter to obtain the scalar corresponding to the node under the meta-path ; do the same for all nodes, then weighted sum and divide by the number of nodes to obtain the importance of the meta-path , as shown in the following formula:
[0045] (4);
[0046] where is a weight matrix, b is a bias vector, is a semantic-level attention vector, is the number of nodes;
[0047] Step 3.3.2: Normalize by a softmax operation to represent the weight of the meta-path as as shown in the following formula:
[0048] (5);
[0049] wherein, is the number of meta-paths;
[0050] Step 3.3.3: fuse the embeddings of these nodes, do a weighted sum of the nodes to get the final embedding as shown in the following formula:
[0051] (6);
[0052] Step 3.4: put the obtained target task node embedding into the full connection layer to output the classification result;
[0053] The loss function of the detection model based on the graph attention neural network is a minimum cross-entropy loss function, as shown in the following formula:
[0054] (7);
[0055] wherein, is a sample node index set, and is the label and embedding of the node, is the parameter of the classifier, is the minimum cross-entropy loss function value.
[0056] The beneficial effects of the present application are: firstly, the present application constructs a network crawler to collect data of a movie platform and preliminarily processes the data, then strictly manually annotates the comment text information to construct a data set; uses the collected user, movie and comment data to construct a heterogeneous graph, wherein the key is to confirm the nodes in the heterogeneous graph and extract the node features, in this process, the TF-IDF algorithm, normalization and ConSERT model are used to extract the features of the nodes; a graph attention network based on the heterogeneous graph is constructed, which includes two layers of attention mechanism, which are node-based attention mechanism and meta-path-based attention mechanism, and finally the comment node embedding containing semantic information is obtained for classification; the present application firstly proposes a way of using a heterogeneous graph to capture the context semantic information of the nodes to detect fake movie reviews, and the experimental evaluation results show that the model proposed by the present application has better effect than the traditional text-based classification method, which provides a method and idea for future fake movie review detection. BRIEF DESCRIPTION OF DRAWINGS
[0057] Figure 1 is the overall framework diagram of the fake movie review detection method based on the graph attention neural network of the present application.
[0058] Figure 2 Flowchart of the crawler of the present application.
[0059] Figure 3 ConSERT framework diagram of the present application.
[0060] Figure 4 Detection model diagram based on graph attention neural network of the present application.
[0061] Figure 5 Meta-path effect comparison diagram.
[0062] Figure 6 Different sentence vector performance comparison diagram.
[0063] Figure 7 Different detection model performance comparison diagram. DETAILED DESCRIPTION
[0064] The present application will be further described in detail below in combination with the accompanying drawings and specific embodiments.
[0065] As shown in Figure 1 the entire framework of the false review detection method based on the graph attention neural network of the present application mainly contains three parts: data set construction, feature extraction and detection model.
[0066] (1) Data set construction: the present application develops a Web crawler to obtain data, based on relevant movie platforms, collects basic information of various themes of movies in the past five years and relevant movie review information and basic information of users publishing comments. Then the review text data obtained by crawling is labeled, and the constructed review data set provides data support for the present application.
[0067] (2) Feature extraction: the core work of this part is to analyze and extract the features of the review, and generate an initial feature vector for each movie. First, the features of the movie, the user and the review are extracted respectively, the movie synopsis of the movie is used for keyword extraction, and then the TF-IDF algorithm is used to generate the feature vector of the movie; the level, the number of movies, the past review data and the like of the user are normalized to obtain the feature vector of the user; the ConSERT framework based on the BERT model is used to extract the sentence vector of the review text to obtain the feature vector of the review. Subsequently, a heterogeneous graph will be constructed on the basis of the features of the above three groups of nodes as the input of the model.
[0068] (3) Detection model: In this part, the present application uses a heterogeneous graph neural network containing different types of nodes and connections to generate node embeddings for the target task for classification, in which the feature vectors generated in the "feature extraction" module are spliced into the input of the model. In addition, the present application introduces a node-level attention mechanism and a path-level attention mechanism to fully consider various semantic information contained in the heterogeneous graph to obtain better node embedding representations for classification.
[0069] 1. Data set construction
[0070] Currently, there is little research on fake review detection, so there is a lack of reliable fake review data sets. The present application collects the content in the review platform based on a certain strategy by developing a web crawler, and after processing the collected data, it is manually annotated to construct the fake review data set of the present application. The collected data includes movie basic information, movie review information, and user basic information for publishing reviews.
[0071] (1) Data collection method
[0072] This embodiment uses a targeted crawler to collect various data, and the specific process is as shown in Figure 2
[0073] This method first uses the movie name to construct a URL, and uses the Requests library to construct a Request object to request resources from the server. After returning the movie-related information, the returned web page is parsed using the BeautifulSoup library to obtain the movie ID corresponding to the movie name. Then, using the API interface of the Maoyan platform, the URL is constructed combined with the movie ID, and the Request is used to request resources, returning a JSON file containing movie information and movie review information. Finally, combined with the user ID information obtained from the movie review information, the same method is used to obtain the JSON file of the user's home page to obtain the user information. Table 1 shows the API interface used in the crawler process
[0074] Table 1 API interface
[0075]
[0076] (2) Data collection strategy
[0077] In order to improve the accuracy of data annotation and the universality of data, this embodiment collects detailed information of various types of movies released on the Maoyan platform from 2017 to 2021, movie reviews, and review user information.
[0078] Movie details include movie ID, movie rating, director, lead actor, movie rating distribution, movie release time, movie type, movie viewership, and movie watchlist. Table 2 records the data field table obtained by the movie homepage crawler. Movie review information includes review content, review rating, review likes, review replies, review time, and review username. Table 3 records the data field table obtained by the movie review crawler. User information includes user ID, user level, ticket purchase information, total number of user reviews, total number of user topics, number of movies on the user watchlist, and number of movies watched by the user. Table 4 records the data field table obtained by the user information crawler.
[0079] This embodiment collects various genres of movies (including action, romance, horror, science fiction, etc.) from 2017 to 2021, a total of 2,352 movies, with 734,130 review records.
[0080] Table 2 Movie API fields
[0081]
[0082] Table 3 User API fields
[0083]
[0084] Table 4 Review API fields
[0085]
[0086] (3) Data annotation
[0087] This embodiment refers to the 30 methods proposed by the consumeris website to judge fraudulent online reviews (30 Ways You Can Spot Fake Online Reviews) and develops the following data annotation standards for fake movie reviews based on the characteristics of related movie fake reviews. The specific evaluation criteria are as follows:
[0088] 1) The review content is completely unrelated to the movie being reviewed;
[0089] 2) The evaluation and rating are mismatched, with high ratings for negative reviews and low ratings for positive reviews;
[0090] 3) The review description is exaggerated and overly complimentary, filled with empty adjectives and pure enthusiastic praise without any shortcomings;
[0091] 4) The review content is uniform in sentence structure and appears in a large number of similar reviews in other movie reviews;
[0092] 5) The review content shows that the score is given too high or too low simply because of liking or disliking a movie star or a character.
[0093] As long as any of the above criteria is met, the review will be identified as a fake review. The specific data statistics are shown in Table 3.5. The present application finally labeled 472 movies with a total of 65,627 review records for data labeling, including 20,114 fake review records. Details are shown in Table 5.
[0094] Table 5 Dataset information
[0095]
[0096] 2. Feature extraction
[0097] (1) Movie features
[0098] In the present application, the movie synopsis is selected as the basic information for feature extraction based on the characteristics of the movie. Since the user's published review should be around the movie in normal circumstances, the movie synopsis as a feature of the movie can effectively help to judge the fake movie review. In order to better find the commonality between different movies and remove noise, the method first extracts the keywords of the movie synopsis, highly condenses the text information, and then converts it to a vector to obtain the vector features.
[0099] The method flow of keyword extraction is as follows:
[0100] 1) For the given text Carry out data preprocessing operations such as word segmentation, part-of-speech tagging, and removing stop words. This method uses the Jieba word segmentation, and retains the words of several word types such as nouns, other proper names, verbs, adverbs, adjectives, adverbs, etc. Finally, 100 candidate keywords are obtained, i.e. The stop word table used is the Chinese stop word table published by the Chinese Academy of Sciences Institute of Computing, which includes 1,208 stop words;
[0101] 2) Calculate the word frequency of the word in the text ;
[0102] 3) Calculate the word in the entire corpus , is the number of documents in which the word appears in the corpus, and is the total number of documents;
[0103] 4) Calculate the word The TF-IDF values of the candidate keywords are calculated, and the steps are repeated to obtain the TF-IDF values of all candidate keywords;
[0104] 5) The candidate keyword calculation results are arranged in descending order, and the top N words are obtained as the text keywords.
[0105] The present application selects ten words as the text keywords for the movie introduction of each movie, and then uses TF-IDF to obtain a TF-IDF weight matrix as the movie features.
[0106] (2) User features
[0107] The user-based features are the number of movies to watch, the number of movies watched, the number of comments published, the number of topics participated in, the user level, the number of likes of the published comments, the number of comments and ratings, and other information, as well as the user comment time, the relative time of the user comment time and the movie. These features can help determine the authenticity of the user's published movie reviews based on the user's basic information and behavior information.
[0108] The various characteristic indices of the user exhibit different dimensions and magnitudes due to the differences in their characteristics. However, in the case of a large difference between different indicators, if the original indicator value is used for analysis, the index with a high numerical value will be highlighted in the overall analysis, while the index with a low numerical level will be relatively weakened. Therefore, in order to ensure the credibility of the test results, the original indicators must be normalized. The normalization formula is shown in formula (1).
[0109] (1);
[0110] wherein, is the normalized feature index. For indicators such as movie ratings that contain multiple numerical values, the method will calculate the average value based on normalization.
[0111] (3) Comment features
[0112] In the present application, the extraction of comment features is essentially a process of learning sentence representation. According to related research, it is found that the sentence representation generated by BERT is collapsed and cannot play a good role in some subsequent downstream tasks, so the present application uses ConSERT based on BERT to complete the task of sentence vector representation. This method fine-tunes BERT, effectively solves the collapse problem of BERT, and makes the sentence vector more suitable for downstream tasks. The specific framework is shown in Figure 3 .
[0113] There are three main components in the framework:
[0114] Data augmentation module: generates different input samples for the embedding layer.
[0115] Shared BERT encoder: computes sentence representations for each input text. During training, the average pooling of the last layer embeddings is used to obtain the sentence representation.
[0116] Contrastive loss layer: on top of the BERT encoder, there is a contrastive loss layer that maximizes the agreement between one sentence representation and its corresponding augmented sentence, while minimizing its similarity with the representations of other sentences in the same batch.
[0117] For each input text The model first passes it to the data augmentation module, which applies two transformations , to generate two types of embeddings , where , is the sequence length, is the hidden dimension. Subsequently are both fed into the shared BERT encoder, which is encoded by the multi-layer transformer blocks in BERT, as shown in Figure 3 , and the encoded results are then passed through average pooling to produce the sentence representation .
[0118] 3. Detection model
[0119] The application provides a detection model based on a graph attention neural network, and the core idea of the model is to use a heterogeneous graph to obtain node embedding for a specific task. First, a node-level attention mechanism is used to learn the weights of the neighbors based on the meta path, and the weights are aggregated to obtain the first-step node embedding. Then, a meta path-based attention mechanism is used to distinguish different meta paths, and the first-step node embedding is weighted and combined to obtain the final node embedding for a classification task. The following is a detailed introduction to the input layer, node-based attention mechanism, meta path-based attention mechanism, and output layer. The specific model diagram of the application is shown in Figure 4 .
[0120] (1) Input layer
[0121] The model input used by the method is a heterogeneous graph composed of movie nodes , user nodes , and review nodes . The information contained in the three types of nodes is the feature information extracted in the feature extraction described above, and the specific process will not be described here. The sentence vector obtained by the task target node is represented as , are 768-dimensional vectors. There are two meta-paths used in this invention, which are , which indicates that two reviews are made by the same user; , which indicates that two reviews are made by the users who have watched the same movie.
[0122] (2) Node-based attention mechanism
[0123] The node-based attention mechanism is divided into three steps.
[0124] 1) The first step is to calculate the node-level attention value of a given pair of nodes connected by a meta-path . This value also means the importance of node to node , and its calculation formula is shown in equation (2).
[0125] (2).
[0126] where are the features of node and node , respectively, denotes the deep neural network that performs node-level attention. Given meta-path , is shared for all meta-path-based node pairs. This is because there are some similar connection patterns under a meta-path. The above formula shows that, given meta-path , the weight of the meta-path-based node pair depends on their features.
[0127] 2) The second step is to normalize the obtained attention value to obtain the normalized attention coefficient, and the process is shown in equation (3).
[0128] (3).
[0129] where is the normalized attention coefficient, is the activation function, is the transpose of the node-level attention vector of meta-path , denotes the connection, is the neighbor node of node based on meta-path (including itself).
[0130] 3) The third step is to calculate the meta-path-based attention score of node . The embedding of a node can be obtained by aggregating the attention coefficients of the node with the feature embeddings of its surrounding neighbors, passing through an activation function, to obtain a feature representation of the node as shown in equation (4).
[0131] (4).
[0132] The embedding of each node is obtained by aggregating its neighboring nodes. Since the attention weights are generated for a single meta-path, it is semantic-specific and can capture the semantic information under the meta-path. In the same way, the features corresponding to other nodes can be obtained. After obtaining the features of all nodes, the feature corresponding to each node under the meta-path is obtained. Similarly, given a set of meta-paths , the group node embedding can be obtained, denoted as .
[0133] (3) Meta-path based attention mechanism
[0134] Generally, each node in a heterogeneous graph contains multiple types of semantic information, which can be revealed by meta-paths. To address the selection of semantic information revealed by different meta-paths in a heterogeneous graph, the method uses a meta-path based attention mechanism to automatically learn the importance of the semantics brought by different meta-paths and fuse them. The meta-path based attention mechanism can also be divided into the following three steps.
[0135] 1) In the first step, all nodes under a meta-path are selected. Each node passes through a fully connected layer, an activation function, and then is multiplied by a learnable parameter , so that the scalar corresponding to the node under the meta-path is obtained. The same operation is performed on all nodes, then weighted sum is performed, and finally divided by the number of nodes to average, so that the importance of the meta-path is obtained, denoted as . As shown in equation (5).
[0136] (5).
[0137] where is the weight matrix, b is the bias vector, is the semantic level attention vector.
[0138] 2) After obtaining the importance of each meta-path, the second step is to normalize the weights of meta-paths by a softmax operation, which is shown in formula (6).
[0139] (6).
[0140] wherein, is the number of meta-paths.
[0141] can be interpreted as the contribution of meta-path to the specific task, and it is obvious that the higher the value is, the more important the meta-path is.
[0142] 3) The third step is to fuse the embeddings of these nodes by weighted summation to obtain the final embedding . As shown in formula (7).
[0143] (7).
[0144] (4) Output layer
[0145] Finally, the obtained target task node embedding is put into a full connection layer to obtain the output for classification, and the loss function of the model is the minimum cross-entropy loss function. As shown in formula (8).
[0146] (8).
[0147] wherein, is the sample node index set, and is the label and embedding of the node, is the parameter of the classifier, and the minimum cross-entropy loss function value.
[0148] 4. Experimental verification
[0149] Three experiments are designed in this embodiment to evaluate the effect of false movie review detection of the model. The data set is a false movie review data set collected by the project, which contains 20,114 false movie reviews and 45,513 normal movie reviews. In the experiment, 80% of the false movie review data set is divided as the training set, 10% as the validation set, and 10% as the test set. Each experiment is repeated 10 times, and the average value is taken as the final result.
[0150] 4.1. Evaluate the effect of meta-path
[0151] The experiment analyzes the influence of the selection of the meta-path combination on the performance of the model, because a small number of high-quality meta-paths can bring considerable performance. The experiment considers both single meta-paths and their combinations. Specifically, the meta-paths used by the method are two, one is , which represents that two movie reviews are sent by the same user; and the other is , which represents that two reviews are sent by the user who has watched the same movie. In order to analyze the influence of different combinations of meta-paths, the experiment uses single meta-paths and combined meta-paths for experiments.
[0152] The experimental results are shown in Table 6 and Figure 5 . It can be found from Table 6 that the single meta-paths each show different performance, among which , which shows that different meta-paths represent different relationships and have different effects on the final node embedding. The semantic information presented by the better performance path has a greater impact on the model. In addition, although the performance growth is not very obvious, it can be observed that, overall, the combination of meta-paths shows better performance, and the reason why the combined meta-path can show better performance is probably that it contains more semantic information, so that the node can capture more features and thus better complete the classification task, proving the effectiveness of the meta-path proposed in the application.
[0153] Table 6 Meta-path effect table
[0154]
[0155] 4.2. Evaluation of the effect of the sentence vector model
[0156] Since the model of the application performs aggregation between nodes on the basis of node features as input to obtain the final node embedding for classification, the feature input of the sentence node as the task target is particularly important. The experiment uses three different ways to obtain the sentence vector, i.e., the initial embedding of the sentence node, to prove the effectiveness of the selected sentence vector input of the method.
[0157] The sentence vector acquisition methods selected in the experiment include the following: BERT model, which is a multi-layer bidirectional transformer encoder based on fine-tuning; Doc2vec model, which is based on the Word2vec model, and trains a neural network to express the concept of the entire document through the task of predicting the central word based on the context mean of the word vector and the vector of the entire document; SBERT model, which modifies the pre-trained BERT and uses a twin network and a triplet network on the basis of the traditional BERT; and ConSERT model, which is generated to solve the "collapse" phenomenon of the BERT vector, and the generated sentence vector can be more adapted to the downstream task.
[0158] The dimensions of the above-mentioned four types of sentence vectors are shown in Table 7.
[0159] Table 7: Sentence vector dimension table
[0160]
[0161] The experimental results of the comparison of the sentence vectors are shown in Table 8. Figure 6 As can be seen from the comparison of the experimental results, the text feature vectors extracted by BERT, Doc2Vec and SBERT are not as good as ConSERT. The experimental results of BERT and SBERT are poorer than the ConSERT sentence vector extraction method, which should be due to the collapse problem of the BERT representation itself, because the word representation of BERT is cone-shaped as a whole, which will lead to the dominance of high-frequency words in sentence representation, resulting in extremely high overall similarity and affecting the downstream task. Among them, the improved SBERT is better than BERT in overall performance, but it cannot solve the fundamental problem and leads to poor performance. Doc2Vec adopts an extraction idea for the main theme of the text, and the vector dimension is selected by the user, so it is difficult to determine the optimal vector dimension and ensure its effect, so the effect is poor.
[0162] 4.3. Evaluate the effect of the proposed detection model
[0163] To prove that the model proposed in the application has obvious advantages in fake review detection, we carefully selected common detection models including traditional machine learning and deep learning for experiments, including DPCNN (Deep Pyramid Convolutional Neural Networks), TextCNN (Text Convolutional Neural Network), TextRNN (Text Recurrent Neural Network), Att_TextRNN, TextRCNN, and compared them in terms of accuracy, precision, recall, F value and other indicators.
[0164] The experimental results are shown in Table 8. Figure 7 It can be seen that the detection model proposed in the application is not the highest in accuracy on the constructed fake review data set, but the precision, recall and F1 value are better than other comparison models, and the F1 value reaches 0.8928. In addition, the detection results of the model with the attention mechanism are better than those of the model without the attention mechanism, because the attention mechanism can help the model to find more effective features. From the comparison results, it can be seen that the research idea of combining the semantic information of the comment node proposed in the method is better than the traditional research method of only using the text itself, and can achieve better results in detecting fake reviews. In addition, the TextRNN model with the sentence vector generated by ConSERT as input also shows better results, proving that the sentence vector feature has an advantage in obtaining the features of the text itself. Moreover, the graph structure integrated into the model also contributes to the fake review detection results.
[0165] Table 8. Performance of different detection models
[0166]
[0167] In summary, the model proposed in the application plays a certain role in the selection of sentence vector feature extraction method, the introduction of attention mechanism and the combination of meta path, and the method proposed in the application has achieved excellent results in fake review detection problems.
Claims
1. A fake review detection method based on a graph attention neural network, characterized in that, The method comprises the following steps: Step 1: data set construction A targeted crawler is designed to collect basic information of movies of various themes, related movie review information and basic information of users publishing the review information in a certain time period of a certain movie platform, and to label the review text data to construct a movie review data set; Step 2: feature extraction After keyword extraction according to the movie synopsis, a movie feature vector is generated using the TF-IDF algorithm; the user's rating, the number of movies watched and a series of past review data are normalized to obtain a user feature vector; a ConSERT framework based on a BERT model is used to extract a sentence vector from the review text to obtain a review feature vector; Step 3: detection model A detection model based on a graph attention neural network is constructed, and the extracted movie feature vector, user feature vector and review feature vector are spliced as the input of the model; a node-level attention mechanism is used to learn the weight of the neighbor based on the meta path, and the first step node embedding is weighted and aggregated to obtain the final node embedding for the classification task, and finally the detection result is output. The step 1 specifically comprises:
2. The fake review detection method based on graph attention neural network according to claim 1, wherein, Step 1.1: a URL is constructed using the movie name, and a Request object is constructed using the Requests library to request resources from the server, and after the movie-related information is returned, the returned web page is parsed using the BeautifulSoup library to obtain the movie ID corresponding to the movie name; Step 1.2: an API interface of the movie platform is used to construct a URL combined with the movie ID, and a Request is used to request resources to return a JSON file containing movie details and movie review information; Step 1.3: the user ID information obtained from the movie review information is used to obtain the JSON file of the user's home page to obtain the user information; Step 1.4: a data labeling standard for fake movie reviews is formulated, and the extracted movie reviews are labeled. The movie details include movie ID, movie rating, director, main actor, movie rating distribution, movie release time, movie type, movie viewing number and movie watching number; the movie review information includes review content, review rating, comment likes, comment replies, comment time and comment username; the user information includes user ID, user level, ticket purchase information, user review total number, user topic total number, user movie watching number and user movie viewing number.
3. The fake review detection method based on graph attention neural network according to claim 2, characterized in that, The extraction of the movie feature vector in the step 2 specifically comprises:
4. The fake review detection method based on graph attention neural network according to claim 1, characterized in that, Step 2.1.5: the candidate keywords calculation result is arranged in descending order to obtain the top N words as the movie synopsis text keywords. Step 2.1.1: For a given movie synopsis text Data preprocessing operations including word segmentation, part-of-speech tagging, and stop word removal are performed to obtain candidate keywords, i.e. ; Step 2.1.2: Calculate word frequencies In text TF; Step 2.1.3: Calculate the word Inverse document frequency of the whole corpus , Number of documents in which the word occurs, Total number of documents; Step 2.1.4: Calculate the TF-IDF value of the word , and then calculate the TF-IDF value of all candidate keywords; The extraction of the user review vector in the step 2 uses a ConSERT framework based on a BERT model, which fine-tunes the BERT model, including:
5. The fake review detection method based on graph attention neural network according to claim 1, characterized in that, A data augmentation module is used to generate different input samples for the embedding layer; A shared BERT encoder is used to compute sentence representations for each input review text; during training, average pooling of the last layer embeddings is used to obtain sentence representations; A contrastive loss layer is set on top of the BERT encoder to maximize the agreement between a sentence representation and its corresponding augmented sentence, while minimizing its similarity to other sentence representations in the same batch; For each input review text , the fine-tuned BERT model first passes it to a data augmentation module, which applies two transformations , to generate two types of embeddings , where , is the sequence length, is the hidden dimension; subsequently both are fed into a shared BERT encoder, which is encoded by the multi-layer transformer blocks in BERT, and then the encoded results are passed through average pooling to produce a sentence vector .
6. The fake review detection method based on graph attention neural network according to claim 1, characterized in that, The step 3 specifically comprises: Step 3.1: Constructing the heterogeneous graph as input of the model with movie nodes , user nodes , review nodes Step 3.2: The task goal node The resulting sentence vector representation is n is the total number of target nodes C. There are two meta-paths, representing that the two comments were made by the same user; representing that the two comments were made by users who saw the same movie, representing the inverse relationship; Step 3.2: Node embedding based on node attention mechanism Step 3.2.1 : Querying the attention value of a given pair of nodes through a meta-path connected nodes of the nodes level , which also means the importance of the node to the node , which is calculated as shown in the following formula: (1); wherein, are features of the node and the node , denotes a deep neural network that performs node-level attention; given a meta-path , is shared for all pairs of nodes based on the meta-path. Step 3.2.2: Normalizing the obtained attention values Normalization is performed to obtain normalized attention coefficients as follows: (2); wherein, is the normalized attention coefficient, is an activation function, is a meta-path node-level attention vector, denotes a connection, is a node based on a neighbor node of the meta-path , is a node based on a neighbor node of the meta-path ; Step 3.2.2: Nodes Meta-path based The embedding is determined by the attention coefficient of the node. The node is obtained by performing a weighted summation of the feature embeddings of its surrounding neighbors and then passing the sum through an activation function. The corresponding feature representation As shown in the following formula: (3); After all nodes get the features, we get The feature of each node in this meta-path ; Similarly, given a set of meta-paths , we get group node embeddings, denoted as ; Step 3.3: Node embedding based on meta-path attention mechanism Step 3.3.1: Select a metapath All nodes below are processed through a fully connected layer, an activation function, and then multiplied by a learnable parameter. To obtain this node In metapath The corresponding scalar; perform the same operation on all nodes, then sum them by weight and divide by the number of nodes to obtain the metapath. Importance As shown in the following formula: (4); wherein, is a weight matrix, b is a bias vector, is a semantic level attention vector, is the number of nodes; Step 3.3.2: Normalization is performed by a softmax operation to represent the weights of the meta-path as follows: (5); wherein, is the number of meta-paths; Step 3.3.3: Fuse the embeddings of the nodes, do a weighted sum of the nodes, to get the final embedding As shown in the following formula: (6); Step 3.4: Put the obtained target task node embedding into a fully connected layer to output a classification result; The loss function of the detection model based on the graph attention neural network is a cross-entropy loss function to be minimized, as shown in the following formula: (7); wherein, is a set of sample node indices, and are labels and embeddings of nodes, are parameters of the classifier, minimizes a cross-entropy loss function value.
Citation Information
Patent Citations
Heterogeneous graph embedding learning method based on attention mechanism
CN113095439A
False comment recognition model based on structure attention enhancement mechanism
CN114625842A