A method, system and storage medium for predicting cyberbullying sessions

By constructing a social network graph that combines comment-level and conversation-level features, and employing a multi-task learning framework and semi-supervised learning methods, the problem of inaccurate prediction results in cyberbullying detection models is solved, thereby improving the accuracy of bullying detection and the interpretability of the model.

CN116340477BActive Publication Date: 2026-01-30BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310110049.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-02
Publication Date
2026-01-30
Estimated Expiration
2043-02-02

AI Technical Summary

Technical Problem

Existing cyberbullying detection models neglect fine-grained comment-level tagging information and the close relationship between offensive language detection tasks and bullying detection tasks, resulting in inaccurate prediction results.

Method used

By constructing a social network graph, combining comment-level and conversation-level features, and adopting a multi-task learning framework, an aggressive language detection task is introduced as an auxiliary task, and a semi-supervised learning method is used to automatically label comment-level information, thereby improving prediction accuracy.

Benefits of technology

It improves the accuracy of predicting cyberbullying sessions and has better model interpretability. It solves the problem of noise introduced by external classifiers and achieves more efficient bullying detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340477B_ABST
    Figure CN116340477B_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and storage medium for predicting cyberbullying sessions, comprising: acquiring multiple comments of session data to be predicted; inputting the multiple comments into a comment-level encoding module to obtain comment-level feature vectors for each comment; inputting each comment-level feature vector into a session-level encoding module to obtain session-level feature vectors for the comments; constructing a social network graph based on each comment-level feature vector, where nodes in the social network graph represent comments and edges in the social network graph represent the similarity or mention relationship between adjacent comments; obtaining social feature vectors corresponding to the social network graph based on a graph attention network; performing global average pooling on each social feature vector to obtain a first feature vector; inputting the session-level feature vector into a first attention layer to obtain a second feature vector; and inputting the first and second feature vectors into a first multilayer perceptron (MLP) layer to obtain the cyberbullying session prediction result. This method improves the accuracy of cyberbullying session prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer technology, and particularly relates to a cyberbullying session prediction method and system and a storage medium. BACKGROUND

[0002] Cyberbullying is considered as a form of bullying or harassment through social platforms, which is characterized by posting derogatory, insulting, rumor, threatening, aggressive comments, photos or videos on social media. With the popularity of social media, cyberbullying appears on various social platforms and spreads to victims in a short time, becoming a serious social problem. In order to cope with the rapid growth of cyberbullying cases, many efforts are devoted to the detection and intervention of cyberbullying; however, due to the large amount of data of each social platform, it is impossible to manually manage all the content in time, and some tools are needed to actively filter these cyberbullying content, therefore, at present, many online platforms have invested a lot of resources for the detection and classification of cyberbullying content. With the growth of the scope and scale of the problem, the demand for tools for automatic detection and classification of cyberbullying is also growing, and at present these tools are roughly divided into two categories according to whether external comment level category information is introduced: one category is not using comment level category information, and the other category is heavily relying on manually annotated comment level label information.

[0003] And for the above method, previous work is only to formulate the cyberbullying detection problem as a single session level classification task, and mainly relies on deep neural networks such as recurrent neural networks and graph neural networks to obtain session level representation; it usually needs to use text features and network-based features. Recently, a multi-task learning model based on comment label information assisted emotion classification task for cyberbullying detection is proposed in the prior art; in this model, in order to realize the supervised training of the multi-task framework, an artificially annotated Hindi-English code mixed corpus is created. However, for this model, the manually annotated data is time-consuming and laborious, in addition, the model ignores the close correlation between the aggressive language detection task and the bullying detection task.

[0004] Currently, the TGBully model is commonly used for detecting cyberbullying, and the TGBully is composed of three modules, namely a semantic context modeling module, a temporal graph interaction learning module and a conversation classification module. In the semantic context modeling module, a set of cyberbullying comments are first hierarchically modeled to obtain a text feature representation, and each comment sequence contains a word sequence; in order to combine the features of the users who post these comments, the module further extracts the historical comments of the users, from which the language behavior of the users is inferred. The temporal graph interaction learning module implicitly constructs a user-user interaction graph by encoding the topic coherence and temporal dynamics of the user comments in a graph attention network (GAT); this module takes into account both content similarity and temporal intervals between comments, and user interaction is learned by constantly updating the edge weights in GAT; based on this, the TGBully models user interaction by propagating interaction signals in the constructed temporal graph. The conversation classification module aggregates the information representation learned from user interaction and performs final conversation-level classification, i.e., determines whether the conversation is bullying content. Although the TGBully model can realize the prediction of bullying content, the model models the bullying detection as a single task, ignores the role of fine-grained comment-level label information in the cyberbullying detection task, and the close relationship between the aggressive language detection task and the bullying detection task, and the TGBully model has the disadvantage that the prediction result is not accurate enough. Therefore, how to improve the accuracy of the prediction result of cyberbullying is a technical problem to be solved. SUMMARY

