A method and device for detecting chat data
By generating user feature vectors and performing model predictions, the problem of low efficiency in identifying chat data anomalies is solved, fast and efficient anomaly detection is achieved, and manual detection costs are reduced.
Patent Information
- Application Number
- CN202010583301.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-06-23
AI Technical Summary
Abnormal identification of chat data in the existing technology is inefficient and costly, and cannot handle bad comments quickly and efficiently.
By obtaining the target user's chat data, a user feature vector is generated and input into the preset chat data detection model for prediction. When the predicted value is greater than or equal to the threshold, it is determined to be abnormal chat data, and graph representation learning and random walks are used. and other methods for feature extraction and model prediction.
It achieves fast and effective detection of chat data, reduces the cost of manual detection, and improves the efficiency of anomaly identification.
Smart Images

Figure CN111861379B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and a device for detecting chat data. Background Art
[0002] With the rapid development of Internet technology, network communication technology has also developed rapidly. Applications with instant messaging functions can bring users a better user experience. However, for the protection of user privacy, it is usually impossible to review the user's chat records, which makes it easy for some bad remarks to appear. Only when a user reports it can the staff of the application management party manually review the chat data involved. In the process of manually reviewing user chat records, the review efficiency is low, and bad remarks cannot be handled quickly and efficiently. Therefore, in the context of the development of network communication technology, a method that can better identify abnormal chat data and optimize the network communication environment is needed. Summary of the invention
[0003] The embodiment of the present invention provides a chat data detection method to solve the problems of low recognition efficiency and high cost when performing abnormality recognition on chat data in the prior art.
[0004] Correspondingly, an embodiment of the present invention further provides a chat data detection device to ensure the implementation and application of the above method.
[0005] In order to solve the above problem, an embodiment of the present invention discloses a method for detecting chat data, including:
[0006] Get the target chat data of the target user;
[0007] Generating a user feature vector for the target user according to the target chat data;
[0008] Inputting the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data;
[0009] When the predicted value is greater than or equal to a preset threshold, the target chat data is determined to be abnormal chat data.
[0010] Optionally, generating a user feature vector for the target user according to the target chat data includes:
[0011] Using the target chat data, generating a first graph network structure, wherein the first graph network structure includes a plurality of nodes;
[0012] Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a first node sequence;
[0013] The first node sequence is input into a preset target relationship representation prediction model to generate a user feature vector for the target user.
[0014] Optionally, the target chat data includes a plurality of chat records of the target user, and the step of using the target chat data to generate a first graph network structure includes:
[0015] Segmenting the chat record to generate a number of words;
[0016] Each of the words is used as a node to establish a first graph network structure for the target user.
[0017] Optionally, the target relationship representation prediction model is generated in the following manner:
[0018] Get historical chat data;
[0019] Using the historical chat data, generating a second graph network structure;
[0020] The target relationship representation prediction model is generated according to the second graph network structure.
[0021] Optionally, the second graph network structure includes a plurality of nodes, and generating the target relationship representation prediction model according to the second graph network structure includes:
[0022] Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a second node sequence;
[0023] Inputting the second node sequence into the initial relationship representation prediction model to generate a first prediction value;
[0024] The first prediction value is compared with a first preset reference value, and the initial relationship representation prediction model is iterated according to the comparison structure to generate the target relationship representation prediction model.
[0025] Optionally, the target chat data detection model is generated in the following manner:
[0026] Generate a training feature vector according to the historical chat data;
[0027] Inputting a preset label sample and the training feature vector into a preset initial chat data detection model to generate a second prediction value;
[0028] The second prediction value is compared with the second reference value, and the initial chat data detection model is iterated according to the comparison result to generate the target chat data detection model.
[0029] The embodiment of the present invention also discloses a chat data detection device, comprising:
[0030] A target chat data acquisition module is used to acquire the target chat data of the target user;
[0031] A user feature vector generating module, used to generate a user feature vector for the target user according to the target chat data;
[0032] A prediction value generation module, used for inputting the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data;
[0033] The chat data detection module is used to determine that the target chat data is abnormal chat data when the predicted value is greater than or equal to a preset threshold.
[0034] Optionally, the user feature vector generation module includes:
[0035] A first network structure generating submodule, configured to generate a first graph network structure using the target chat data, wherein the first graph network structure includes a plurality of nodes;
[0036] A first node sequence obtaining module, configured to perform a random walk on the plurality of nodes according to a preset sequence length to obtain a first node sequence;
[0037] The user feature vector generation submodule is used to input the first node sequence into a preset target relationship representation prediction model to generate a user feature vector for the target user.
[0038] Optionally, the target chat data includes a plurality of chat records of the target user, and the first network structure generating submodule is specifically used for:
[0039] Segmenting the chat record to generate a number of words;
[0040] Each of the words is used as a node to establish a first graph network structure for the target user.
[0041] Optionally, the target relationship representation prediction model is generated by the following modules:
[0042] A historical chat data acquisition module is used to acquire historical chat data;
[0043] A second network structure generating module, configured to generate a second graph network structure using the historical chat data;
[0044] A relationship representation prediction model generation module is used to generate the target relationship representation prediction model according to the second graph network structure.
[0045] Optionally, the second graph network structure includes a plurality of nodes, and the second network structure generating module is specifically used to:
[0046] Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a second node sequence;
[0047] Inputting the second node sequence into the initial relationship representation prediction model to generate a first prediction value;
[0048] The first prediction value is compared with a first preset reference value, and the initial relationship representation prediction model is iterated according to the comparison structure to generate the target relationship representation prediction model.
[0049] Optionally, the target chat data detection model is generated by the following modules:
[0050] A training feature vector generation module, used to generate a training feature vector according to the historical chat data;
[0051] A prediction value generation module, used for inputting a preset label sample and the training feature vector into a preset initial chat data detection model to generate a second prediction value;
[0052] The chat data detection model training module is used to compare the second prediction value with the second reference value, and iterate the initial chat data detection model according to the comparison result to generate the target chat data detection model.
[0053] The embodiment of the present invention further discloses an electronic device, including:
[0054] one or more processors; and
[0055] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the electronic device to perform any of the methods described above.
[0056] The embodiment of the present invention further discloses one or more machine-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described above.
[0057] The embodiments of the present invention include the following advantages:
[0058] In an embodiment of the present invention, after obtaining the corresponding authority, the target chat data of the target user can be obtained, and then a user feature vector for the target user can be generated based on the target chat data, and the user feature vector can be input into a preset target chat data detection model to generate a prediction value for the target chat data. If the prediction value is greater than or equal to a preset threshold, it can be determined that the target chat data of the target user is abnormal chat data. By extracting features from the user's chat data and inputting the extracted feature vector into the data detection model for abnormal probability prediction, the user chat data can be effectively and quickly detected, and the cost of manual detection is greatly reduced through model prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is a flowchart of a method for detecting chat data according to an embodiment of the present invention;
[0060] Figure 2 is a schematic diagram of chat data detection in an embodiment of the present invention;
[0061] Figure 3 It is a structural block diagram of an embodiment of a chat data detection device of the present invention. DETAILED DESCRIPTION
[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] Graph is a basic and commonly used structure. In reality, many scenarios can be abstracted as a graph structure, such as social networks, transportation networks, and the relationship between users and items in e-commerce networks. Graph representation learning belongs to the category of representation learning, and can also be called network embedding, graph embedding, network representation learning, etc.
[0064] Graph representation learning can include two levels of meaning: one is to represent the nodes in the graph as low-dimensional, real-valued, dense vector forms, so that the obtained vector forms can have the ability to represent and reason in the vector space, and such vectors can also be used in specific downstream tasks, such as the node representation obtained by the user social network, that is, the representation vector of each user, and then used for node classification, etc.; the second is to represent the entire graph in a low-dimensional, real-valued, dense vector form, which is used to classify the entire graph structure, etc. Among them, graph representation learning can also include matrix decomposition, DeepWalk, and graph neural network.
[0065] In online social networking, there are many types of risks in chat conversations between users, including message violations, attracting fans, pornography, and spamming, etc. Different risk types have different manual review rules and definitions. However, manual detection is not only inefficient, but also has poor detection effects.
[0066] Therefore, one of the core concepts of the embodiments of the present invention is to perform graph representation learning on the user's chat data based on relational representation learning to obtain a user feature vector for the user, and then predict the probability of flooding the user's chat data through a data detection model based on the user feature vector, so as to quickly and efficiently detect abnormal situations in the user's chat data, reduce the probability of missed detection, and improve the detection effect.
[0067] Specifically, refer to Figure 1 , shows a flowchart of a chat data detection method embodiment of the present invention, which may specifically include the following steps:
[0068] Step 101, obtaining target chat data of a target user;
[0069] As an example, chat data can be generated after a chat conversation between different users on the network. For example, in a life application, it can provide services such as finding a house or a job, and support online communication. The service provider and the service demander can have a chat conversation through the application. In this process, some users engage in behaviors such as attracting fans, engaging in pornography, and spamming chats. Therefore, it is necessary to detect the chat session data in the application in order to regulate the network social environment.
[0070] It should be noted that the chat data of a user can be obtained after obtaining the permission granted by the user, or the chat data related to the target user can be obtained after the relevant user reports the target user.
[0071] Step 102, generating a user feature vector for the target user according to the target chat data;
[0072] In an embodiment of the present invention, the target chat data may be the current chat data of the target user, or chat data of the target user that may be abnormal (e.g., chat data reported by other users). The user feature vector may be a feature vector for the target user obtained after graph representation learning of the target user's chat data.
[0073] In a specific implementation, the target chat data can be used to generate a first graph network structure, which includes multiple nodes. Then, the multiple nodes are randomly walked according to a preset sequence length to obtain a first node sequence. The first node sequence is then input into a preset target relationship representation prediction model to generate a user feature vector for the target user.
[0074] Specifically, the target chat data may include several chat records of the target user, then each chat record may be segmented to obtain several words, and then the first graph network structure for the target user may be established with the words as nodes. Then, the nodes in the first graph network structure may be randomly walked according to the preset sequence length to obtain a first node sequence, where each node is a word, and the node sequence may be a corresponding sentence. Then, the obtained node sequence is input into the relational representation prediction model to generate a user feature vector for the target user. By performing graph representation learning on the user's chat data, the user's feature information may be obtained, which is beneficial for subsequent anomaly detection of the chat data.
[0075] In an optional embodiment of the present invention, the target relationship representation prediction model can be generated in the following manner: obtaining historical chat data, using the historical chat data to generate a second graph network structure, and generating a target relationship representation prediction model based on the second graph network structure.
[0076] In a specific implementation, the historical chat records can be chat data stored in a database that is obtained after user authorization. The target relationship representation prediction model can be trained through the historical chat data. Specifically, each chat record in the historical chat data can be segmented, and a second graph network structure can be established based on the segmented words. Then, according to a preset sequence length, each node in the second graph network structure is randomly walked to obtain a second node sequence. Then, the second node sequence is input into the initial relationship representation prediction model to generate a first prediction value, and the first prediction value is compared with a preset first reference value. According to the comparison result, the initial relationship representation prediction model is reversely trained until the comparison result meets the preset conditions, and the model training is terminated to obtain the target relationship representation prediction model.
[0077] Among them, the gradient descent principle can be used for the training process of the relational representation prediction model. By calculating the loss function during the training process, when the loss function reaches the minimum or meets the set value, the training is considered to be completed.
[0078] In one example, DeepWalk can be used for graph representation learning. The user's chat data is used as sentence corpus, and a word is used to predict surrounding words to form sample pairs for unsupervised training. These samples are then used to train a 2-layer Word2Vec network, and the hidden layer weights are extracted as user feature vector Embeddings. The user feature vector can carry the node similarity information, thereby obtaining a training feature vector.
[0079] Specifically, after obtaining the historical chat data, we perform word segmentation, and then form a graph network structure based on the words after word segmentation. In the graph network structure, we can generate node sequences according to the connection relationship of the nodes, but if we generate sequences arbitrarily, it is easy to destroy the meaning of the sequences, and obtain corpus that cannot be used for subsequent feature prediction. Therefore, we can generate sample pairs in the way of predicting the surrounding words with the center word, and then train the Node2Vec network with the samples, and finally extract the Embedding from the hidden layer weights, which has certain similarity information.
[0080] After the trained target relationship representation prediction model is obtained, the target chat data of the target user can be processed to obtain a graph network structure. Then, a random walk is performed on the nodes in the graph network structure to obtain a node sequence, and the node sequence is input into the target relationship representation prediction model to obtain a user feature vector for the target user. Through graph representation learning, not only can the user's Embedding representation be learned, which is beneficial for subsequent anomaly detection of chat data, but it can also be stored in the user's feature database, enriching the feature dimension and facilitating subsequent model improvement.
[0081] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that under the guidance of the ideas of the embodiments of the present invention, those skilled in the art can make settings according to actual conditions, and the present invention is not limited to this.
[0082] Step 103, inputting the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data;
[0083] In an embodiment of the present invention, after the user feature vector of the target user is learned through graph representation, the user feature vector can be input into the target chat data detection model to perform abnormal prediction on the target chat data of the target user, and then determine whether the target chat data is abnormal data based on the predicted value.
[0084] In an optional embodiment of the present invention, the target chat data detection model can be generated in the following manner: generating a training feature vector based on historical chat data, inputting a preset label sample and the training feature vector into a preset initial chat data detection model to generate a second prediction value, then comparing the second prediction value with the second reference value, and iterating the initial data detection model based on the comparison result to generate a target chat data detection model.
[0085] In a specific implementation, the label samples may be samples corresponding to the chat types of abnormal chat data. For example, labels may include illegal information, pornography, spam, etc. Different labels may correspond to different samples, thereby training the initial chat data detection model through the label samples and the training feature vectors to obtain the target chat data detection model.
[0086] Among them, the gradient descent principle can be used for the training process of the chat data detection model. By calculating the loss function during the training process, when the loss function reaches the minimum or meets the set value, the training is considered to be completed.
[0087] Step 104: when the predicted value is greater than or equal to a preset threshold, it is determined that the target chat data is abnormal chat data.
[0088] In a specific implementation, by inputting the user feature vector into the target chat data detection model, a predicted value of the target chat data for the target user can be obtained. The predicted value can be used to represent the abnormal probability of the target chat data. If the abnormal probability is greater than or equal to the preset threshold, it means that the chat data of the target user is suspected of violating the regulations and can be processed, such as banning or deactivating the account. Therefore, by extracting features from the user's chat data and inputting the extracted feature vector into the data detection model for abnormal probability prediction, the user's chat data can be effectively and quickly detected, and the cost of manual detection can be greatly reduced through model prediction.
[0089] In one example, if Figure 2 As shown, a schematic diagram of chat data detection in an embodiment of the present invention is shown. In the model training process, historical chat relationship data is obtained, and then a graph is established for graph representation learning to obtain user Embeddings. The user Embeddings and label samples are input into a classifier for training, thereby obtaining a trained classifier.
[0090] In the process of chat data detection, after obtaining the user's daily chat relationship data, a graph is established for graph representation learning to obtain the user Embedding, which is input into the classifier for prediction. The probability of flooding the user's chat data is obtained, and then it is determined whether the user's chat data is abnormal data. By extracting features from the user's chat data and inputting the extracted feature vector into the data detection model for abnormal probability prediction, the user's chat data can be detected effectively and quickly, and the cost of manual detection is greatly reduced through model prediction.
[0091] In an embodiment of the present invention, after obtaining the corresponding authority, the target chat data of the target user can be obtained, and then a user feature vector for the target user can be generated based on the target chat data, and the user feature vector can be input into a preset target chat data detection model to generate a prediction value for the target chat data. If the prediction value is greater than or equal to a preset threshold, it can be determined that the target chat data of the target user is abnormal chat data. By extracting features from the user's chat data and inputting the extracted feature vector into the data detection model for abnormal probability prediction, the user chat data can be effectively and quickly detected, and the cost of manual detection is greatly reduced through model prediction.
[0092] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0093] Reference Figure 3 , shows a structural block diagram of an embodiment of a chat data detection device of the present invention, which may specifically include the following modules:
[0094] A target chat data acquisition module 301 is used to acquire target chat data of a target user;
[0095] A user feature vector generating module 302 is used to generate a user feature vector for the target user according to the target chat data;
[0096] A prediction value generation module 303, used to input the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data;
[0097] The chat data detection module 304 is used to determine that the target chat data is abnormal chat data when the predicted value is greater than or equal to a preset threshold.
[0098] In an optional embodiment of the present invention, the user feature vector generation module 302 includes:
[0099] A first network structure generating submodule, configured to generate a first graph network structure using the target chat data, wherein the first graph network structure includes a plurality of nodes;
[0100] A first node sequence obtaining module, configured to perform a random walk on the plurality of nodes according to a preset sequence length to obtain a first node sequence;
[0101] The user feature vector generation submodule is used to input the first node sequence into a preset target relationship representation prediction model to generate a user feature vector for the target user.
[0102] In an optional embodiment of the present invention, the target chat data includes a plurality of chat records of the target user, and the first network structure generating submodule is specifically used for:
[0103] Segmenting the chat record to generate a number of words;
[0104] Each of the words is used as a node to establish a first graph network structure for the target user.
[0105] In an optional embodiment of the present invention, the target relationship representation prediction model is generated by the following modules:
[0106] A historical chat data acquisition module is used to acquire historical chat data;
[0107] A second network structure generating module, configured to generate a second graph network structure using the historical chat data;
[0108] A relationship representation prediction model generation module is used to generate the target relationship representation prediction model according to the second graph network structure.
[0109] In an optional embodiment of the present invention, the second graph network structure includes a plurality of nodes, and the second network structure generating module is specifically used for:
[0110] Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a second node sequence;
[0111] Inputting the second node sequence into the initial relationship representation prediction model to generate a first prediction value;
[0112] The first prediction value is compared with a first preset reference value, and the initial relationship representation prediction model is iterated according to the comparison structure to generate the target relationship representation prediction model.
[0113] In an optional embodiment of the present invention, the target chat data detection model is generated by the following modules:
[0114] A training feature vector generation module, used to generate a training feature vector according to the historical chat data;
[0115] A prediction value generation module, used for inputting a preset label sample and the training feature vector into a preset initial chat data detection model to generate a second prediction value;
[0116] The chat data detection model training module is used to compare the second prediction value with the second reference value, and iterate the initial chat data detection model according to the comparison result to generate the target chat data detection model.
[0117] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0118] An embodiment of the present invention further provides an electronic device, including:
[0119] one or more processors; and
[0120] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to perform the method described in the embodiment of the present invention.
[0121] The embodiment of the present invention further provides one or more machine-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the method described in the embodiment of the present invention.
[0122] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0123] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0124] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0127] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0129] A chat data detection method and a chat data detection device provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for detecting chat data, characterized in that: include: Get the target chat data of the target user; Generating a user feature vector for the target user according to the target chat data; Inputting the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data; When the predicted value is greater than or equal to a preset threshold, the target chat data is determined to be abnormal chat data; The step of generating a user feature vector for the target user according to the target chat data comprises: Using the target chat data, generating a first graph network structure, wherein the first graph network structure includes a plurality of nodes; Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a first node sequence; The first node sequence is input into a preset target relationship representation prediction model to generate a user feature vector for the target user.
2. The method according to claim 1, characterized in that The target chat data includes a plurality of chat records of the target user, and the step of using the target chat data to generate a first graph network structure includes: Segmenting the chat record to generate a number of words; Each of the words is used as a node to establish a first graph network structure for the target user.
3. The method according to claim 1, characterized in that The target relationship representation prediction model is generated in the following way: Get historical chat data; Using the historical chat data, generating a second graph network structure; The target relationship representation prediction model is generated according to the second graph network structure.
4. The method according to claim 3, characterized in that The second graph network structure includes a plurality of nodes, and generating the target relationship representation prediction model according to the second graph network structure includes: Performing a random walk on the plurality of nodes according to a preset sequence length to obtain a second node sequence; Inputting the second node sequence into the initial relationship representation prediction model to generate a first prediction value; The first prediction value is compared with a first preset reference value, and the initial relationship representation prediction model is iterated according to the comparison structure to generate the target relationship representation prediction model.
5. The method according to claim 4, characterized in that The target chat data detection model is generated in the following way: Generate a training feature vector according to the historical chat data; Inputting a preset label sample and the training feature vector into a preset initial chat data detection model to generate a second prediction value; The second prediction value is compared with the second reference value, and the initial chat data detection model is iterated according to the comparison result to generate the target chat data detection model.
6. A chat data detection device, characterized in that: include: A target chat data acquisition module is used to acquire the target chat data of the target user; A user feature vector generating module, used to generate a user feature vector for the target user according to the target chat data; A prediction value generation module, used for inputting the user feature vector into a preset target chat data detection model to generate a prediction value for the target chat data; A chat data detection module, configured to determine that the target chat data is abnormal chat data when the predicted value is greater than or equal to a preset threshold; The user feature vector generation module comprises: A first network structure generating submodule, configured to generate a first graph network structure using the target chat data, wherein the first graph network structure includes a plurality of nodes; A first node sequence obtaining module, configured to perform a random walk on the plurality of nodes according to a preset sequence length to obtain a first node sequence; The user feature vector generation submodule is used to input the first node sequence into a preset target relationship representation prediction model to generate a user feature vector for the target user.
7. An electronic device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the electronic device to perform the method as claimed in any one of claims 1-5.
8. One or more machine-readable media having instructions stored thereon, which when executed by one or more processors cause the processors to perform the method according to any one of claims 1 to 5.
