Search

CN-116304733-B - Method, device, equipment and storage medium for processing user behavior sequence

CN116304733BCN 116304733 BCN116304733 BCN 116304733BCN-116304733-B

Abstract

The application discloses a method, a device, equipment and a storage medium for processing a user behavior sequence. The method comprises the steps of obtaining a first training sample set, wherein the first training sample set comprises a positive sample pair and a negative sample pair of a comparison learning task generated according to a behavior sequence data set, performing first training on a neural network model by using the first training sample set to obtain an initial similarity analysis model, the first training comprises performing first training on the neural network model according to the positive sample pair and the negative sample pair of the comparison learning task to obtain the initial similarity analysis model, performing second training on the initial similarity analysis model by using a second training sample set to obtain the similarity analysis model, the second training sample set comprises training samples and training labels, and the similarity analysis model is used for determining whether different user behavior sequences are similar. The method has the advantages of high calculation efficiency, high accuracy of the obtained user behavior sequence similarity calculation result and low labor cost.

Inventors

  • ZHAO SHIWEI
  • HU ZHIPENG
  • XIA MINGXUAN
  • WU RUNZE
  • YAN HAN
  • QI JIAHENG
  • SHEN XUDONG
  • LI LE
  • Lv Tangjie
  • FAN CHANGJIE

Assignees

  • 网易(杭州)网络有限公司

Dates

Publication Date
20260508
Application Date
20230220