[0005] Therefore, the present application provides a cyberbullying conversation prediction method and system, and a storage medium, to solve one or more problems in the prior art.

[0006] According to one aspect of the present application, a cyberbullying conversation prediction method is disclosed, the method comprising:

[0007] Obtaining a plurality of comments of the conversation data to be predicted, and inputting the plurality of comments into a comment-level encoding module to obtain a comment-level feature vector of each comment;

[0008] Inputting each comment-level feature vector into a conversation-level encoding module to obtain a conversation-level feature vector of the comment;

[0009] Constructing a social network graph based on each comment-level feature vector, wherein the nodes of the social network graph represent each comment, and the edges of the social network graph represent the similarity or mention relationship between adjacent two comments; and obtaining a social feature vector corresponding to the social network graph based on a graph attention network;

[0010] perform global average pooling on each of the social feature vectors to obtain a first feature vector, input the session-level feature vector into a first attention layer to obtain a second feature vector, and input the first feature vector and the second feature vector into a first multi-layer perceptron (MLP) layer to obtain a cyberbullying prediction result.

[0011] In some embodiments of the present application, the plurality of comments are input into a comment-level encoding module to obtain a comment-level feature vector of each of the comments, including:

[0012] The plurality of comments are input into a word embedding model to obtain a word embedding vector of each of the comments.

[0013] Each of the word embedding vectors is input into an encoding layer to obtain a hidden layer representation with context relationships.

[0014] The hidden layer representation is input into a second attention layer to obtain the comment-level feature vector.

[0015] In some embodiments of the present application, each of the comment-level feature vectors is input into a session-level encoding module to obtain a session-level feature vector of the comment, including:

[0016] Each of the comment-level feature vectors is input into a BiGRU encoder to obtain the session-level feature vector of the comment; and / or

[0017] Based on each of the comment-level feature vectors, a social network graph is constructed, including:

[0018] Based on the mention relationship between each of the comments, an initial edge of the social network graph is determined.

[0019] Based on the similarity between each of the comments, the initial edge is expanded to obtain an expanded edge.

[0020] Based on the comment-level feature vector corresponding to each of the comments and the expanded edge, the social network graph is constructed.

[0021] In some embodiments of the present application, the method further includes:

[0022] Based on the aggressive language prediction model, an aggressive language prediction is performed on the social feature vector and the session-level feature vector to obtain an aggressive language prediction result.

[0023] Based on the cyberbullying prediction result, a cyberbullying prediction model loss is determined, based on the aggressive language prediction result, an aggressive language prediction model loss is determined, based on the cyberbullying prediction model loss and the aggressive language prediction model loss, a total loss is calculated, and based on the total loss, each model parameter is updated.

[0024] In some embodiments of the present application, the social feature vector and the session-level feature vector are subjected to aggressive language prediction based on an aggressive language prediction model to obtain an aggressive language prediction result, which includes:

[0025] The social feature vector and the session-level feature vector are input into a second multi-layer perceptron (MLP) layer to obtain an intermediate output result.

[0026] The intermediate output result is input into an aggressive language prediction layer to obtain an aggressive language prediction result.

[0027] In some embodiments of the present application,

[0028] The calculation method of the cyberbullying prediction model loss is:

[0029]

[0030] wherein, L C represents the cyberbullying prediction model loss, represents the cyberbullying prediction model loss corresponding to the social network encoding channel, represents the cyberbullying prediction model loss corresponding to the text encoding channel, i represents the i-th session group in the data set, represents the true label of the i-th session group, represents the prediction probability of the i-th session group of the social network encoding channel, represents the prediction probability of the i-th session group of the text encoding channel, represents the linear layer weight matrix of the cyberbullying prediction corresponding to the social network encoding channel, represents the social feature vector, represents the linear layer bias of the cyberbullying prediction corresponding to the social network encoding channel, represents the linear layer weight matrix of the cyberbullying prediction corresponding to the text encoding channel, represents the session-level feature vector, represents the linear layer bias of the cyberbullying prediction corresponding to the text encoding channel.

[0031] The calculation method of the aggressive language prediction model loss is:

[0032]

[0033]

[0034] wherein, L0 represents the aggressive language prediction model loss, represents the aggressive language prediction model loss corresponding to the social network encoding channel, a loss of an abusive language prediction model corresponding to a text encoding channel, i represents an i-th session group in a data set, j represents a j-th review in the i-th session group, a true label of the j-th review in the i-th session group, a label prediction probability of the j-th review in the i-th session group in a social network encoding channel, a label prediction probability of the j-th review in the i-th session group in a text encoding channel, a linear layer weight matrix of an abusive language prediction corresponding to the social network encoding channel, a social feature vector, a linear layer bias of the abusive language prediction corresponding to the social network encoding channel, a linear layer weight matrix of an abusive language prediction corresponding to the text encoding channel, a session-level feature vector, a linear layer bias of the abusive language prediction corresponding to the text encoding channel.

