Message identification method
By training a recognition model based on learning network and neural network, and updating the model parameters using reward parameters, the problem of low accuracy in recognition of violation messages is solved, and more efficient automatic recognition effect is achieved.
Patent Information
- Application Number
- CN202411481493.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, the identification accuracy of violation messages is low, mainly because the refining keywords requires manual participation, resulting in inaccurate identification.
By training a recognition model, the model is trained based on a preset model (including learning network and neural network), and uses reward parameters to update the behavior function value of the learning network and the weight of the neural network. The reward parameters represent the accuracy of the training message being processed, thereby improving the recognition accuracy of the recognition model.
It improves the accuracy of identification of violation messages, reduces manual intervention, and achieves more efficient and automated identification.
Smart Images

Figure CN119520460A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information security technology, and in particular, relates to a message identification method. Background Art
[0002] With the rapid development of the Internet and mobile communication technology, messages are increasingly used as a medium for people to spread information. In the fields of social software, network disk, chat software, 5G messaging, etc., user chat information is massive and unpredictable, which also brings some inevitable problems and risks. For example, some negative and pessimistic news is spread through messages.
[0003] In the exemplary technology, keywords are extracted from the content of previous illegal messages, and whether a message is an illegal message is identified based on the keywords. However, extracting keywords requires manual participation, which is not accurate, resulting in an inability to accurately identify whether a message is an illegal message, and the accuracy of identifying illegal messages is low. Summary of the invention
[0004] The embodiment of the present application provides a message identification method to solve the problem of low accuracy in identifying illegal messages.
[0005] In a first aspect, an embodiment of the present application provides a message identification method, including:
[0006] Get the target message to be sent by the target user;
[0007] According to the target message and the recognition model, an output result of the recognition model is obtained, wherein the recognition model is obtained by training based on a preset model, wherein the preset model includes a learning network and a neural network, wherein the preset model obtains a reward parameter based on the training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message in the training sample;
[0008] Determine whether the target message is an illegal message according to the output result.
[0009] In another embodiment, before obtaining the output result of the recognition model according to the target message and the recognition model, the method further includes:
[0010] Acquire a plurality of training samples, wherein the training samples include training messages;
[0011] Training a preset model according to the training sample, wherein the preset model includes a learning network and a neural network, the preset model obtains a reward parameter based on the training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, and the reward parameter is used to indicate the accuracy of processing the training message;
[0012] In response to the learning network and the neural network satisfying a convergence condition, it is determined that the preset model has completed training, and the preset model that has completed training is determined as a recognition model.
[0013] In another embodiment, the process of obtaining the remuneration parameter is specifically as follows:
[0014] Determining a state parameter according to a first message content of the training message, and determining a target processing behavior of the training message;
[0015] The reward parameter is determined according to the state parameter and the target processing behavior.
[0016] In another embodiment, the step of determining a target processing behavior of the training message comprises:
[0017] Acquire a randomly generated target probability value and a behavior set corresponding to the training message, wherein the behavior set includes a plurality of different processing behaviors for the training message;
[0018] Among the processing behaviors in the behavior set, a processing behavior corresponding to the target probability value is determined as a target processing behavior.
[0019] In another embodiment, the step of determining, among the processing behaviors in the behavior set, a processing behavior corresponding to the target probability value comprises:
[0020] Determine the difference between the upper limit probability value and the target probability value;
[0021] Among the processing behaviors in the behavior set, a processing behavior matching the difference is determined as a target processing behavior.
[0022] In another embodiment, the step of updating the behavior function value of the learning network and the weight of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message, comprises:
[0023] Obtaining an instant reward factor of the learning network, setting a discount factor, and output parameters of the learning network;
[0024] updating the behavior function value of the learning network according to the first reward parameter at the current moment, the instant reward factor, the set discount factor and the output parameter;
[0025] The weights of the neural network are updated according to the updated behavior function value and the output parameter.
[0026] In another embodiment, the step of updating the weights of the neural network according to the updated behavior function value and the output parameter comprises:
[0027] Obtaining a first reward parameter determined by the neural network at a current time and a second reward parameter determined at a previous time;
[0028] Determining an output error parameter of the neural network according to the first reward parameter and the second reward parameter;
[0029] The weights of the neural network are updated according to the output error parameter, the first reward parameter, the updated behavior function value and the output parameter.
[0030] In another embodiment, the reward parameter is a negative value.
[0031] In another embodiment, after the step of determining whether the target message is an illegal message according to the output result, the method further includes:
[0032] Determining a processing strategy for the target message according to the output result;
[0033] The target message is processed according to the processing strategy, where the processing strategy includes at least one of intercepting the message, releasing the message, and verifying the message.
[0034] In another embodiment, the step of obtaining an output result of the recognition model according to the target message and the recognition model includes:
[0035] Acquire the second message content from the target message, and acquire reference parameters of the target user, wherein the reference parameters include the current location and the reputation score of the target user;
[0036] The second message content and the reference parameter are input as input parameters to the recognition model to obtain an output result of the recognition model.
[0037] In a second aspect, an embodiment of the present application provides a message identification device, including:
[0038] A first acquisition module is used to acquire a target message to be sent by a target user;
[0039] a second acquisition module, configured to acquire an output result of the recognition model according to the target message and the recognition model, wherein the recognition model is obtained by training based on a preset model, wherein the preset model includes a learning network and a neural network, wherein the preset model obtains a reward parameter based on the training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message in the training sample;
[0040] A determination module is used to determine whether the target message is an illegal message according to the output result.
[0041] In a third aspect, an embodiment of the present application provides a message identification device, including: a processor and a memory storing computer program instructions;
[0042] When the processor executes the computer program instructions, the message identification method described above is implemented.
[0043] In a fourth aspect, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the message identification method described above is implemented.
[0044] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the message identification method as described above.
[0045] The message identification method provided in the embodiment of the present application obtains the target message to be sent by the target user, obtains the output structure of the identification model based on the target message and the identification model, and determines whether the target message is an illegal message based on the output result. In the present application, the identification model is obtained based on the training of the preset model, and the preset model obtains the reward parameter based on the training sample. The behavior function value of the learning network and the weight of the neural network are updated by the reward parameter, and the reward parameter refers to the accuracy of the training message in the training sample. Therefore, the recognition accuracy of the trained recognition model is high, which improves the recognition accuracy of illegal messages. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0047] Figure 1 It is a schematic diagram of the framework structure that can implement the message identification method provided in the embodiment of the present application;
[0048] Figure 2 It is a flowchart of the first embodiment of the message identification method of the present application;
[0049] Figure 3 It is a flowchart of the second embodiment of the message identification method of the present application;
[0050] Figure 4 It is a flowchart of the third embodiment of the message identification method of the present application;
[0051] Figure 5 It is a flowchart of the fourth embodiment of the message identification method of the present application;
[0052] Figure 6 It is a schematic diagram of the functional modules of the message identification device involved in the present application;
[0053] Figure 7 It is a structural diagram of the message identification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0055] 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 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 device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0056] With the rapid development of the Internet and mobile communication technology, messages are increasingly used as a medium for people to spread information. In the fields of social software, network disk, chat software, 5G messages, etc., user chat information is massive and unpredictable, which also brings some inevitable problems and risks. For example, some negative and pessimistic messages are spread through messages. In the exemplary technology, keywords are extracted from the content of previous illegal messages, and whether the message is an illegal message is identified based on the keywords.
[0057] The inventor of the present application found that keywords can be extracted from the content of previous illegal messages, and whether a message is an illegal message can be identified based on the keywords. However, extracting keywords requires manual participation, which is not accurate, resulting in the inability to accurately identify whether a message is an illegal message, and the accuracy of identifying illegal messages is low.
[0058] The inventor of the present application therefore conceived of training a recognition model, which is trained based on a preset model. The preset model obtains reward parameters based on training samples. The behavior function value of the learning network and the weights of the neural network are updated by the reward parameters. The reward parameters refer to the accuracy with which the training messages in the training samples are processed. Therefore, the recognition model obtained through training has a higher recognition accuracy, thereby improving the recognition accuracy of illegal messages.
[0059] The embodiment of the present application provides a message identification method. The following first illustrates an example framework to which the message identification method provided by the embodiment of the present application can be applied.
[0060] like Figure 1 As shown, the message identification device 100 obtains multiple training samples from the database 200, and the training samples include training messages. The message identification device 100 presets the model based on each training sample. When the learning network and the neural network in the preset model meet the convergence condition, it is determined that the preset model has completed training, and the preset model that has completed training is determined as the recognition model. The recognition model is used to identify whether the target message is an illegal message.
[0061] The following combination Figure 1 , the message identification method provided in the embodiment of the present application is introduced.
[0062] Figure 2 The flowchart of the first embodiment of the message identification method provided by the present application is shown as follows: Figure 2 As shown, the message identification method includes:
[0063] Step S201, obtaining a target message to be sent by a target user.
[0064] In this embodiment, the execution subject is a message identification device. For the sake of convenience, the message identification device is referred to as a device below. The device can be a server or any physical device or virtual device with a message identification function. The device obtains a message to be sent, which is the target message, and the user who sends the message is the target user.
[0065] Step S202, according to the target message and the recognition model, the output result of the recognition model is obtained, the recognition model is trained based on a preset model, the preset model includes a learning network and a neural network, the preset model obtains a reward parameter based on the pre-trained sample, and updates the behavior function value of the learning network and the weight of the neural network based on the reward parameter, and the reward parameter is used to indicate the accuracy of the processing of the training message in the training sample.
[0066] The device is provided with a recognition model, which is trained based on a preset model. The preset model includes a learning network and a neural network. The preset model obtains a reward parameter based on a pre-trained sample, and updates the behavior function value of the learning network and the weight of the neural network based on the reward parameter. The reward parameter is used to indicate the accuracy of processing the training messages in the training samples.
[0067] After obtaining the target message, the device obtains the output result of the recognition model based on the target message and the recognition model.
[0068] In one example, the target message is input into the recognition model to obtain the output result of the recognition model.
[0069] In another example, the message content is obtained from the target message, and the message content is defined as the second message content, and the reference parameters of the target user are obtained, and the reference parameters include the current location and reputation score of the target user. The specific method of determining the reputation score is specifically referred to the above description, and will not be repeated here. The device uses the second message content and the reference parameters as input parameters and inputs them into the recognition model to obtain the output result of the recognition model.
[0070] Step S203: determine whether the target message is an illegal message according to the output result.
[0071] The output result of the recognition model is whether the target message is an illegal message. For example, the output result can be a probability value. If the probability value is greater than a preset threshold, the target message can be determined to be an illegal message; if the probability value is less than or equal to the preset threshold, the target message is determined not to be an illegal message.
[0072] Furthermore, a processing strategy for the target message is determined based on the output result, and the target message is processed according to the processing strategy, wherein the processing strategy includes at least one of intercepting the message, releasing the message, and verifying the message. For example, if the target message is not a violation message, the processing strategy is to release the message; if the target message is a violation message, the message is intercepted and the message verification is performed.
[0073] In this embodiment, a target message to be sent by a target user is obtained, and an output structure of a recognition model is obtained based on the target message and the recognition model, so as to determine whether the target message is an illegal message based on the output result. In this embodiment, the recognition model is obtained by training based on a preset model, and the preset model obtains a reward parameter based on a training sample, and the behavior function value of the learning network and the weight of the neural network are updated by the reward parameter, and the reward parameter refers to the accuracy of processing the training message in the training sample, so the recognition accuracy of the recognition model obtained by training is high, and the recognition accuracy of illegal messages is improved.
[0074] Reference Figure 3 , Figure 3 The flowchart of the second embodiment of the message identification method of the present application is shown. Based on the first embodiment, before step S201, it also includes:
[0075] Step S301: Acquire multiple training samples, where the training samples include training messages.
[0076] In this embodiment, the device obtains multiple training samples from the database, and each training sample includes a training message. The training message refers to a message that has been processed, and processing refers to interception, release, manual review and verification. When the training message is a violation message, the processing of the training message includes interception, manual review and verification. When the training message is not a violation message, the processing of the training message is release. The training sample also includes a label, which is used to indicate whether the training message is a violation message or not.
[0077] Step S302, training the preset model according to the training samples, wherein the preset model includes a learning network and a neural network, the preset model obtains a reward parameter based on the training samples, and updates the behavior function value of the learning network and the weight of the neural network based on the reward parameter, and the reward parameter is used to indicate the accuracy of the training message being processed.
[0078] The device trains the preset model based on each training sample. The preset model includes a learning network and a neural network. The learning network is, for example, a Q learning network. The preset model can obtain a reward parameter based on the training sample, thereby updating the behavior function value of the learning network and the weight of the neural network through the reward parameter. The reward parameter refers to the accuracy of the training message being processed. The specific description of the preset model setting learning network, neural network and reward parameter is as follows:
[0079] The problem of identifying illegal messages is essentially the problem of selecting the best illegal identification action in a world of illegal messages with changing environments. It is a type of random sequential decision-making problem: users make decisions at a series of consecutive time points. At each decision point, illegal identification selects a suitable action from feasible identification actions based on the observed user illegal behavior. After the action is implemented, the system transfers to the next state, and there are corresponding indicators to evaluate the quality of this action, which can be understood as a reward function (reward parameter). At the new decision-making moment, illegal identification observes the new state in which it is located and takes a new round of decisions. It is assumed that the state transition when a user sends an illegal message is only related to the user's last time, but has nothing to do with other users.
[0080] Specifically for the problem of violation identification, the reward function should be more accurately called the cost function, but in order to match the reinforcement learning framework, it is still called the reward. In the specific processing, the calculated reward is negative, so as to ensure a good violation identification effect, or to ensure that the user's violation message can be intercepted every time. It is understandable that the reward parameter obtained by the preset model based on the training sample is a negative value.
[0081] The main network of the preset model is a learning network, and the learning network must select specific actions based on the behavior value function (the action behavior is interception, release, manual review and verification). The first problem is how to better store the behavior value function. In addition, in the identification of illegal messages, the state space is relatively large, and it is not feasible to use a table method to store the behavior value function. Therefore, it is necessary to find a reasonable method to store the behavior value function.
[0082] The second problem is the problem of model generalization. It is impossible for a learning network to learn all the actions and behaviors, but it is necessary to generalize the learning network from the learned experience to the unexperienced violation identification behavior. In other words, it is necessary to find a suitable behavior value function to approximate a problem to be solved. The essence of a learning network is the interaction process with the environment, and a neural network can solve the storage and generalization problems of the behavior value function, that is, a neural network needs to be set in the preset model to solve the problem of storing the behavior function value and generalization.
[0083] A neural network consists of multiple neurons, which are composed of input, weights and closed values, summation units, transfer functions and outputs. The weights W and thresholds B are adjusted based on demand and are also the behavioral characteristics of neurons. The output formula of neurons is: The formula of the transfer function f(x) is:
[0084] In the problem of violation identification, in order for the feedforward neural network to approximate any nonlinear function, a three-layer feedforward neural network is used as an approximator of the state (the state is determined by the message content in the message) to the behavior value function. Let x be the input of the neural network, w be the weight of the neural network, and Y be the output of the neural network. The feedforward neural network relationship is Y = Ψ (x, w). When selecting a three-layer feedforward neural network to approximate the behavior value function in the learning network, it is only necessary to map the action u of the violation to the input X of the neural network, and map the reward parameter Q to the output Y of the neural network, then Q = ψ (s, u, W), and the problem of approximating the behavior value function of the violation message identification problem is successfully transformed into a problem of training the weights of the three-layer feedforward neural network.
[0085] It can be understood that the reward parameter Q can be obtained by inputting the training sample into the neural network, and then the behavior function value of the learning network and the weight of the neural network can be learned through the reward parameter.
[0086] Step S303, in response to the learning network and the neural network satisfying the convergence condition, determining that the preset model has completed training, and determining the preset model that has completed training as the recognition model.
[0087] When the learning network and the neural network meet the convergence condition, it can be determined that the preset model has completed training, and the device determines the preset model that has completed training as the recognition model. The recognition model can be used to identify the target message as an illegal message.
[0088] When the Q value (behavior function value) of the learning network and the weight of the neural network no longer converge, it can be determined that the learning network and the neural network meet the convergence conditions. It should be noted that the learning network in the preset model is based on random decision-making for learning, and the convergence speed of the learning network is slow. In this embodiment, by adding a neural network as a directional supervision of the learning network, the convergence of the learning network can be promoted faster and better, thereby improving the training efficiency of the model. The Q value no longer converges means that the change between the Q value at the previous moment and the Q value at the current moment is less than the first preset change, and the weight no longer converges means that the change between the weight at the previous moment and the weight at the current moment is less than the second preset change.
[0089] In this embodiment, the preset model is trained based on the training samples. The preset model includes a learning network and a neural network. The preset model obtains a reward parameter based on the training samples. The behavior function value of the learning network and the weight of the neural network are updated through the reward parameter. When the learning network and the neural network meet the convergence conditions, it is determined that the preset model has completed the training, and the preset model that has completed the training is determined as the recognition model, so as to identify whether the target message is a violation message through the recognition model. In this embodiment, the recognition model is obtained by updating the learning network and the neural network in the model through the reward parameter, and the reward parameter refers to the accuracy of the training message in the training sample. Therefore, a recognition model with a high recognition accuracy can be trained, thereby improving the recognition accuracy of violation messages.
[0090] Reference Figure 4 , Figure 4 The flowchart of the third embodiment of the message identification method of the present application is shown. Based on the second embodiment, step S302 includes:
[0091] Step S401, determining a state parameter according to a first message content of a training message, and determining a target processing behavior of the training message.
[0092] In this embodiment, the training message includes message content, and the message content is defined as the first message content. The first message content is the body of the training message, and the body includes but is not limited to information such as text and pictures.
[0093] The device determines the state parameter based on the first message content. In one example, the device determines the first message content as the state parameter. In another example, the device obtains a target parameter, and uses the target parameter and the first message content as the state parameter, wherein the target parameter includes at least one of the violation ratio of messages previously sent by the user of the training message, the user's location, and the user's reputation score, wherein the reputation score refers to the score obtained by converting the violation ratio, and the higher the violation ratio, the lower the reputation score.
[0094] The device determines the target processing behavior of the training message. The processing behavior includes but is not limited to interception, release, manual review and verification.
[0095] In one example, the target processing behavior may be the final processing method of the training message. For example, if the training message is not a violation message, the target processing behavior is release; if the training message is a violation message, the target processing behavior is at least one of interception, release, and verification.
[0096] In another example, the target processing behavior can be determined by an exploration strategy. The exploration strategy is based on the greedy strategy with some improvements. The best action behavior for the message is selected in the form of probability distribution, that is, the selection of the target processing behavior is randomly selected, but this randomness has a probability value, and the probability value is ε, which ensures that all state spaces have been visited. This process is also called a random exploration process. In this regard, the device obtains a randomly generated target probability value and a behavior set corresponding to the training message. The behavior set includes multiple different processing behaviors for the training message. For example, the behavior set includes processing behaviors such as release, interception, manual review, and verification. The device determines the processing behavior that matches the target probability value in the behavior set as the target processing behavior. Exemplarily, each processing behavior has a corresponding preset probability value, and the difference between the target probability value and the preset probability value of each processing behavior is calculated, and the processing behavior corresponding to the smallest difference is determined as the target processing behavior. The preset probability value can be manually preset.
[0097] In another example, after determining the target probability value, the device determines the difference between the upper limit probability value and the target probability value, and determines the processing behavior that matches the difference as the target processing behavior among the processing behaviors in the behavior set. Exemplarily, the second difference between the first difference (the difference between the upper limit probability value and the target probability value) and each preset probability value is determined, and the processing behavior corresponding to the smallest second difference is determined as the target processing behavior. The upper limit probability value is, for example, 1, that is, the probability of selecting 1-ε is selected to select the processing behavior that maximizes the current reward function, so as to make the best use of environmental information.
[0098] Step S402: determining reward parameters according to the state parameters and the target processing behavior.
[0099] After obtaining the target processing behavior, the device determines the reward parameters based on the state parameters and the target processing behavior, that is, the neural network determines the reward parameters based on the target processing behavior and the state parameters.
[0100] In this embodiment, the device determines the state parameters based on the message content of the training message, and determines the target processing behavior of the training message, thereby accurately determining the reward parameters based on the state parameters and the target processing behavior.
[0101] Reference Figure 5 , Figure 5 A schematic diagram showing a flow chart of a fourth embodiment of the message identification method provided by the present application is shown. Figure 3 or Figure 4 In the illustrated embodiment, step S202 includes:
[0102] Step S501, obtaining the instant reward factor of the learning network, setting the discount factor and the output parameters of the learning network.
[0103] Step S502, updating the behavior function value of the learning network according to the first reward parameter, the instant reward factor, the set discount factor and the output parameter at the current moment.
[0104] In this embodiment, the device obtains the immediate reward factor of the learning network, sets the discount factor and the output parameters of the learning network, and updates the behavior function value of the learning network based on the first reward parameter at the current moment, the immediate reward factor, the set discount factor and the output parameter.
[0105] For example, for state-behavior (s t ,u), output through the neural network (s t ,u), and the output parameter of the learning network is r t+1 +γmax Q(s t+1 ,u t ), r t+1 is the immediate reward, γ is the discount factor (0, 1), Q(s t ,u t ) is the first reward parameter at the current time t, and the behavior function value of the learning network is updated as shown in the formula:
[0106] Step S503: updating the weights of the neural network according to the updated behavior function value and output parameters.
[0107] After updating the behavior function value, the device updates the weight of the neural network based on the behavior function value and the output parameter. Exemplarily, the updated weight is:
[0108]
[0109] From the above, we can see that the combination of the learning network iterative update behavior function value method and the neural network generalization of the value function to the entire state control is: the learning network value update provides the training data of the neural network, that is, the previous state-behavior is updated to the current state-behavior (s t ,u t ),Q t+1 ) as training data to adjust the weights of the neural network, where Q t+1 To learn the ideal output parameters of the network.
[0110] Furthermore, when updating the weights of the neural network, the weights of the output layer and the input layer of the neural network will also be updated. Exemplarily, the device obtains the first reward parameter determined by the neural network at the current time and the second reward parameter determined at the previous time, and determines the output error parameter of the neural network based on the first reward parameter and the second reward parameter, thereby updating the weights of the neural network through the output error parameter, the first reward parameter, the updated behavior function value and the output parameter. Specifically, the output error parameter at time t is Then the weight update formula of the output layer is:
[0111]
[0112] The weight update formula of the input layer is:
[0113]
[0114] It can be understood that, in one example, the weights of the output layer and the input layer of the neural network are updated by the above two formulas, while other layers in the neural network are updated by the behavior function values and the output parameters.
[0115] In this embodiment, the instant reward factor, set discount factor and output parameters of the learning network are obtained, and the behavior function value of the learning network is updated based on the first reward parameter, the instant reward factor, the set discount factor and the output parameters at the current moment, thereby updating the weights of the neural network based on the updated behavior function value and output parameters.
[0116] like Figure 6 As shown, the embodiment of the present application further provides a message identification device 600, and the message identification device 600 includes:
[0117] A first acquisition module 610 is used to acquire a target message to be sent by a target user;
[0118] A second acquisition module 620 is used to acquire an output result of the recognition model according to the target message and the recognition model, wherein the recognition model is obtained by training based on a preset model, wherein the preset model includes a learning network and a neural network, wherein the preset model obtains a reward parameter based on a pre-training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message in the training sample;
[0119] The determination module 630 is used to determine whether the target message is an illegal message according to the output result.
[0120] In one embodiment, the message identification device 600 is specifically used for:
[0121] Acquire multiple training samples, where the training samples include training messages;
[0122] Training a preset model according to the training samples, wherein the preset model includes a learning network and a neural network, the preset model obtains a reward parameter based on the training samples, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, and the reward parameter is used to indicate the accuracy of processing the training message;
[0123] In response to the learning network and the neural network satisfying the convergence condition, it is determined that the preset model has completed training, and the preset model that has completed training is determined as the recognition model.
[0124] In another embodiment, the message identification device 600 is specifically used for:
[0125] Determine the state parameter according to the first message content of the training message, and determine the target processing behavior of the training message;
[0126] Determine the reward parameters based on the state parameters and the target processing behavior.
[0127] In another embodiment, the message identification device 600 is specifically used for:
[0128] Obtaining a randomly generated target probability value and a behavior set corresponding to the training message, the behavior set including a plurality of different processing behaviors for the training message;
[0129] Among the processing behaviors in the behavior set, a processing behavior corresponding to the target probability value is determined as the target processing behavior.
[0130] In another embodiment, the message identification device 600 is specifically used for:
[0131] Determine the difference between the upper limit probability value and the target probability value;
[0132] Among the processing behaviors in the behavior set, a processing behavior matching the difference is determined as the target processing behavior.
[0133] In another embodiment, the message identification device 600 is specifically used for:
[0134] Obtain the immediate reward factor of the learning network, set the discount factor and the output parameters of the learning network;
[0135] Update the behavior function value of the learning network according to the first reward parameter, the immediate reward factor, the set discount factor and the output parameter at the current moment;
[0136] Update the weights of the neural network according to the updated behavior function value and output parameters.
[0137] In another embodiment, the message identification device 600 is specifically used for:
[0138] Obtaining a first reward parameter determined by the neural network at the current time and a second reward parameter determined at the previous time;
[0139] Determine an output error parameter of the neural network according to the first reward parameter and the second reward parameter;
[0140] The weights of the neural network are updated according to the output error parameter, the first reward parameter, the updated behavior function value and the output parameter.
[0141] In another embodiment, the reward parameter is a negative value.
[0142] In another embodiment, the message identification device 600 is specifically used for:
[0143] Determine the processing strategy of the target message according to the output result;
[0144] The target message is processed according to a processing strategy, where the processing strategy includes at least one of intercepting the message, releasing the message, and verifying the message.
[0145] In another embodiment, the message identification device 600 is specifically used for:
[0146] Acquire the second message content from the target message, and acquire reference parameters of the target user, the reference parameters including the current location and reputation score of the target user;
[0147] The second message content and the reference parameter are input as input parameters to the recognition model to obtain the output result of the recognition model.
[0148] Figure 7 A schematic diagram of the hardware structure of a message identification device provided in an embodiment of the present application is shown.
[0149] The message identification device may include a processor 701 and a memory 702 storing computer program instructions.
[0150] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0151] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0152] In certain embodiments, the memory 702 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0153] The processor 701 implements any one of the message identification methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0154] In one example, the message identification device may further include a communication interface 703 and a bus 710. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 710 and communicate with each other.
[0155] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0156] Bus 710 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 710 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0157] In addition, in combination with the operation of the terminal device and the message identification method in the above embodiments, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the message identification methods in the above embodiments is implemented.
[0158] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the message identification methods in the above embodiments when the computer program is processed and executed.
[0159] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0160] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0161] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0162] Aspects of the present disclosure are described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box 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, or other programmable terminal device operating device to produce a machine so that these instructions executed by the processor of the computer or other programmable terminal device operating device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0163] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A message identification method, characterized in that: include: Get the target message to be sent by the target user; According to the target message and the recognition model, an output result of the recognition model is obtained, wherein the recognition model is obtained by training based on a preset model, wherein the preset model includes a learning network and a neural network, wherein the preset model obtains a reward parameter based on the training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message in the training sample; Determine whether the target message is an illegal message according to the output result.
2. The message identification method according to claim 1, characterized in that: Before obtaining the output result of the recognition model according to the target message and the recognition model, the method further includes: Acquire a plurality of training samples, wherein the training samples include training messages; Training a preset model according to the training sample, wherein the preset model includes a learning network and a neural network, the preset model obtains a reward parameter based on the training sample, and updates a behavior function value of the learning network and a weight value of the neural network based on the reward parameter, and the reward parameter is used to indicate the accuracy of processing the training message; In response to the learning network and the neural network satisfying a convergence condition, it is determined that the preset model has completed training, and the preset model that has completed training is determined as a recognition model.
3. The message identification method according to claim 2, characterized in that: The specific process of obtaining the remuneration parameters is as follows: Determining a state parameter according to a first message content of the training message, and determining a target processing behavior of the training message; The reward parameter is determined according to the state parameter and the target processing behavior.
4. The message identification method according to claim 3, characterized in that: The step of determining the target processing behavior of the training message comprises: Acquire a randomly generated target probability value and a behavior set corresponding to the training message, wherein the behavior set includes a plurality of different processing behaviors for the training message; Among the processing behaviors in the behavior set, a processing behavior corresponding to the target probability value is determined as a target processing behavior.
5. The message identification method according to claim 4, characterized in that: The step of determining, among the processing behaviors in the behavior set, a processing behavior corresponding to the target probability value comprises: Determine the difference between the upper limit probability value and the target probability value; Among the processing behaviors in the behavior set, a processing behavior matching the difference is determined as a target processing behavior.
6. The message identification method according to claim 2, characterized in that: The step of updating the behavior function value of the learning network and the weight of the neural network based on the reward parameter, wherein the reward parameter is used to indicate the accuracy of processing the training message comprises: Obtaining an instant reward factor of the learning network, setting a discount factor, and output parameters of the learning network; updating the behavior function value of the learning network according to the first reward parameter at the current moment, the instant reward factor, the set discount factor and the output parameter; The weights of the neural network are updated according to the updated behavior function value and the output parameter.
7. The message identification method according to claim 6, characterized in that: The step of updating the weights of the neural network according to the updated behavior function value and the output parameter comprises: Obtaining a first reward parameter determined by the neural network at a current time and a second reward parameter determined at a previous time; Determining an output error parameter of the neural network according to the first reward parameter and the second reward parameter; The weights of the neural network are updated according to the output error parameter, the first reward parameter, the updated behavior function value and the output parameter.
8. The message identification method according to claim 2, characterized in that: The reward parameter is a negative value.
9. The message identification method according to any one of claims 1 to 8, characterized in that: After the step of determining whether the target message is an illegal message according to the output result, the method further includes: Determining a processing strategy for the target message according to the output result; The target message is processed according to the processing strategy, where the processing strategy includes at least one of intercepting the message, releasing the message, and verifying the message.
10. The message identification method according to any one of claims 1 to 8, characterized in that: The step of obtaining the output result of the recognition model according to the target message and the recognition model comprises: Acquire the second message content from the target message, and acquire reference parameters of the target user, wherein the reference parameters include the current location and the reputation score of the target user; The second message content and the reference parameter are input as input parameters to the recognition model to obtain an output result of the recognition model.
Citation Information
Patent Citations
Information identification method and device, computer system and readable storage medium
CN113779240A
Method, device and equipment for identifying illegal content in communication text and storage medium
CN115422889A
Junk mail beforehand analysis system based on big data model learning
CN117610547A