Claims (15)

  1. 1. A method of processing a sequence of user actions, the method comprising: The method comprises the steps of obtaining a first training sample set, wherein the first training sample set comprises positive sample pairs and negative sample pairs of a comparison learning task generated according to a behavior sequence data set, the behavior sequence data set comprises a plurality of user behavior sequences, performing first training on a neural network model by using the first training sample set to obtain an initial similarity analysis model, and performing the first training on the neural network model according to the positive sample pairs and the negative sample pairs of the comparison learning task to obtain the initial similarity analysis model; The first training process further comprises optimizing parameters of the neural network model through time sequence comparison loss and instance comparison loss, wherein the time sequence comparison loss is determined according to positive sample pairs formed by behavior data with the same moment in an enhancement sequence corresponding to the same user behavior sequence and negative sample pairs formed by behavior data with different moments in the enhancement sequence corresponding to the same user behavior sequence, the instance comparison loss is determined according to positive sample pairs formed by behavior data with the same moment in the enhancement sequence corresponding to the same user behavior sequence and negative sample pairs formed by behavior data with the same moment in enhancement sequences corresponding to different user behavior sequences, a second training process is performed on the initial similarity analysis model through a second training sample set to obtain a similarity analysis model, the second training process is a supervised training process used for fine-tuning parameters of the initial similarity analysis model, the second training sample set comprises training samples and training labels, the training samples comprise any two user behavior sequences in the partial user behavior sequences in the multiple user behavior sequences, the training labels represent whether any two user behavior sequences in the partial user behavior sequences are used for determining whether the similarity analysis models are different in similarity.
  2. 2. The method of claim 1, wherein each of the plurality of user behavior sequences comprises a plurality of behavior data corresponding to each user at a plurality of times, each of the plurality of user behavior sequences comprises at least two enhancement sequences corresponding to each user behavior sequence, and the at least two enhancement sequences corresponding to each user behavior sequence are sequences obtained by performing at least two different data enhancement processes on each user behavior sequence, Wherein the acquiring a first training sample set includes: Aiming at a comparison learning task among the same user behavior sequences, forming positive sample pairs of the comparison learning task by behavior data with the same moment in at least two enhancement sequences corresponding to the same user behavior sequence, and forming negative sample pairs of a first type by behavior data with different moments in at least two enhancement sequences corresponding to the same user behavior sequence, wherein the same user behavior sequence is any one user behavior sequence in the plurality of user behavior sequences, and the negative sample pairs of the comparison learning task comprise the negative sample pairs of the first type; Aiming at a comparison learning task among different user behavior sequences, forming a second type negative sample pair by using behavior data with the same moment in any one of at least two enhancement sequences corresponding to a first user behavior sequence and any one of at least two enhancement sequences corresponding to a second user behavior sequence, wherein the plurality of user behavior sequences comprise the first user behavior sequence and the second user behavior sequence, and the negative sample pair of the comparison learning task further comprises the second type negative sample pair.
  3. 3. The method of claim 2, wherein prior to the acquiring the first training sample set, the method further comprises: and executing the at least two different data enhancement processes on each behavior sequence included in the plurality of user behavior sequences to obtain at least two enhancement sequences corresponding to each behavior sequence.
  4. 4. A method according to any one of claims 1 to 3, wherein performing a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model comprises: Processing the positive sample pair and the negative sample pair of the comparison learning task by using the neural network model to obtain the feature vector of the positive sample pair and the feature vector of the negative sample pair of the comparison learning task; Determining the contrast loss of the contrast learning task according to the characteristic vector of the positive sample pair and the characteristic vector of the negative sample pair of the contrast learning task; adjusting parameters of the neural network model according to the contrast loss; and stopping adjusting parameters of the neural network model when training reaches a first preset training condition, and obtaining the initial similarity analysis model.
  5. 5. The method of claim 4, wherein the determining the contrast loss for the contrast learning task based on the eigenvectors of the positive pair of samples and the eigenvectors of the negative pair of samples of the contrast learning task comprises: determining a time sequence comparison loss according to the characteristic vector of the positive sample pair of the comparison learning task and the characteristic vector of the negative sample pair of the first type, wherein the negative sample pair of the first type is obtained according to the method that aiming at the comparison learning task among the same user behavior sequences, behavior data with different moments in at least two enhancement sequences corresponding to the same user behavior sequence form the negative sample pair of the first type, and the same user behavior sequence is any one of the user behavior sequences; Determining instance comparison loss according to the feature vectors of the positive sample pair of the comparison learning task and the negative sample pair of the second type, wherein the negative sample pair of the second type is obtained according to the method that for the comparison learning task among different user behavior sequences, behavior data with the same moment in any one of at least two enhancement sequences corresponding to a first user behavior sequence and any one of at least two enhancement sequences corresponding to a second user behavior sequence form the negative sample pair of the second type, and the plurality of user behavior sequences comprise the first user behavior sequence and the second user behavior sequence; determining a contrast loss of the contrast learning from the timing contrast loss and the example contrast loss.
  6. 6. The method of any one of claims 1-3 or 5, wherein performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model comprises: processing the training sample by using the initial similarity analysis model to obtain two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training sample; Determining a behavior sequence similarity result according to two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training sample, wherein the behavior sequence similarity result represents whether any two user behavior sequences in the partial user behavior sequences included in the training sample are similar or not; According to the difference between the training label and the behavior sequence similarity result, adjusting parameters of the initial similarity analysis model; And stopping adjusting the parameters of the initial similarity analysis model when the training reaches a second preset training condition, and obtaining the similarity analysis model.
  7. 7. The method of claim 6, wherein any one of the first preset training conditions and the second preset training conditions may include at least one of the following conditions: The training times of the models associated with any one preset training condition meet the preset training times, the training time of the models associated with any one preset training condition meet the preset training time, or the loss result of the models associated with any one preset training is smaller than a preset loss threshold value.
  8. 8. The method of any one of claims 1-3, 5 or 7, wherein prior to said performing a second training on said initial similarity analysis model with a second training sample set to obtain a similarity analysis model, the method further comprises: selecting the partial user behavior sequence from the behavior sequence data set; calculating the similarity between any two user behavior sequences in the partial user behavior sequences according to a similarity calculation formula to obtain similarity labels between any two user behavior sequences in the partial user behavior sequences, wherein the similarity labels represent similarity or dissimilarity between any two user behavior sequences in the partial user behavior sequences; And determining any two user behavior sequences in the partial user behavior sequences as the training samples, and determining similarity labels between any two user behavior sequences in the partial user behavior sequences as the training labels, so as to obtain the second training sample set.
  9. 9. The method according to any one of claims 1-3, 5 or 7, wherein the method is applied in the field of games, Each user behavior sequence in the plurality of user behavior sequences specifically comprises a plurality of behavior data corresponding to a plurality of moments generated by each user in the game playing process, and the moments are in one-to-one correspondence with the plurality of behavior data.
  10. 10. A method of processing a sequence of user actions, the method comprising: Acquiring a first user behavior sequence and a second user behavior sequence; Processing the first user behavior sequence and the second user behavior sequence by using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result represents similarity or dissimilarity between the first user behavior sequence and the second user behavior sequence; wherein the similarity analysis model is obtained by the method of any one of claims 1-3, 5 or 7.
  11. 11. A training device, the device comprising: The acquisition unit is used for acquiring a first training sample set, wherein the first training sample set comprises a positive sample pair and a negative sample pair of a contrast learning task generated according to a behavior sequence data set, and the behavior sequence data set comprises a plurality of user behavior sequences; The first training unit is used for performing first training on a neural network model by using the first training sample set to obtain an initial similarity analysis model, wherein the first training process comprises the steps of performing first training on the neural network model according to positive sample pairs and negative sample pairs of the comparison learning task to obtain the initial similarity analysis model, optimizing parameters of the neural network model through time sequence comparison loss and instance comparison loss, determining the time sequence comparison loss according to positive sample pairs formed by behavior data with the same moment in an enhancement sequence corresponding to the same user behavior sequence and negative sample pairs formed by behavior data with different moments in the enhancement sequence corresponding to the same user behavior sequence, and determining the instance comparison loss according to positive sample pairs formed by behavior data with the same moment in the enhancement sequence corresponding to the same user behavior sequence and negative sample pairs formed by behavior data with the same moment in an enhancement sequence corresponding to different user behavior sequences; The second training unit is used for executing second training on the initial similarity analysis model by using a second training sample set to obtain a similarity analysis model, wherein the second training process is a supervised training process used for fine tuning parameters of the initial similarity analysis model, the second training sample set comprises training samples and training labels, the training samples comprise any two user behavior sequences in part of the user behavior sequences, the training labels represent whether any two user behavior sequences in the part of the user behavior sequences are similar, and the similarity analysis model is used for determining whether different user behavior sequences are similar.
  12. 12. An execution device, the device comprising: the acquisition unit is used for acquiring a first user behavior sequence and a second user behavior sequence; The processing unit is used for processing the first user behavior sequence and the second user behavior sequence by utilizing a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result represents similarity or dissimilarity between the first user behavior sequence and the second user behavior sequence; wherein the similarity analysis model is obtained by the method of any one of claims 1-3, 5 or 7.
  13. 13. A training device comprising a memory and a processor, the memory and the processor coupled; The memory is used for storing one or more computer instructions; the processor is configured to execute the one or more computer instructions to implement the method of any of claims 1-3, 5, or 7.
  14. 14. An execution device comprising a memory and a processor, the memory and the processor coupled; The memory is used for storing one or more computer instructions; the processor is configured to execute the one or more computer instructions to implement the method of claim 10.
  15. 15. A computer readable storage medium having stored thereon one or more computer instructions executable by a processor to implement the method of any of claims 1-3, 5, 7 or 10.