[0035] In some embodiments of the present application, a calculation formula of the total loss is:

[0036] L = L C + λL O ;

[0037] wherein λ is a weight hyperparameter, L0represents a loss of an abusive language prediction model, L C represents a loss of a cyberbullying prediction model.

[0038] In some embodiments of the present application, the method further comprises:

[0039] obtaining first sample data, and labeling each of the first sample data; the first sample data is session sample data;

[0040] pre-training a network model based on the labeled first sample data to obtain a trained annotation model;

[0041] labeling second sample data that is not labeled based on the annotation model, and generating a training sample set based on the labeled first sample data and second sample data.

[0042] According to another aspect of the present application, a cyberbullying session prediction system is also disclosed, which comprises a processor and a memory, the memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps of the method according to any one of the above embodiments.

[0043] According to still another aspect of the present application, a computer readable storage medium is also disclosed, which stores a computer program, the program being executed by a processor to implement the steps of the method according to any one of the above embodiments.

[0044] The network bullying conversation prediction method, system and storage medium disclosed by the present application firstly extracts comment-level features and conversation-level features of a conversation to be predicted, then constructs a social network graph based on the comment-level feature vectors corresponding to each comment, and extracts social features corresponding to the social network graph; and then predicts whether the conversation is a network bullying conversation based on the social features and the conversation-level features, which considers the role of fine-grained comment-level label information in the network bullying detection task, thereby improving the accuracy of the network bullying conversation prediction result.

[0045] In addition, the model used by the method considers the close relationship between the aggressive language detection task and the bullying detection task in the pre-training stage, so that the method not only improves the accuracy of the network bullying conversation prediction result, but also has good model interpretability. In addition, the present application assigns pseudo labels to comments in unannotated conversations based on a semi-supervised method, and uses a high confidence index to expand the training set of the auxiliary task to better train the multi-task learning framework, which has a positive effect on the bullying detection task and solves the noise problem introduced by the external classifier.

[0046] Additional advantages, objects, and features of the application will be set forth in part by the description that follows, and will become apparent to those skilled in the art upon examination of the following detailed description and drawings in which

[0047] Those skilled in the art will appreciate that the objects and advantages of the application can not be limited to the specifically described above, and the above and other objects of the application can be more clearly understood according to the following detailed description. BRIEF DESCRIPTION OF DRAWINGS

[0048] The drawings described herein are intended to provide further understanding of the present application, form a part of the specification, and do not constitute a limitation of the present application. The components in the drawings are not drawn to scale, but only to show the principles of the present application. In order to facilitate the illustration and description of some parts of the present application, the corresponding parts in the drawings can be enlarged, i.e. become larger than other components in the exemplary device actually manufactured according to the present application. In the drawings:

[0049] Figure 1 Flowchart of the network bullying conversation prediction method according to an embodiment of the present application.

[0050] Figure 2 A schematic diagram of a framework of a cyberbullying prediction system according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the drawings. Here, the schematic embodiments of the present application and the descriptions thereof are used to explain the present application but are not intended to limit the present application.

[0052] Here, it should be noted that, in order to avoid obscuring the present application due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present application are shown in the drawings, and other details not closely related to the present application are omitted.

[0053] It should be emphasized that the terms “comprise / comprises” and “include / includes” when used in this text mean the presence of a feature, element, step, or component but do not exclude the presence or addition of one or more other features, elements, steps, or components.

[0054] The prior art cyberbullying detection method has the shortcoming that the cyberbullying prediction result is not accurate enough. Based on this, the present inventors provide a cyberbullying session prediction method, system, and storage medium. In the research process, the present inventors found that a cyberbullying session usually contains many aggressive comments, and according to these aggressive utterances, it can be easily determined that the session belongs to cyberbullying behavior. Therefore, the cyberbullying session prediction method disclosed in the present application considers the comment-level features and session-level features of the session data when predicting cyberbullying content; and when constructing a social network graph, the social network graph is modeled as a complete graph, and the similarity and mention relationship between comments are considered, so that each comment has a connection relationship; in addition, when training the model, a comment-level aggressive language detection task with fine-grained comment-level categories is introduced based on multi-task learning as an auxiliary task of the cyberbullying detection task, thereby improving the accuracy of the cyberbullying prediction result.

[0055] In the following, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0056] Figure 1 A flowchart of a cyberbullying session prediction method according to an embodiment of the present application is shown in FIG. 2. The cyberbullying session prediction method includes at least steps S10 to S40. Figure 1

[0057] Step S10: Obtain a plurality of comments of session data to be predicted, and input the plurality of comments into a comment-level encoding module to obtain a comment-level feature vector of each comment. ​

