Training method and device of graph neural network, equipment and storage medium
By employing a multi-task training method for graph neural networks, multiple neural networks are used to jointly train the rumor detection model, which solves the problems of low accuracy and long training time in single-task training and achieves efficient rumor information identification.
Patent Information
- Application Number
- CN202310158090.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-02-16
AI Technical Summary
Existing single-task training methods result in rumor detection models with low accuracy and long training time.
A multi-task training method for graph neural networks is adopted. The text content of the training event nodes is preprocessed to generate a training text vector set, which is represented by the adjacency matrix. Multiple neural networks are combined to perform trigger point classification, semantic detection and authenticity judgment. Multiple loss functions are used for joint training to obtain a trained graph neural network.
It improves the accuracy of rumor detection models, reduces training time, and achieves efficient identification of rumor information.
Smart Images

Figure CN116205241B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, such as methods, apparatus, devices, and storage media for training graph neural networks. Background Technology
[0002] Currently, text detection technology can be applied to detect rumors. Financial news and / or online shopping with open comments have numerous comments, including genuine user opinions and rumors. Rumor detection can accurately detect whether these comments contain false information. Rumor detection primarily involves collecting all event nodes of rumor event samples and then training the rumor detection model using the text content within these event nodes through a single-task training method. However, rumor detection models trained through single-task training have low accuracy in identifying rumors, and this process requires training on a large amount of text content of the same type, which is time-consuming. Summary of the Invention
[0003] This application provides a training method, apparatus, device, and storage medium for graph neural networks, aiming to solve the problem that the accuracy of rumor detection models trained through single tasks is low in identifying rumors.
[0004] To solve the above problems, this application adopts the following technical solution:
[0005] This article provides training methods for graph neural networks, including:
[0006] Obtain the text content corresponding to each training event node, preprocess all the text content to obtain the training text vector set;
[0007] The training text vector set and adjacency matrix are input into the graph neural network to be trained for representation, and the representation result is obtained.
[0008] The representation results are input into the first neural network to classify trigger points and obtain predicted trigger point labels.
[0009] The representation results are input into a second neural network for semantic detection to obtain predicted semantic labels.
[0010] The representation results are input into a third neural network for authenticity determination to obtain predicted authenticity labels;
[0011] The graph neural network to be trained is obtained by training the graph neural network based on the predicted trigger point label, the predicted semantic label, and the predicted realism label.
[0012] Preferably, the step of training the graph neural network to be trained based on the predicted trigger point label, the predicted semantic label, and the predicted realism label to obtain the trained graph neural network includes:
[0013] The error between the predicted trigger point label and the actual trigger point label is calculated using the first loss function to obtain the value of the first loss function.
[0014] The error between the predicted semantic label and the actual semantic label is calculated using a second loss function to obtain the value of the second loss function.
[0015] The error between the predicted real label and the actual real label is calculated using the third loss function to obtain the value of the third loss function;
[0016] Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value;
[0017] The graph neural network to be trained is trained based on the final loss function value to obtain the trained graph neural network.
[0018] Preferably, training the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network includes:
[0019] Backpropagation is performed based on the final loss function value to update the network parameters of the graph neural network to be trained.
[0020] Determine whether the number of backpropagation propagations exceeds the propagation threshold. If so, stop training and obtain the trained graph neural network.
[0021] Preferably, calculating the final loss function value based on the first loss function value, the second loss function value, and the third loss function value includes:
[0022] The final loss function value is calculated using the following formula:
[0023]
[0024] Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
[0025] Preferably, before inputting the training text vector set and adjacency matrix into the graph neural network to be trained for representation, the method further includes:
[0026] Analyze the connection relationships between each of the training event nodes;
[0027] The adjacency matrix is calculated based on the connection relationships.
[0028] Preferably, after obtaining the trained graph neural network, the process further includes:
[0029] Obtain the text content corresponding to each test event node, preprocess all the text content to obtain a test text vector set;
[0030] The test text vector set and the adjacency matrix are input into the trained graph neural network for representation, and the representation result is obtained.
[0031] The representation results are input into the third neural network for authenticity determination to obtain the predicted authenticity label.
[0032] Preferably, the preprocessing of all the text content to obtain the training text vector set includes:
[0033] Text embedding is performed on each of the aforementioned text contents to obtain a text vector;
[0034] Use all the text vectors as the training text vector set.
[0035] This application also provides a training apparatus for a graph neural network, comprising:
[0036] The first text content preprocessing module is used to obtain the text content corresponding to each training event node, preprocess all the text content, and obtain a training text vector set.
[0037] The first representation module is used to input the training text vector set and the adjacency matrix into the graph neural network to be trained for representation, and obtain the representation result;
[0038] The trigger point classification module is used to input the representation results into the first neural network to classify trigger points and obtain predicted trigger point labels.
[0039] The semantic detection module is used to input the representation results into the second neural network for semantic detection to obtain predicted semantic labels;
[0040] The first authenticity determination module is used to input the representation result into the third neural network for authenticity determination to obtain the predicted authenticity label;
[0041] The graph neural network training module is used to train the graph neural network to be trained based on the predicted trigger point label, the predicted semantic label, and the predicted realism label, so as to obtain the trained graph neural network.
[0042] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the graph neural network training method described in any of the above claims.
[0043] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the training method for the graph neural network described in any of the preceding claims.
[0044] The graph neural network training method of this application first represents the training text vector set obtained from the training event nodes to obtain the representation result. The training event nodes not only contain text content, but also actual trigger point labels and actual semantic labels. The representation result is input into multiple different neural networks to perform trigger point classification, semantic detection, and authenticity judgment respectively, to obtain predicted trigger point labels, predicted semantic labels, and predicted authenticity labels. Using the predicted trigger point labels, predicted semantic labels, and predicted authenticity labels, multi-task joint training is performed to obtain a method that can accurately determine whether each event node contains rumor information. Attached Figure Description
[0045] Figure 1 This is a flowchart illustrating a training method for a graph neural network according to one embodiment.
[0046] Figure 2 This is a schematic diagram of the process of training a graph neural network according to one embodiment;
[0047] Figure 3 This is a schematic diagram illustrating the process of training a graph neural network based on the final loss function value, as shown in one embodiment.
[0048] Figure 4 This is a flowchart illustrating the calculation of the adjacency matrix in one embodiment.
[0049] Figure 5 This is a schematic block diagram of the structure of a training device for a graph neural network according to an embodiment;
[0050] Figure 6 This is a schematic block diagram of the structure of a computer device according to one embodiment.
[0051] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0053] Those skilled in the art will understand that, unless explicitly stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, units, cells, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, units, cells, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless couplings. The term “and / or” as used herein includes all or any of the units and all combinations thereof of one or more associated listed items.
[0054] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0055] Reference Figure 1 This is a flowchart illustrating the training method of the graph neural network proposed in this application. Financial news and / or online shopping with open comments have numerous comments, including genuine user opinions and misinformation. The graph neural network training method can train the graph neural network to be trained. The resulting trained graph neural network is used to detect whether comments on financial news or online shopping contain misinformation. The graph neural network training method includes the following steps S1-S6:
[0056] S1: Obtain the text content corresponding to each training event node, preprocess all the text content to obtain the training text vector set.
[0057] Text embedding is performed on each of the aforementioned text contents to obtain a text vector;
[0058] Use all the text vectors as the training text vector set.
[0059] A training event sample contains multiple training event nodes. Each training event node includes a node number, text information, actual trigger point label, actual semantic label, actual authenticity label, parent node number, and publication time. Training event samples can be used to train rumor event samples or other types of event samples used for training.
[0060] You can use the BERT model to embed text into individual text content, or you can use other models to embed text into individual text content.
[0061] S2: Input the training text vector set and adjacency matrix into the graph neural network to be trained for representation, and obtain the representation result.
[0062] The adjacency matrix reflects the connectivity between all training event nodes over a period of time. The parameters of the graph neural network to be trained are the initial parameters. The graph neural network to be trained represents the training text vector set based on the adjacency matrix, and obtains the representation result. The representation result is one or more matrices.
[0063] The graph neural network to be trained contains one or N representation layers, where N≥2.
[0064] Each representation layer uses a Chebyshev multinomial fitting convolution kernel to represent the training text vector set according to the connection relationship between each training event node in the adjacency matrix, thus obtaining the representation result.
[0065] S3: Input the representation results into the first neural network to classify the trigger points and obtain the predicted trigger point labels.
[0066] The first neural network is a fully connected neural network, which is used to classify trigger points in the representation results.
[0067] S4: Input the representation results into the second neural network for semantic detection to obtain the predicted semantic label.
[0068] The second neural network is a fully connected neural network, while the first neural network is used to perform semantic detection on the representation results.
[0069] Before inputting the representation results into the second neural network, the representation results are pooled. The pooling method can be average pooling or max pooling.
[0070] S5: Input the representation results into the third neural network for authenticity judgment to obtain the predicted authenticity label.
[0071] The third neural network is a fully connected neural network, which is used to determine the authenticity of the representation results.
[0072] S6: Train the graph neural network to be trained based on the predicted trigger point label, predicted semantic label and predicted realism label to obtain the trained graph neural network.
[0073] The error between the predicted trigger point label and the actual trigger point label is calculated using the first loss function to obtain the value of the first loss function.
[0074] The error between the predicted semantic label and the actual semantic label is calculated using a second loss function to obtain the value of the second loss function.
[0075] The error between the predicted real label and the actual real label is calculated using the third loss function to obtain the value of the third loss function;
[0076] Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value;
[0077] The graph neural network to be trained is trained based on the final loss function value to obtain the trained graph neural network.
[0078] The first, second, and third loss functions can use the cross-entropy loss function, the mean squared error loss function, or other loss functions.
[0079] This application takes the cross-entropy loss function as an example. The cross-entropy loss function is used to calculate the distribution error between different labels. Based on the first loss function value, the second loss function value, and the third loss function value, the actual trigger point label, the actual semantic label, and the actual real label in the training event node can be combined to jointly train the graph neural network to be trained.
[0080] The graph neural network training method of this application first represents the training text vector set obtained from the training event nodes to obtain the representation result. The training event nodes not only contain text content, but also actual trigger point labels and actual semantic labels. The representation result is input into multiple different neural networks to perform trigger point classification, semantic detection, and authenticity judgment respectively, to obtain predicted trigger point labels, predicted semantic labels, and predicted authenticity labels. Multi-task joint training is performed using the predicted trigger point labels, predicted semantic labels, and predicted authenticity labels to obtain a method that can accurately determine whether each event node contains rumor information.
[0081] In one embodiment, refer to Figure 2 Step S6, which trains the graph neural network to be trained based on the predicted trigger point label, predicted semantic label, and predicted realism label to obtain the trained graph neural network, includes the following steps S61-S65:
[0082] S61: Calculate the error between the predicted trigger point label and the actual trigger point label using the first loss function to obtain the value of the first loss function.
[0083] The formula for calculating the error between the predicted trigger point label and the actual trigger point label is as follows:
[0084]
[0085] Where CrossEntropy is the cross-entropy loss function, L t Here, T represents the first loss function value, and T is the actual trigger point label. To predict the trigger point label.
[0086] S62: Calculate the error between the predicted semantic label and the actual semantic label using the second loss function to obtain the value of the second loss function.
[0087] The formula for calculating the cross-entropy between the predicted semantic label and the actual semantic label is as follows:
[0088]
[0089] Where CrossEntropy is the cross-entropy loss function, L s The second loss function value is given, and S is the actual semantic label. To predict semantic labels.
[0090] S63: Use the third loss function to calculate the error between the predicted real label and the actual real label, and obtain the value of the third loss function.
[0091] The formula for calculating the cross-entropy between the predicted and actual truth labels is as follows:
[0092]
[0093] Where CrossEntropy is the cross-entropy loss function, L y The third loss function value is given, and y represents the actual accuracy label. To predict the authenticity of labels.
[0094] S64: Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value.
[0095] The formula for calculating the final loss function value is as follows:
[0096]
[0097] Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
[0098] The average value of the first loss function is the average value of the first loss function over a period of time; the average value of the second loss function is the average value of the second loss function over a period of time; and the average value of the third loss function is the average value of the third loss function over a period of time.
[0099] The adjustment parameter can be set to a value of α > 1. Preferably, the adjustment parameter is set to 2.
[0100] S65: Train the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network.
[0101] The final loss function value combines the trigger point label, semantic label, and ground truth label. Compared to using only the loss function value corresponding to the ground truth label to update the network parameters of the graph neural network, it can update the network parameters of the graph neural network faster.
[0102] As described above, training a graph neural network (GNN) based on predicted trigger point labels, predicted semantic labels, and predicted ground truth labels yields a trained GNN. This process involves calculating the error between the predicted trigger point labels and the actual trigger point labels using a first loss function, resulting in a first loss function value. A second loss function is then used to calculate the error between the predicted semantic labels and the actual semantic labels, resulting in a second loss function value. A third loss function is used to calculate the error between the predicted ground truth labels and the actual ground truth labels, resulting in a third loss function value. A final loss function value is then calculated based on the first, second, and third loss function values. Finally, the GNN is trained based on this final loss function value, resulting in a trained GNN. The final loss function value combines the trigger point labels, semantic labels, and ground truth labels. Compared to using only the loss function value corresponding to the ground truth labels to update the network parameters, this method allows for faster updates to the GNN's parameters, leading to the trained GNN.
[0103] In one embodiment, refer to Figure 3 Step S65, which trains the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network, includes the following steps S651-S652:
[0104] S651: Perform backpropagation based on the final loss function value to update the network parameters of the graph neural network to be trained.
[0105] The updated network parameters include the learning rate and weight matrix of the graph neural network to be trained.
[0106] The process of training a graph neural network involves multiple iterations. The greater the difference between the final loss function values calculated in two adjacent iterations, the faster the network parameters of the graph neural network will be updated.
[0107] S652: Determine whether the number of backpropagation propagation attempts is greater than the propagation threshold. If so, stop training and obtain the trained graph neural network.
[0108] Preferably, the propagation number threshold is set to 100.
[0109] When the number of backpropagation propagations exceeds the propagation threshold, it indicates that the graph neural network to be trained has been trained to meet the expected requirements. At this point, training is stopped, and the trained graph neural network is obtained.
[0110] When the number of backpropagation propagations is less than or equal to the propagation number threshold, it indicates that the graph neural network to be trained does not meet the expected requirements. In this case, training continues until the number of backpropagation propagations is greater than the propagation number threshold.
[0111] By setting a threshold for the number of propagations during training, the training of the graph neural network can be guaranteed to be sufficiently trained.
[0112] As described above, training the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network involves backpropagation based on the final loss function value to update the network parameters of the graph neural network to be trained. It is then determined whether the number of backpropagation passes exceeds a propagation threshold; if so, training stops, and the trained graph neural network is obtained. By setting a propagation threshold for the number of propagation passes, the training of the graph neural network to be trained can be ensured to be sufficiently trained.
[0113] In one embodiment, refer to Figure 4 Before step S2, which inputs the training text vector set and adjacency matrix into the graph neural network to be trained for representation, the method further includes calculating the adjacency matrix, comprising the following steps S11'-S12':
[0114] S11': Calculate the connection relationships between each of the training event nodes.
[0115] A training event sample corresponds to a start time and an end time. The start time and end time can determine a time period. A time period includes multiple training event nodes, and there may be connections between multiple training event nodes.
[0116] Specifically, the training event samples are described using an undirected graph. The root event node of the training event samples is the source of the rumor. Edges in the undirected graph represent a forward or comment, and the edges have no direction. Other training event nodes in the undirected graph represent forwarded or commented content. The connections between different training event nodes and between the root event node and other training event nodes in the undirected graph are statistically analyzed.
[0117] S12': The adjacency matrix is calculated based on the connection relationship.
[0118] If there is a connection between different training event nodes or between the root event node and a training event node in an undirected graph, the element corresponding to the adjacency matrix is assigned a value of 1. If there is no connection between different training event nodes or between the root event node and a training event node in an undirected graph, the element corresponding to the adjacency matrix is assigned a value of 0.
[0119] For example, in an undirected graph, there are four training event nodes: one root node, and three training event nodes A, B, and C. The root node is connected to training event node A, A is connected to B, and B is connected to C. The other training event nodes are not connected. The first row of the adjacency matrix represents the connections between the root node and the training event nodes. The first row and first column of the adjacency matrix represent the connection between the root node and node A, both set to 1. The second row represents the connections between node A and other training event nodes. The first row and first column of the adjacency matrix represent the connection between node A and node B, both set to 1. The third row represents the connections between node B and other training event nodes. The first row and first column of the adjacency matrix represent the connection between node B and node C, both set to 1. All other elements of the adjacency matrix are set to 0.
[0120] The adjacency matrix can use the numbers 1 and 0 to represent the connection relationship between training event nodes, and the graph neural network to be trained can represent the training text vector set under the guidance of the adjacency matrix.
[0121] As described above, before inputting the training text vector set and adjacency matrix into the graph neural network to be trained for representation, the method further includes statistically analyzing the connection relationships between each training event node and calculating the adjacency matrix based on these connection relationships. The adjacency matrix can use the numbers 1 and 0 to represent the connection relationships between training event nodes, and the graph neural network to be trained can represent the training text vector set under the guidance of the adjacency matrix.
[0122] Reference Figure 5 This is a schematic block diagram of a graph neural network training device according to this application. The device includes:
[0123] The first text content preprocessing module 10 is used to obtain the text content corresponding to each training event node, preprocess all the text content, and obtain a training text vector set.
[0124] The first representation module 20 is used to input the training text vector set and the adjacency matrix into the graph neural network to be trained for representation, and obtain the representation result;
[0125] The trigger point classification module 30 is used to input the representation result into the first neural network to classify the trigger points and obtain the predicted trigger point labels.
[0126] The semantic detection module 40 is used to input the representation result into the second neural network for semantic detection to obtain the predicted semantic label;
[0127] The first authenticity determination module 50 is used to input the representation result into the third neural network for authenticity determination to obtain the predicted authenticity label;
[0128] The graph neural network training module 60 is used to train the graph neural network to be trained based on the predicted trigger point label, the predicted semantic label and the predicted realism label, so as to obtain the trained graph neural network.
[0129] In one embodiment, the graph neural network training module 60 further includes:
[0130] The first loss function value calculation unit is used to calculate the error between the predicted trigger point label and the actual trigger point label using the first loss function, and obtain the first loss function value.
[0131] The second loss function value calculation unit is used to calculate the error between the predicted semantic label and the actual semantic label using the second loss function, and obtain the second loss function value.
[0132] The third loss function value calculation unit is used to calculate the error between the predicted real label and the actual real label using the third loss function, and obtain the third loss function value.
[0133] The final loss function value calculation unit is used to calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value.
[0134] The training unit for the graph neural network to be trained is used to train the graph neural network to be trained based on the final loss function value, so as to obtain the trained graph neural network.
[0135] In one embodiment, the training unit for the graph neural network to be trained further includes:
[0136] The network parameter update subunit is used to perform backpropagation based on the final loss function value and update the network parameters of the graph neural network to be trained.
[0137] The propagation count judgment subunit is used to determine whether the number of propagations in backpropagation is greater than the propagation count threshold. If so, training is stopped, and the trained graph neural network is obtained.
[0138] In one embodiment, the final loss function value calculation unit further includes:
[0139] The final loss function value calculation subunit is used to calculate the final loss function value according to the following formula:
[0140]
[0141] Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
[0142] In one embodiment, the training apparatus for the graph neural network further includes:
[0143] The connection relationship statistics module is used to count the connection relationships between each of the training event nodes;
[0144] The adjacency matrix calculation module is used to calculate the adjacency matrix based on the connection relationship.
[0145] In one embodiment, the training apparatus for the graph neural network further includes:
[0146] The second text content preprocessing module is used to obtain the text content corresponding to each test event node, preprocess all the text content, and obtain a test text vector set.
[0147] The second representation module is used to input the test text vector set and the adjacency matrix into the trained graph neural network for representation, and obtain the representation result;
[0148] The second authenticity determination module is used to input the representation result into the third neural network for authenticity determination to obtain the predicted authenticity label.
[0149] In one embodiment, the first text content preprocessing module 10 further includes:
[0150] A text embedding unit is used to embed text into each of the text contents to obtain a text vector;
[0151] A training text vector set definition unit is used to define all the text vectors as the training text vector set.
[0152] Reference Figure 6 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 6 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store weighted frequency domain features and weighted spatial domain features, etc. The network interface of the computer device is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a graph neural network training method. The above-mentioned graph neural network training method includes:
[0153] Obtain the text content corresponding to each training event node, preprocess all the text content to obtain the training text vector set;
[0154] The training text vector set and adjacency matrix are input into the graph neural network to be trained for representation, and the representation result is obtained.
[0155] The representation results are input into the first neural network to classify trigger points and obtain predicted trigger point labels.
[0156] The representation results are input into a second neural network for semantic detection to obtain predicted semantic labels.
[0157] The representation results are input into a third neural network for authenticity determination to obtain predicted authenticity labels;
[0158] The graph neural network to be trained is obtained by training the graph neural network based on the predicted trigger point label, the predicted semantic label, and the predicted realism label.
[0159] In one embodiment, training the graph neural network to be trained based on the predicted trigger point label, predicted semantic label, and predicted realism label to obtain a trained graph neural network includes:
[0160] The error between the predicted trigger point label and the actual trigger point label is calculated using the first loss function to obtain the value of the first loss function.
[0161] The error between the predicted semantic label and the actual semantic label is calculated using a second loss function to obtain the value of the second loss function.
[0162] The error between the predicted real label and the actual real label is calculated using the third loss function to obtain the value of the third loss function;
[0163] Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value;
[0164] The graph neural network to be trained is trained based on the final loss function value to obtain the trained graph neural network.
[0165] In one embodiment, training the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network includes:
[0166] Backpropagation is performed based on the final loss function value to update the network parameters of the graph neural network to be trained.
[0167] Determine whether the number of backpropagation propagations exceeds the propagation threshold. If so, stop training and obtain the trained graph neural network.
[0168] In one embodiment, calculating the final loss function value based on the first loss function value, the second loss function value, and the third loss function value includes:
[0169] The final loss function value is calculated using the following formula:
[0170]
[0171] Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
[0172] In one embodiment, before inputting the training text vector set and adjacency matrix into the graph neural network to be trained for representation, the method further includes:
[0173] Analyze the connection relationships between each of the training event nodes;
[0174] The adjacency matrix is calculated based on the connection relationships.
[0175] In one embodiment, after obtaining the trained graph neural network, the method further includes:
[0176] Obtain the text content corresponding to each test event node, preprocess all the text content to obtain a test text vector set;
[0177] The test text vector set and the adjacency matrix are input into the trained graph neural network for representation, and the representation result is obtained.
[0178] The representation results are input into the third neural network for authenticity determination to obtain the predicted authenticity label.
[0179] In one embodiment, the preprocessing of all the text content to obtain a training text vector set includes:
[0180] Text embedding is performed on each of the aforementioned text contents to obtain a text vector;
[0181] Use all the text vectors as the training text vector set.
[0182] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.
[0183] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for training a graph neural network. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0184] The training methods for the above-mentioned graph neural networks include:
[0185] Obtain the text content corresponding to each training event node, preprocess all the text content to obtain the training text vector set;
[0186] The training text vector set and adjacency matrix are input into the graph neural network to be trained for representation, and the representation result is obtained.
[0187] The representation results are input into the first neural network to classify trigger points and obtain predicted trigger point labels.
[0188] The representation results are input into a second neural network for semantic detection to obtain predicted semantic labels.
[0189] The representation results are input into a third neural network for authenticity determination to obtain predicted authenticity labels;
[0190] The graph neural network to be trained is obtained by training the graph neural network based on the predicted trigger point label, the predicted semantic label, and the predicted realism label.
[0191] In one embodiment, training the graph neural network to be trained based on the predicted trigger point label, predicted semantic label, and predicted realism label to obtain a trained graph neural network includes:
[0192] The error between the predicted trigger point label and the actual trigger point label is calculated using the first loss function to obtain the value of the first loss function.
[0193] The error between the predicted semantic label and the actual semantic label is calculated using a second loss function to obtain the value of the second loss function.
[0194] The error between the predicted real label and the actual real label is calculated using the third loss function to obtain the value of the third loss function;
[0195] Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value;
[0196] The graph neural network to be trained is trained based on the final loss function value to obtain the trained graph neural network.
[0197] In one embodiment, training the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network includes:
[0198] Backpropagation is performed based on the final loss function value to update the network parameters of the graph neural network to be trained.
[0199] Determine whether the number of backpropagation propagations exceeds the propagation threshold. If so, stop training and obtain the trained graph neural network.
[0200] In one embodiment, calculating the final loss function value based on the first loss function value, the second loss function value, and the third loss function value includes:
[0201] The final loss function value is calculated using the following formula:
[0202]
[0203] Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
[0204] In one embodiment, before inputting the training text vector set and adjacency matrix into the graph neural network to be trained for representation, the method further includes:
[0205] Analyze the connection relationships between each of the training event nodes;
[0206] The adjacency matrix is calculated based on the connection relationships.
[0207] In one embodiment, after obtaining the trained graph neural network, the method further includes:
[0208] Obtain the text content corresponding to each test event node, preprocess all the text content to obtain a test text vector set;
[0209] The test text vector set and the adjacency matrix are input into the trained graph neural network for representation, and the representation result is obtained.
[0210] The representation results are input into the third neural network for authenticity determination to obtain the predicted authenticity label.
[0211] In one embodiment, the preprocessing of all the text content to obtain a training text vector set includes:
[0212] Text embedding is performed on each of the aforementioned text contents to obtain a text vector;
[0213] Use all the text vectors as the training text vector set.
[0214] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0215] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0216] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A training method for a graph neural network, characterized in that, include: Obtain the text content corresponding to each training event node used for rumor detection. The training event node also includes actual trigger point labels, actual semantic labels, and actual authenticity labels. Preprocess all the text content to obtain a training text vector set. The training text vector set and the adjacency matrix constructed based on the forwarding or commenting relationships between training event nodes are input into the graph neural network to be trained for representation, and the representation result is obtained. The representation results are input into the first neural network to classify trigger points and obtain predicted trigger point labels. The representation results are input into a second neural network for semantic detection to obtain predicted semantic labels. The representation results are input into a third neural network for authenticity determination to obtain predicted authenticity labels; The graph neural network to be trained is trained based on the predicted trigger point label, predicted semantic label, and predicted authenticity label to obtain a trained graph neural network for detecting rumors in financial news or online shopping reviews.
2. The training method for a graph neural network according to claim 1, characterized in that, The step of training the graph neural network to be trained based on the predicted trigger point label, predicted semantic label, and predicted authenticity label to obtain a trained graph neural network for detecting rumors in financial news or online shopping reviews includes: The error between the predicted trigger point label and the actual trigger point label is calculated using the first loss function to obtain the value of the first loss function. The error between the predicted semantic label and the actual semantic label is calculated using a second loss function to obtain the value of the second loss function. The error between the predicted real label and the actual real label is calculated using the third loss function to obtain the value of the third loss function; Calculate the final loss function value based on the first loss function value, the second loss function value, and the third loss function value; The graph neural network to be trained is trained based on the final loss function value to obtain the trained graph neural network.
3. The training method for a graph neural network according to claim 2, characterized in that, The step of training the graph neural network to be trained based on the final loss function value to obtain the trained graph neural network includes: Backpropagation is performed based on the final loss function value to update the network parameters of the graph neural network to be trained. Determine whether the number of backpropagation propagations exceeds the propagation threshold. If so, stop training and obtain the trained graph neural network.
4. The training method for a graph neural network according to claim 2, characterized in that, The step of calculating the final loss function value based on the first loss function value, the second loss function value, and the third loss function value includes: The final loss function value is calculated using the following formula: Among them, L total The final loss function value, The average value of the first loss function. The average value of the second loss function. L is the average value of the third loss function. t Let L be the value of the first loss function. s Let L be the value of the second loss function. y The value of the third loss function is given, and α is the adjustment parameter.
5. The training method for a graph neural network according to claim 1, characterized in that, Before inputting the training text vector set and the adjacency matrix constructed based on the forwarding or commenting relationships between training event nodes into the graph neural network to be trained for representation, the method further includes: Analyze the connection relationships between each of the training event nodes; The adjacency matrix is calculated based on the connection relationships.
6. The training method for a graph neural network according to claim 1, characterized in that, After obtaining the trained graph neural network for detecting rumors in financial news or online shopping reviews, the process further includes: Obtain the text content corresponding to each test event node, preprocess all the text content to obtain a test text vector set; The test text vector set and the adjacency matrix are input into the trained graph neural network for representation, and the representation result is obtained. The representation results are input into the third neural network for authenticity determination to obtain the predicted authenticity label.
7. The training method for a graph neural network according to claim 1, characterized in that, The preprocessing of all the text content to obtain a training text vector set includes: Text embedding is performed on each of the aforementioned text contents to obtain a text vector; Use all the text vectors as the training text vector set.
8. A training device for a graph neural network, characterized in that, include: The first text content preprocessing module is used to obtain the text content corresponding to each training event node for rumor detection. The training event node also includes actual trigger point labels, actual semantic labels and actual authenticity labels. All the text content is preprocessed to obtain a training text vector set. The first representation module is used to input the training text vector set and the adjacency matrix constructed based on the forwarding or commenting relationships between training event nodes into the graph neural network to be trained for representation, and obtain the representation result; The trigger point classification module is used to input the representation results into the first neural network to classify trigger points and obtain predicted trigger point labels. The semantic detection module is used to input the representation results into the second neural network for semantic detection to obtain predicted semantic labels; The first authenticity determination module is used to input the representation result into the third neural network for authenticity determination to obtain the predicted authenticity label; The graph neural network training module is used to train the graph neural network to be trained based on the predicted trigger point label, predicted semantic label and predicted authenticity label, so as to obtain a trained graph neural network for detecting rumors in financial news or online shopping reviews.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the training method for the graph neural network according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the training method for the graph neural network according to any one of claims 1 to 7.
Citation Information
Patent Citations
Man-machine conversation understanding method and system for specific field and relevant equipment
CN108334496A
Neural network model training method, image processing method and device
CN114255361A