Description

Method, device, equipment and storage medium for processing user behavior sequence Technical Field The present application relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a user behavior sequence. Background The user behavior sequence is the occurrence process of a series of events such as clicking, accessing, purchasing and the like generated by a user in daily operation and use, and can be expressed as a time sequence of an event set. The user behavior sequence contains the habit, preference and other characteristics of the user, and is one of important characteristic sources of the user-level machine learning model. For example, in the field of games, a player's behavior sequence records the complete path of the player's behavior during the course of the game. The calculation of player similarity is a very popular fundamental task in gaming artificial intelligence applications. The similarity of the players is calculated based on the behavior sequence data of the players, and the players can be clustered effectively. Furthermore, the player groups with similar subdivision behavior patterns have important application value in service scenes such as game operation, game recommendation and the like. In the conventional technology, similarity calculation of a user behavior sequence is mainly determined by directly calculating a similarity measure or by two modes of approximate calculation of a neural network. Wherein, based on the direct calculation mode of similarity measurement, the similarity measurement calculation is directly carried out on the behavior sequences of two users by adopting a distance formula, the method has the problem of low calculation efficiency, and is difficult to popularize and use in practical application. Based on the neural network calculation mode, a great amount of labeled training data is needed to be used for carrying out supervised training on the neural network model. However, in an actual application scene, it is generally difficult to obtain a large amount of training data with labels in a corresponding scene, which results in the problems of low accuracy and high labor cost of the result of the user behavior sequence similarity calculation obtained based on the calculation of the method. Therefore, a method for processing the user behavior sequence is needed, which has high calculation efficiency, high accuracy of the obtained result of the calculation of the similarity of the user behavior sequence and low labor cost. Disclosure of Invention The application provides a method, a device, equipment and a storage medium for processing a user behavior sequence, which have the advantages of high calculation efficiency, high accuracy of the obtained result of calculating the similarity of the user behavior sequence and low labor cost. The first aspect of the embodiment of the application provides a method for processing a user behavior sequence, which comprises the steps of obtaining a first training sample set, wherein the first training sample set comprises a positive sample pair and a negative sample pair of a comparison learning task generated according to a behavior sequence data set, the behavior sequence data set comprises a plurality of user behavior sequences, performing first training on a neural network model by using the first training sample set to obtain an initial similarity analysis model, performing first training on the neural network model according to the positive sample pair and the negative sample pair of the comparison learning task to obtain the initial similarity analysis model, performing second training on the initial similarity analysis model by using a second training sample set to obtain a similarity analysis model, the second training sample set comprises a training sample and a training label, the training sample comprises any two user behavior sequences in part of the user behavior sequences, the training label represents whether the two user behavior sequences in the part of the user behavior sequences are different from each other, and whether the user behavior sequences are different from each other is determined according to whether the user behavior sequences are similar to the user behavior sequences. A third aspect of the embodiment of the application provides a method for processing a user behavior sequence, which comprises the steps of obtaining a first user behavior sequence and a second user behavior sequence, and processing the first user behavior sequence and the second user behavior sequence by using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result represents similarity or dissimilarity between the first user behavior sequence and the second user behavior sequence, and the similarity analysis model is obtained by the method according to the first aspect. The third aspec