[0058] In this step, the comments in the conversation to be predicted are input into the comment-level encoding module to extract the comment-level features of the conversation. The conversation to be predicted can be a social media conversation. For example, a conversation corpus S = {S1, S2, …, S N}, S i represents the i-th conversation group, and N represents the number of conversations; in addition, each conversation group is composed of multiple comments, i.e. where c j is the j-th comment in the conversation S i , and n i represents the number of comments in the conversation S i . At this time, the is embedded to obtain m j represents the number of words contained in the j-th comment.

[0059] Figure 2 is the framework diagram of the corresponding cyberbullying conversation prediction system. As can be seen from Figure 2 , the text encoding module specifically includes a comment-level encoding layer (or referred to as a comment-level encoding module) and a conversation-level encoding layer (or referred to as a conversation-level encoding module). In this step, the comment-level encoding layer in the text encoding module is used to extract features of each comment to obtain comment-level features. For example, the comment-level encoding layer includes a word embedding model, an encoding layer, and a second attention layer.

[0060] In an embodiment, the plurality of comments are input into the comment-level encoding module to obtain a comment-level feature vector of each comment, which can specifically include: inputting the plurality of comments into a word embedding model to obtain a word embedding vector of each comment; inputting each word embedding vector into an encoding layer to obtain a hidden layer representation with context relationship; and inputting the hidden layer representation into a second attention layer to obtain the comment-level feature vector.

[0061] Specifically, the word embedding model can be a Glove model, and the encoding layer can be a BiGRU encoder. At this time, the words in the comment c j are initialized by the pre-trained Glove model, and the result is represented as w j ; then the word-initialized comment vector c j is input into the BiGRU encoder to obtain a hidden layer representation with context relationship where j represents the hidden layer dimension. A second attention layer is further introduced after the BiGRU encoder, and the attention of the model to important words in the review is enhanced by assigning different attention scores to each word and aggregating them into the final review representation. It can be understood that the word embedding model can be other types of word embedding models in addition to the Glove model, and the BiGRU encoder can be replaced by other encoding architectures in natural language processing, such as BiLSTM and Transformer.

[0062] Further, the word context representation is obtained based on the BiGRU encoder, and the representation H j The calculation method is as follows:

[0063]

[0064]

[0065]

[0066] wherein, represents the kth GRU unit representation, represents attention weight coefficient of H j represents the review c j corresponding review-level feature vector.

[0067] Step S20: inputting each review-level feature vector into a session-level encoding module to obtain a session-level feature vector of the review.

[0068] In this step, the review-level feature vector is further extracted by the session-level encoding module to extract the review encoding representation with context relationship.

[0069] Exemplarily, inputting each review-level feature vector into a session-level encoding module to obtain a session-level feature vector of the review comprises: inputting each review-level feature vector into a BiGRU encoder to obtain a session-level feature vector of the review. In this embodiment, the session-level encoding layer of the text encoding module further applies the BiGRU encoder, and arranges the context representation of the review level (review-level feature vector) output by the review-level encoding layer in time sequence as the model input of the session-level encoding layer, so as to extract the feature of the time sequence of the reviews in the same session, thereby obtaining the review encoding representation (session-level feature vector) with context relationship. Similarly, the BiGRU encoder applied here can also be replaced by other encoding architectures in natural language processing, such as BiLSTM and Transformer.

[0070] Furthermore, the session-level text encoding layer calculation process is as follows:

[0071]

[0072]

[0073] Among them, H j 'This represents the context-dependent comment encoding representation obtained at the session-level text encoding layer. Through the above steps S10 and S20, comment encoding representations H that do not have contextual relationships between comments are obtained respectively. j Comment encoding representation H′ with contextual relationships j .

[0074] Step S30: Construct a social network graph based on the comment-level feature vectors, where the nodes of the social network graph represent the comments and the edges of the social network graph represent the similarity or mention relationship between two adjacent comments, and obtain the social feature vectors corresponding to the social network graph based on the graph attention network.

[0075] In this step, a social network graph G is constructed based on the similarity and mention relationships between comments. i ={V i A i E i}, V i The representative node, V, in this network graph i Specifically, it refers to the comment-level feature vector corresponding to the comment, A. i Let E represent the adjacency matrix. i Represents an edge.

[0076] For example, in Figure 2 In the social network module channel shown, an interaction graph between comments is constructed based on mention relationships and similarity, and node representations are obtained using a graph attention network. During the construction of the social network graph, in addition to obtaining the initial edges of the social network based on mention relationships between users, the edges of the social network graph are also expanded based on the similarity between comments. Specifically, constructing the social network graph based on the comment-level feature vectors includes: determining the initial edges of the social network graph based on mention relationships between comments; expanding the initial edges based on the similarity between comments to obtain expanded edges; and constructing the social network graph based on the comment-level feature vectors corresponding to each comment and the expanded edges.

[0077] In the above embodiment, by calculating the feature cosine similarity between different nodes, edges are added to comment nodes with high similarity. The similarity calculation method is as follows: Where H i and H jis the node representation (review-level feature vector) of review i and review j. Further, the corresponding elements of review i and review j in the edge set are Further, based on the calculated similarity between nodes, a new expanded edge set E' is obtained i = E i ∪ e ij , E i is the initial edge, and then the information in the original social network graph is updated based on the new expanded edge set to obtain a new social network graph representation: G' i = {V i ,A i ,E i}.

[0078] After determining the social network graph, further based on the graph attention network, the neighborhood node information is aggregated to learn the review node representation with social network features. The social network aggregation process is as follows:

[0079]

[0080]

[0081] wherein, is the final representation of node i at layer l+1 by connecting the output of each attention head, K represents the number of attention heads, represents the connection representation from x1 to x K , x K represents the representation of the kth attention head, represents a model learnable parameter matrix, represents the representation of node j at layer l, represents the number of reviews, j represents the jth review, is the normalized attention coefficient calculated by the kth layer attention layer.

[0082] Step S40: globally average-pooling each of the social feature vectors to obtain a first feature vector, inputting the session-level feature vector into a first attention layer to obtain a second feature vector, inputting the first feature vector and the second feature vector into a first multi-layer perceptron (MLP) layer to obtain a cyberbullying prediction result.

[0083] In this step, a global average-pooling operation is applied to aggregate all review representations from the social network encoding channel and an attention mechanism is applied to aggregate review representations from the text encoding channel Then, they are input into a multi-layer perceptron (MLP) to predict whether the session is a cyberbullying session.

[0084] In some embodiments of the present application, the cyberbullying session prediction method further comprises the following steps: performing an aggressive language prediction on the social feature vector and the session-level feature vector based on the aggressive language prediction model to obtain an aggressive language prediction result; determining a cyberbullying prediction model loss based on the cyberbullying prediction result, determining an aggressive language prediction model loss based on the aggressive language prediction result, calculating a total loss based on the cyberbullying prediction model loss and the aggressive language prediction model loss, and updating each model parameter based on the total loss.

[0085] Multi-task learning (MTL) can simultaneously learn multiple related tasks and share knowledge in one framework. The correlation between multiple tasks can improve the performance of the model on certain tasks and the generalization ability of the model. Since the cyberbullying detection task is closely related to the aggressive comment detection task in an intuitive sense, in the pre-training process of the model, the aggressive comment detection task closely related to the cyberbullying detection task is introduced as an auxiliary task, and the overall performance of the two tasks is improved through the interaction of the shared layer information of the two tasks in the multi-task framework.

[0086] Reference Figure 2 The bottom shared layer of the model extracts shared session features for aggressive language prediction and cyberbullying prediction, and the session representation is composed of the output of the text encoding module and the social network encoding module. At this time, the session S i The output representation of the text encoding module is H i And the output representation of the social network channel is i The output representation of the text encoding module is H

[0087] For the cyberbullying detection task, the global average pooling operation is applied to aggregate all comment representations from the social network encoding channel And the attention mechanism is applied to aggregate comment representations from the text encoding channel Then, they are input into a multi-layer perceptron (MLP) and the class probability is calculated through an activation function:

[0088]

[0089]

[0090] Further, the cyberbullying detection loss is defined based on the cross-entropy loss:

[0091]

[0092]

[0093]

[0094] Where, LC a network bullying prediction model loss (session-level loss) representing the network bullying prediction model, a network bullying prediction model loss corresponding to the social network encoding channel, a network bullying prediction model loss corresponding to the text encoding channel, i represents an i-th session group in the data set, a true label representing the i-th session group, a predicted probability of the i-th session group representing the social network encoding channel, a predicted probability of the i-th session group representing the text encoding channel, a linear layer weight matrix representing the network bullying prediction corresponding to the social network encoding channel, a social feature vector representing, a linear layer bias representing the network bullying prediction corresponding to the social network encoding channel, a linear layer weight matrix representing the network bullying prediction corresponding to the text encoding channel, a session-level feature vector representing, a linear layer bias representing the network bullying prediction corresponding to the text encoding channel. It can be understood that the network bullying prediction model loss is the sum of the network bullying prediction model loss based on the social feature vector and the network bullying prediction model loss corresponding to the text encoding channel.

[0095] While the aggressive language detection task belongs to the comment-level aggressive language detection task, for this aggressive language detection task, the feature extraction operation is first completed by the bottom shared layer, and all comment representations from the social network encoding channel and and the comment representations from the text encoding channel and Then, the comment representations without the aggregation operation are input into the multi-layer perceptron (MLP), and the class probability is calculated by using the activation function:

[0096]

[0097]

[0098] Further, the comment-level aggressive language detection loss is defined based on the cross-entropy loss:

[0099]

[0100]

[0101]

[0102] wherein, L0 represents the offensive language prediction model loss (review level loss), represents the offensive language prediction model loss corresponding to the social network coding channel, represents the offensive language prediction model loss corresponding to the text coding channel, i represents the ith conversation group in the data set, and j represents the jth review in the ith conversation group, represents the true label of the jth review in the ith conversation group, represents the label prediction probability of the jth review in the ith conversation group in the social network coding channel, represents the label prediction probability of the jth review in the ith conversation group in the text coding channel, represents the linear layer weight matrix of the offensive language prediction corresponding to the social network coding channel, represents the social feature vector, represents the linear layer bias of the offensive language prediction corresponding to the social network coding channel, represents the linear layer weight matrix of the offensive language prediction corresponding to the text coding channel, represents the conversation level feature vector, represents the linear layer bias of the offensive language prediction corresponding to the text coding channel. It can be understood that the offensive language prediction model loss is the sum of the offensive language prediction model loss based on the social feature vector and the offensive language prediction model loss corresponding to the text coding channel.

[0103] Further, the calculation formula of the total loss is: L = L C + λL O ; wherein, λ is a weight hyperparameter, which comprehensively considers the loss objectives of cyberbullying detection and review level offensive language detection, and is obtained by experiments on specific data sets; L0 represents the offensive language prediction model loss; L C represents the cyberbullying prediction model loss.

[0104] In the above embodiment, the present application introduces a review level offensive language detection task with fine-grained review level categories based on multi-task learning, as an auxiliary task of the cyberbullying detection task, to improve the performance of the cyberbullying detection task. The model framework of the cyberbullying prediction system consists of two branches, which are respectively used for the cyberbullying detection task and the review level offensive language detection task, and the two tasks share the text coding channel and the social network learning channel to obtain the feature representation of the review; in the social network channel, the interaction graph between reviews is constructed based on the mention relationship and similarity between reviews, and the node representation is obtained using the graph attention network; finally, the review representation obtained from the review interaction graph and the sequential text representation channel is aggregated to perform the final conversation level classification and review level classification.

[0105] In addition, in order to complete the pre-training of the multi-task learning model, further label information of the annotated comments is required, and the following problems exist: first, relying on manual annotation of data is time-consuming and laborious, and how to automatically annotate comments is challenging; a simple solution is to use an externally trained offensive language detector to annotate comments, but this method can introduce noise of incorrect classification. Therefore, in order to solve the problem of lack of comment level labels, an automatic annotation model based on a semi-supervised learning algorithm is used.

[0106] For example, the cyberbullying conversation prediction method of the present application further comprises the following steps: obtaining first sample data, annotating each of the first sample data; the first sample data is conversation sample data; pre-training a network model based on the annotated first sample data to obtain a trained annotation model; annotating unannotated second sample data based on the annotation model, and generating a training sample set based on the annotated first sample data and second sample data. In this embodiment, an automatic annotation model based on a semi-supervised algorithm is used to expand the labeled comment data set for the training of auxiliary tasks.

[0107] Specifically, before automatically annotating the comments, an external offensive language detector is used to assign corresponding label categories to comments with a confidence greater than a threshold value π, and the threshold value can be determined according to actual training data set experiments; these labeled annotations serve as initialization seeds for the semi-supervised algorithm. Then, these labeled comments are used to train the multi-task framework, and further obtain the initial trained model parameters to annotate the unlabeled comments; then the model is continuously updated and the comments are annotated until the update of the model reaches the maximum number of iterations. The basic idea of this algorithm is to use the multi-task model obtained in the last iteration to automatically label the remaining unlabeled comments, and automatically select high-quality samples from the unlabeled comments, i.e., according to the confidence ranking of the unlabeled set in each iteration, the top-ranked comments are annotated.

[0108] In order to better embody the present application, the modeling method of the cyberbullying prediction model is described in detail below through specific examples:

[0109] The modeling method specifically includes four stages: data set preprocessing and division, model training, model validation, and model testing. The application scenario of this embodiment is mainly various social platforms that can post posts and comments, such as Instagram social platforms and Vine social platforms.

[0110] In the data set preprocessing and division stage, for each group of conversations in Instagram, the sample data set provides comment text content, the time of posting the comment, and the username of each comment; the sample data set contains a total of 2218 media conversations, with an average of 72 comments per conversation; the average number of words per comment is 12. For each video conversation in Vine, the sample data set provides the text content, time, and associated user id of each comment; the sample data set contains a total of 970 media conversations; on average, each conversation group has 81 comments, and each comment has 8 words. Further, the sample data set is divided into training set, validation set and test set in the ratio of 8:1:1, and specific model training and prediction tasks are carried out based on the sample data set. Since each group of conversations in the sample data set has an artificial label of whether it is bullying behavior, this embodiment uses the sample data set to verify the automatic detection experiment of bullying behavior.

[0111] In the model training stage, the word embedding is initialized with a 50-dimensional GloVe model; the BiGRU dimension of the conversation level encoding module is set to 128, and the BiGRU dimension of the comment level encoder is set to 64. In the comment level label automatic annotation stage using an external classifier, the high confidence threshold is set to 0.95, the labels with a model classification confidence greater than or equal to the high confidence threshold are selected by the external classifier to give pseudo labels, and then the multi-task model is initialized and trained. The entire multi-task framework can be implemented through the deep learning framework PyTorch. In the construction of the social network graph stage, the initialization of the social network graph construction is first performed according to the mention relationship between the comments, and then the edge set is expanded based on the similarity; when expanding the edge set, the similarity between all comments in each conversation is first calculated, then the similarity is statistically analyzed, and the edge threshold selection experiment is performed according to the statistical result to select the optimal threshold.

[0112] In the model verification and test stage, the evaluation indicators widely used in cyberbullying detection are selected: accuracy (Accuracy) and F1-macro (F1). For each data set, 80% of the conversations are randomly selected for training, 10% for validation, and 10% for testing. Each experiment is repeated 5 times, and the implementation results in this application scenario are shown in the following table:

[0113]

[0114]

[0115] Correspondingly, the application also provides a cyberbullying session prediction system, which comprises a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps of the method according to any one of the above embodiments.

[0116] Figure 2 The framework of the cyberbullying prediction system according to an embodiment of the application is shown in FIG. 1. Figure 2 As shown in FIG. 1, the whole framework contains two channels: a social network encoder channel and a text encoder channel; the two encoder channels are used as shared encoder layers of a multitask framework. Then the comment representations from the two channels are aggregated to complete the session-level cyberbullying detection task and the comment-level aggressive language detection task. At the bottom of the framework is an automatic comment annotator based on a semi-supervised algorithm, in which, in order to obtain the comment-level labels of the auxiliary task, firstly, an external aggressive language classifier is used to label a subset of comments with high confidence, and then the automatic annotator based on the semi-supervised algorithm in the framework is used to expand the labeled comment dataset for the training of the auxiliary task.

[0117] It can be found from the above embodiments that the cyberbullying session prediction method and system of the application combine the session-level cyberbullying detection task and the comment-level aggressive language detection task, which can better identify cyberbullying sessions. In addition, the automatic comment-level annotator based on semi-supervised learning can gradually generate comment-level labels, thereby solving the time-consuming and labor-consuming problem of obtaining comment-level aggressive labels by manual annotation. Moreover, high-confidence prediction instances are used to expand the training set of the auxiliary task, which has a positive impact on the two tasks in the multitask framework. The prediction model used in the cyberbullying session prediction method of the application classifies aggressive comments during model training, and jointly updates the network parameters of the prediction model based on the aggressive comment classification results and the cyberbullying classification results, so that the trained prediction model can more accurately identify cyberbullying sessions and has good model interpretability.

[0118] In the application, by introducing the comment-level aggressive language detection closely related to cyberbullying detection as an auxiliary task, a multitask framework is constructed to improve the effect of the cyberbullying detection task. Based on the proposed automatic comment annotation method, pseudo labels are assigned to the comments in the unlabeled session group by a semi-supervised method, and high-confidence indicators are used to expand the training set of the auxiliary task, so as to better train the multitask learning framework, which has a positive impact on the cyberbullying detection task and avoids the occurrence of the problem of noise caused by using an external classifier.

[0119] In addition, the application also discloses a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the method according to any one of the above embodiments.

[0120] Those skilled in the art should understand that the exemplary components, systems and methods described in connection with the embodiments disclosed herein can be implemented in hardware, software, or a combination thereof. The decision to implement particular embodiments in hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled persons can use different methods to implement the described functions for each particular application, but such implementation should not be considered beyond the scope of the present application. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine readable medium or transmitted through a data signal carried in a carrier wave in a transmission medium or communication link. The "machine readable medium" can include any medium capable of storing or transmitting information. Examples of machine readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet, an intranet, etc.

[0121] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.

[0122] In the present application, the features described and / or exemplified for one embodiment can be used in the same way or in a similar way in one or more other embodiments, and / or in combination with or instead of features of other embodiments.

[0123] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. The embodiments of the present application can be variously changed and modified by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims

1. A cyberbullying session prediction method, characterized by, The method comprises: obtaining a plurality of comments of conversation data to be predicted, and inputting the plurality of comments into a comment-level encoding module to obtain a comment-level feature vector of each comment; inputting each comment-level feature vector into a conversation-level encoding module to obtain a conversation-level feature vector of the comment; constructing a social network graph based on each comment-level feature vector, wherein a node of the social network graph represents each comment, and an edge of the social network graph represents similarity or a mention relationship between two adjacent comments, and obtaining a social feature vector corresponding to the social network graph based on a graph attention network; performing global average pooling on each social feature vector to obtain a first feature vector, inputting the conversation-level feature vector into a first attention layer to obtain a second feature vector, and inputting the first feature vector and the second feature vector into a first multi-layer perceptron (MLP) layer to obtain a cyberbullying prediction result.

2. The cyberbullying session prediction method of claim 1, wherein, The method comprises: inputting the plurality of comments into a word embedding model to obtain a word embedding vector of each comment; inputting each word embedding vector into an encoding layer to obtain a hidden layer representation with context relationship; inputting the hidden layer representation into a second attention layer to obtain the comment-level feature vector.

3. The cyberbullying session prediction method of claim 1, wherein, The method comprises: inputting each comment-level feature vector into a BiGRU encoder to obtain a conversation-level feature vector of the comment; and / or constructing a social network graph based on each comment-level feature vector, comprising: determining initial edges of the social network graph based on a mention relationship between comments; performing expansion on the initial edges based on similarity between comments to obtain expanded edges; constructing a social network graph based on the expanded edges and the comment-level feature vector corresponding to each comment.

4. The cyberbullying session prediction method of claim 1, wherein, The method further comprises: performing aggressive language prediction on the social feature vector and the conversation-level feature vector based on an aggressive language prediction model to obtain an aggressive language prediction result; determining a cyberbullying prediction model loss based on the cyberbullying prediction result, determining an aggressive language prediction model loss based on the aggressive language prediction result, calculating a total loss based on the cyberbullying prediction model loss and the aggressive language prediction model loss, and updating each model parameter based on the total loss.

5. The cyberbullying session prediction method of claim 4, wherein, The method further comprises: inputting the social feature vector and the conversation-level feature vector into a second multi-layer perceptron (MLP) layer to obtain an intermediate output result; inputting the intermediate output result into an aggressive language prediction layer to obtain an aggressive language prediction result.

6. The cyberbullying conversation prediction method according to claim 4, wherein the cyberbullying prediction model loss is calculated in the following manner: wherein L C represents the network bullying prediction model loss, represents the network bullying prediction model loss corresponding to the social network encoding channel, represents the network bullying prediction model loss corresponding to the text encoding channel, i represents the i-th conversation group in the data set, represents the true label of the i-th conversation group, represents the predicted probability of the i-th conversation group of the social network encoding channel, represents the predicted probability of the i-th conversation group of the text encoding channel, represents the linear layer weight matrix of the network bullying prediction corresponding to the social network encoding channel, represents the social feature vector, represents the linear layer bias of the network bullying prediction corresponding to the social network encoding channel, represents the linear layer weight matrix of the network bullying prediction corresponding to the text encoding channel, represents the conversation-level feature vector, represents the linear layer bias of the network bullying prediction corresponding to the text encoding channel; the aggressive language prediction model loss is calculated in the following manner: wherein L0 represents the offensive language prediction model loss, represents the offensive language prediction model loss corresponding to the social network encoding channel, represents the offensive language prediction model loss corresponding to the text encoding channel, i represents the ith conversation group in the dataset, and j represents the jth review in the ith conversation group, represents the true label of the jth review in the ith conversation group, represents the label prediction probability of the jth review in the ith conversation group in the social network encoding channel, represents the label prediction probability of the jth review in the ith conversation group in the text encoding channel, represents the linear layer weight matrix of the offensive language prediction corresponding to the social network encoding channel, represents the social feature vector, represents the linear layer bias of the offensive language prediction corresponding to the social network encoding channel, represents the linear layer weight matrix of the offensive language prediction corresponding to the text encoding channel, represents the conversation-level feature vector, represents the linear layer bias of the offensive language prediction corresponding to the text encoding channel.

7. The cyberbullying session prediction method of claim 6, wherein, the total loss is calculated in the following formula: L = L C + λL O ; where λ is a weight hyper-parameter, L0represents the loss of the aggressive language prediction model, L C represents the loss of the cyberbullying prediction model.

8. The cyberbullying session prediction method of claim 1, wherein, The method further comprises: obtaining first sample data, and labeling each of the first sample data; the first sample data is conversation sample data; pre-training a network model based on the labeled first sample data to obtain a trained annotation model; labeling unlabeled second sample data based on the annotation model, and generating a training sample set based on the labeled first sample data and the second sample data.

9. A cyberbullying session prediction system, the system comprising a processor and a memory, wherein, The memory stores computer instructions, and the processor is configured to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the system implements the steps of the method in any one of claims 1 to 8.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps of the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Detection method of network attack source organization

    CN104601591A

  • Contextual Audio Recording

    US20150149171A1