Method, device, equipment and storage medium for processing user behavior sequence
By combining unsupervised comparative learning and supervised training, a similarity analysis model is generated, which solves the problems of low computational efficiency and low accuracy in traditional methods, and realizes efficient and low-cost calculation of user behavior sequence similarity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-02-20
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional methods for calculating the similarity of user behavior sequences are inefficient and inaccurate, making them difficult to promote in practical applications. Furthermore, they require a large amount of labeled data for neural network training, resulting in high labor costs.
An unsupervised contrastive learning method is used to generate positive and negative sample pairs to initially train the neural network model. The initial similarity analysis model is then fine-tuned using a supervised training sample set to obtain the final similarity analysis model.
It improves the efficiency and accuracy of calculating the similarity of user behavior sequences and reduces the cost of manually labeled data.
Smart Images

Figure CN116304733B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and storage medium for processing user behavior sequences. Background Technology
[0002] User behavior sequences are the series of events that occur during a user's daily operations, such as clicks, visits, and purchases. They can be represented as a time series of events. User behavior sequences contain characteristics such as user habits and preferences, and are one of the important feature sources for user-level machine learning models. For example, in the gaming industry, a player's behavior sequence records the complete behavioral path of the player during gameplay. Calculating player similarity is a very common and fundamental task in game AI applications. Calculating player similarity based on player behavior sequence data can effectively cluster players. Furthermore, segmenting player groups with similar behavioral patterns has significant application value in business scenarios such as game operation and game recommendation.
[0003] In traditional techniques, the similarity of user behavior sequences is primarily determined through two methods: direct calculation using similarity metrics or approximate calculation using neural networks. The direct calculation method, based on similarity metrics, uses a distance formula to directly measure the similarity between the behavior sequences of two users. This method suffers from low computational efficiency, making it difficult to promote and use in practical applications. The neural network-based method requires supervised training of the neural network model using a large amount of labeled training data. However, in real-world applications, it is often difficult to obtain large amounts of labeled training data relevant to the specific scenario, resulting in low accuracy and high manual costs for the user behavior sequence similarity calculations obtained using this method.
[0004] Therefore, there is an urgent need for a method to process user behavior sequences that is computationally efficient, has high accuracy in obtaining user behavior sequence similarity calculation results, and has low manual costs. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for processing user behavior sequences. The method has high computational efficiency, high accuracy in obtaining user behavior sequence similarity calculation results, and low labor costs.
[0006] A first aspect of this application provides a method for processing user behavior sequences. The method includes: acquiring a first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; performing a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model, wherein the first training process includes: performing the first training on the neural network model based on the positive sample pairs and negative sample pairs of the contrastive learning task to obtain the initial similarity analysis model; performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training sample set includes: training samples and training labels, the training samples include any two user behavior sequences from a subset of the multiple user behavior sequences, and the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar.
[0007] A third aspect of this application provides a method for processing user behavior sequences, 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 using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result indicates whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar; wherein the similarity analysis model is obtained as described in the first aspect above.
[0008] A third aspect of this application provides an apparatus for processing user behavior sequences. The apparatus includes: an acquisition unit for acquiring a first training sample set, wherein the first training sample set includes positive and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; a first training unit for performing a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model, wherein the first training process includes performing the first training on the neural network model based on the positive and negative sample pairs of the contrastive learning task to obtain the initial similarity analysis model; and a second training unit for performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training sample set includes training samples and training labels, the training samples include any two user behavior sequences from a subset of the multiple user behavior sequences, and the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar.
[0009] A fourth aspect of this application provides an apparatus for processing user behavior sequences. The apparatus includes: an acquisition unit for acquiring a first user behavior sequence and a second user behavior sequence; and a processing unit for processing the first user behavior sequence and the second user behavior sequence using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result indicates whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar; wherein the similarity analysis model is obtained as described in the first aspect above.
[0010] A fifth aspect of this application also provides a training device, including: a processor; and a memory for storing a data processing program, wherein the server, after being powered on and running the program through the processor, executes the method described above.
[0011] A sixth aspect of this application also provides an execution device, including: a processor; and a memory for storing a data processing program, wherein the server, after being powered on and running the program through the processor, executes the method described above.
[0012] A seventh aspect of this application also provides a computer-readable storage medium storing one or more computer instructions thereon, characterized in that the instructions are executed by a processor to implement the method described in any of the above technical solutions.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments disclosed in this application, nor is it intended to limit the scope of this application's disclosure. Other features disclosed in this application will become readily apparent from the following description.
[0014] The technical solution of the method for processing user behavior sequences provided in this application includes: obtaining a first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; performing a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model, wherein the first training process includes: performing a first training on the neural network model based on the positive sample pairs and negative sample pairs of the contrastive learning task to obtain an initial similarity analysis model; performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training sample set includes: training samples and training labels, the training samples include any two user behavior sequences from a subset of user behavior sequences in the multiple user behavior sequences, and the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar. In the above method for processing user behavior sequences, the first training sample set includes positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset, that is, the first training sample set is an unlabeled training set. In other words, the first training described above is an unsupervised training process based on a contrastive learning task. This reduces the cost of manually labeling data while ensuring the accuracy of the obtained initial similarity analysis model. The second training sample is a labeled training set, determined based on a subset of user behavior sequences from multiple user behavior sequences included in the behavior sequence dataset. That is, the second training process is a supervised training process, requiring only a small amount of labeled data to fine-tune the parameters of the initial similarity analysis model to obtain the final similarity analysis model. In summary, compared to traditional techniques, the method for processing user behavior sequences provided in this application has high computational efficiency, high accuracy in obtaining user behavior sequence similarity calculation results, and low labor costs. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1This is a schematic diagram illustrating an application scenario of the method for processing user behavior sequences provided in the embodiments of this application.
[0017] Figure 2 This is a schematic diagram of a method for processing user behavior sequences provided in an embodiment of this application.
[0018] Figure 3 The above Figure 2 A schematic diagram of the training process for the first training described.
[0019] Figure 4 The above Figure 2 A schematic diagram of the training process for the second training described.
[0020] Figure 5 This is a schematic diagram of another method for processing user behavior sequences provided in an embodiment of this application.
[0021] Figure 6 This is a schematic diagram of another method for processing user behavior sequences provided in the embodiments of this application.
[0022] Figure 7 This is a schematic diagram of the structure of a device for processing user behavior sequences provided in an embodiment of this application.
[0023] Figure 8 This is a schematic diagram of another device for processing user behavior sequences provided in an embodiment of this application.
[0024] Figure 9 This is a schematic diagram of the structure of a training device provided in an embodiment of this application.
[0025] Figure 10 This is a schematic diagram of the structure of an execution device provided in an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions of this application, the application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. However, this application can be implemented in many other ways different from those described above. Therefore, based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0027] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0028] With the continued prosperity of the global gaming market, online games have gradually become the largest segment and have attracted much attention. Behavioral sequences are easily collected data in online games, recording the complete behavioral paths of players during gameplay. They are generally presented as time series containing behavioral elements, such as the time of the action, the type of action, and the object of the action. Player similarity calculation is a very common and fundamental task in game artificial intelligence applications. Through thorough and in-depth analysis and research of a large amount of real game data, it has been found that calculating player similarity based on behavioral sequence data can effectively cluster players and further segment player groups with similar behavioral patterns. This has significant application value in downstream business scenarios such as game operation, game recommendation, and game risk control.
[0029] In traditional techniques, the similarity of player behavior sequences is primarily determined through two methods: direct calculation using similarity metrics or approximate calculation using neural networks. Direct calculation based on similarity metrics can employ distance formulas such as Euclidean distance, cosine similarity, or Pearson correlation coefficient to measure the similarity between two player behavior sequences. However, these methods suffer from low computational efficiency, hindering their widespread adoption in practical applications. Neural network calculations, on the other hand, use the results of similarity metrics as labels for training data. A neural network model is used for supervised learning to simulate the similarity metric calculation process and thus fit the calculated results. However, training this neural network model requires a large amount of labeled training data. In real-world applications, obtaining such a large amount of labeled training data for a given scenario is often difficult. This results in inaccurate neural network models trained on limited labeled training data using the aforementioned neural network calculation method. Furthermore, when using this trained neural network model to perform similarity analysis on player behavior sequences, the obtained similarity analysis results are not accurate enough. In other words, the neural network-based calculation method has the following problems: difficulty in obtaining large amounts of labeled training data and low accuracy in calculating the similarity of player behavior sequences. In summary, traditional methods for calculating player behavior sequence similarity suffer from the following problems: low computational efficiency and low accuracy.
[0030] Based on this, this application provides a method, apparatus, device, and storage medium for processing user behavior sequences to solve the aforementioned problems existing in conventional technologies.
[0031] To facilitate understanding, the technical terms that may be involved in the embodiments of this application will be briefly introduced first.
[0032] 1. Artificial Intelligence (AI)
[0033] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence.
[0034] Artificial intelligence (AI) studies the design principles and implementation methods of various intelligent machines, enabling them to perceive, reason, and make decisions. AI technology mainly includes computer vision, natural language processing, and machine learning / deep learning. With the research and advancement of AI technology, it is being researched and applied in multiple fields, such as smart homes, intelligent customer service, virtual assistants, smart speakers, intelligent marketing, autonomous driving, robotics, and smart healthcare. It is believed that with further technological development, AI will be applied in even more fields and play an increasingly important role.
[0035] 2. Natural Language Processing (NLP)
[0036] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP technologies typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.
[0037] 3. Contrastive learning
[0038] Contrastive learning is a self-supervised learning technique that uses pairs of augmentations generated from unlabeled training data to define a classification task as a pretext task, with the aim of learning a sufficiently good deep embedding.
[0039] The prerequisite for contrastive learning is to treat each instance as a class and then learn an invariant instance representation. Specifically, this involves generating a pair of samples for each instance, feeding them into an encoder, and then training the encoder using a contrastive loss. This contrastive loss encourages positive sample pairs generated from the same instance to have their embeddings close together, while negative sample pairs generated from different instances are encouraged to have their representations far apart. The goal of contrastive learning is to learn an encoder that encodes similar data for the same class and makes the encoding results for data from different classes as different as possible.
[0040] 4. Metric learning
[0041] Metric learning is what is commonly known as similarity learning. If we need to calculate the similarity between two images, the goal of metric learning is to measure the similarity between images so that the similarity between images of different categories is small while the similarity between images of the same category is large (maximizing the inter-class variations and minimizing the intra-class variations).
[0042] 5. Related models for generating word vectors (word to vector, Word2vec)
[0043] Word2vec is a group of related models used to generate word vectors. These models are shallow, two-layer neural networks trained to reconstruct linguistic word text. The network represents words and needs to guess the input words in adjacent positions. Under the bag-of-words assumption in word2vec, the order of words is unimportant. After training, the word2vec model can be used to map each word to a vector, which can be used to represent the relationship between words. This vector is the hidden layer of the neural network.
[0044] 6. Word vectors
[0045] Word vectors possess strong semantic properties and are a common way to represent word features. Each dimension of a word vector represents a feature with specific semantic and grammatical interpretations. Therefore, each dimension of a word vector can be called a word feature. Word vectors have various forms, one of which is distributed representation. A distributed representation is a dense, low-dimensional real-valued vector. Each dimension of a distributed representation represents a latent feature of a word, capturing useful syntactic and semantic characteristics. Thus, the word "distributed" in distributed representation reflects this characteristic of word vectors: distributing the different syntactic and semantic features of a word across its various dimensions.
[0046] 7. Supervised learning
[0047] Supervised learning is a machine learning task that infers functions from labeled training datasets. The training data consists of a set of training instances. In supervised learning, each instance is a pair consisting of an input object (usually a vector) and a desired output value (also known as a supervision signal).
[0048] 8. Unsupervised learning
[0049] Unsupervised learning refers to learning useful patterns from unlabeled data. Unsupervised learning algorithms typically learn directly from raw data without any manual labeling or feedback. Self-supervised learning is a type of unsupervised learning.
[0050] 9. Positive samples
[0051] Positive samples are the targets to be detected. For example, when the target is to detect faces, faces are positive samples.
[0052] 10. Negative samples
[0053] Negative samples are targets other than the target to be detected. For example, when the target to be detected is a human face, non-human faces are negative samples, such as a dog's face, trees, or flowers.
[0054] 11. Loss Function
[0055] The loss function, also known as the objective function, is one of the two essential elements for compiling a neural network model. It evaluates the degree to which the model's predictions differ from the actual values; a better loss function generally indicates better model performance. Different models typically use different loss functions.
[0056] The following detailed description, with reference to the accompanying drawings, illustrates the application scenarios and methods for processing user behavior sequences applicable to embodiments of this application. It is understood that, where there is no conflict between the various embodiments provided in this application, the following embodiments and features can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.
[0057] First, the application scenarios of the method for processing user behavior sequences applicable to embodiments of this application will be described with reference to the accompanying drawings.
[0058] Figure 1 This is a schematic diagram illustrating an application scenario of the method for processing user behavior sequences provided in the embodiments of this application. For example... Figure 1 As shown, this application scenario includes at least one server 101 and at least one terminal 102. Server 101 and terminal 102 can communicate via network 103 to transmit data. Network 103 can be a wired network or a wireless network; this application does not specifically limit its usage.
[0059] Server 101 can be a server providing various services. Specifically, server 101 can be used to provide background services for applications running on terminal 102. For example, server 101 can use the similarity analysis model provided in this application embodiment to analyze different user behavior sequence data sent by terminal 102 to determine whether different user behavior sequence data are similar. Optionally, in some implementations, the first training of the neural network model and the second training of the initial similarity analysis model provided in this application embodiment can be performed by server 101. Server 101 can be hardware or software. When server 101 is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When server 101 is software, it can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services) or as a single software program or software module. This application embodiment does not specifically limit this.
[0060] Applications can be installed and run on terminal 102. For example, the application could be a question-and-answer application, a social networking application, an image processing application, an instant messaging application, a shopping application, or a search application. Terminal 102 can be, but is not limited to, a personal computer, smartphone, tablet, desktop computer, smart speaker, smartwatch, or wearable device.
[0061] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can be any network, including but not limited to local area networks (LANs), metropolitan area networks (MANs), wide area networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0062] It should be understood that the above Figure 1 The application scenarios shown are for illustrative purposes only and do not constitute any limitation on the application scenarios to which the method for processing user behavior sequences provided in the embodiments of this application is applicable. Optionally, the above... Figure 1 The application scenarios shown can also include a greater number of servers 101, a greater number of terminals 102, and a greater number of networks 103. Optionally, the above... Figure 1 The terminal 102 shown can also be replaced by a server other than server 101.
[0063] Next, combined Figures 2 to 6 This application introduces a method for processing user behavior sequences according to embodiments.
[0064] Figure 2This is a schematic diagram illustrating a method for processing user behavior sequences provided in an embodiment of this application. The method for generating a multi-task generative model provided in this application can be executed by a training device. It is understood that the training device can be implemented as software, or a combination of software and hardware. For example, the training device in this application embodiment can be, but is not limited to, a server or a terminal device used by the user. Figure 2 As shown, the method for processing user behavior sequences provided in this application includes steps S210 to S230. Steps S210 to S230 will be described in detail below.
[0065] S210, Obtain the first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of the contrastive learning task generated based on the behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences.
[0066] A behavior sequence dataset includes multiple user behavior sequences. Each user behavior sequence comprises multiple behavior data points corresponding to that user at multiple times, where each time point corresponds one-to-one with a single behavior data point, and the behavior data points within any given user behavior sequence are arranged in chronological order. For example, taking a behavior sequence dataset including user 1's behavior sequence data and user 2's behavior sequence data, where each user's behavior sequence data includes three behavior data points corresponding to three times, the behavior sequence dataset can be represented as: {user 1's behavior sequence data, user 2's behavior sequence data}, where user 1's behavior sequence data = {user 1's behavior data at time 1, user 1's behavior data at time 2, user 1's behavior data at time 3}; user 2's behavior sequence data = {user 2's behavior data at time 1, user 2's behavior data at time 2, user 2's behavior data at time 3}; where time 1 is a time preceding time 2, and time 2 is a time preceding time 3. The number of user behavior sequences included in the behavior sequence dataset is not specifically limited and can be set according to the actual application scenario. For example, the aforementioned behavior sequence dataset may include user behavior sequences of 2 or 5 users. In some implementations, any one of the multiple user behavior sequences included in the aforementioned behavior sequence dataset can be represented by word vectors, that is, the word vectors are obtained by performing behavior sequence vectorization processing on any one user behavior sequence. The application fields involved in the multiple user behavior sequences included in the aforementioned behavior sequence dataset are not specifically limited. In some implementations, the method provided in this application embodiment can be applied to the gaming field, wherein each user behavior sequence specifically includes: multiple behavior data corresponding to multiple moments generated by each user during the game, with each moment corresponding to one-to-one with the multiple behavior data. Optionally, in other implementations, the method provided in this application embodiment can also be applied to the e-commerce field, wherein each user behavior sequence specifically includes: multiple behavior data corresponding to multiple moments generated by each user during online shopping, with each moment corresponding to one-to-one with the multiple behavior data. It should be understood that the application fields shown above are merely illustrative and do not constitute any limitation on the method for processing user behavior sequences provided in this application embodiment.
[0067] In S210 above, the first training sample set includes: positive sample pairs and negative sample pairs generated from the behavior sequence dataset for the contrastive learning task. A positive sample pair includes two positive samples that have the same or similar features; that is, the two positive samples in a positive sample pair are essentially different versions of the same sample. A negative sample pair includes one positive sample and one negative sample that have different features; that is, the positive and negative samples in a negative sample pair are essentially two different samples. In this embodiment, the definition of any sample pair in the positive and negative sample pairs is associated with the contrastive learning task. Below, the positive and negative sample pairs included in the first training sample set provided in this embodiment will be described in detail with reference to the contrastive learning task.
[0068] Each of the aforementioned multiple user behavior sequences includes multiple behavior data corresponding to each user at multiple time points. Each user behavior sequence corresponds to at least two augmentation sequences, and the at least two augmentation sequences corresponding to each user behavior sequence are sequences obtained by performing at least two different data augmentation processes on each user behavior sequence. Obtaining the first training sample set includes:
[0069] For the contrastive learning task between the same user behavior sequence, the behavior data with the same time in at least two augmentation sequences corresponding to the same user behavior sequence constitutes the positive sample pair of the contrastive learning task, and the behavior data with different time in at least two augmentation sequences corresponding to the same user behavior sequence constitutes the negative sample pair of the first type. Here, the same user behavior sequence is any one of multiple user behavior sequences, and the negative sample pair of the contrastive learning task includes the negative sample pair of the first type.
[0070] For the comparative learning task between different user behavior sequences, the behavior data with the same time in any one of the at least two augmented sequences corresponding to the first user behavior sequence and any one of the at least two augmented sequences corresponding to the second user behavior sequence constitutes a second type of negative sample pair. Here, the multiple user behavior sequences include the first user behavior sequence and the second user behavior sequence, and the negative sample pairs for the comparative learning task also include the second type of negative sample pairs. In the above implementation, the at least two augmented sequences corresponding to each user behavior sequence are sequences obtained by performing at least two different data augmentation processes on each user behavior sequence. It can be understood that the at least two augmented sequences corresponding to each user behavior sequence are not completely identical. That is, there is partially identical behavior data in the at least two augmented sequences corresponding to each user behavior sequence. In some implementations, the partially identical behavior data in the at least two augmented sequences corresponding to each user behavior sequence includes behavior data with the same time in the at least two augmented sequences corresponding to each user behavior sequence. Based on this, in this implementation, the partially dissimilar behavior data in the at least two augmented sequences corresponding to each user behavior sequence includes behavior data with dissimilar time in the at least two augmented sequences corresponding to each user behavior sequence. The specific details regarding the at least two different data augmentation processes described above are not limited and can be set according to actual needs. For example, the at least two different data augmentation processes mentioned above may include at least two of the following augmentation methods: rotation, timestamp masking, or random cropping. For instance, in some implementations, the at least two different data augmentation processes may include random cropping and timestamp masking. Furthermore, in some implementations, the at least two different data augmentation processes may include rotation, timestamp masking, and random cropping.
[0071] The following describes the positive and negative sample pairs in the above implementation using the following application scenario as an example. This application scenario includes: the behavioral sequence of user Q is denoted as: {user Q's behavioral data 1 at time 1, user Q's behavioral data 2 at time 2, user Q's behavioral data 3 at time 3, user Q's behavioral data 4 at time 4, user Q's behavioral data 5 at time 5}, and the two augmented sequences corresponding to this behavioral sequence of user Q are augmented sequence Q1 and augmented sequence Q2. Where Q = 1, 2, the augmented sequence Q1 is denoted as: {user Q's behavior data 1' at time 1, user Q's behavior data 2' at time 2, user Q's behavior data 3' at time 3}; the augmented sequence Q2 is denoted as: {user Q's behavior data 2" at time 2, user Q's behavior data 3" at time 3, user Q's behavior data 4" at time 4}. Augmented sequences Q1 and Q2 are two augmented sequences obtained by performing random pruning and time masking on the user Q's behavior sequence. In the above application scenario, the positive sample pair determined by the two augmented sequences corresponding to the user Q's behavior sequence can include: behavior data 2' at time 2 in augmented sequence Q1 as a positive sample, and behavior data 2" at time 2 in augmented sequence Q2 as a positive sample; Furthermore, the positive sample pair may also include: behavioral data 3' at time 3 in the enhanced sequence Q1 as a positive sample, and behavioral data 3" at time 3 in the enhanced sequence Q2 as a positive sample. For example, in the above application scenario, the first type of negative sample pair may include: behavioral data 2' at time 2 in the enhanced sequence Q1 as a positive sample, and behavioral data 1' at time 1 in the enhanced sequence Q1 as a negative sample; the first type of negative sample pair may include: behavioral data 2' at time 2 in the enhanced sequence Q2 as a positive sample, and behavioral data 4" at time 4 in the enhanced sequence Q2 as a negative sample; or, the first type of negative sample pair may include: behavioral data 2' at time 2 in the enhanced sequence Q1 as a positive sample, and behavioral data 4' at time 4 in the enhanced sequence Q2 as a negative sample. For example, in the above application scenario, the second type of negative sample pair may include: behavioral data 2' at time 2 in the enhanced sequence Q1 as a positive sample, where Q equals 1; and behavioral data 1' at time 2 in the enhanced sequence Q1 as a negative sample, where Q equals 2. Alternatively, the second type of negative sample pair may include: behavioral data 3” of time 3 in the augmented sequence Q2 as a positive sample, where Q equals 2; and behavioral data 3” of time 3 in the augmented sequence Q2 as a negative sample, where Q equals 1.
[0072] Optionally, in some other implementations, before obtaining the first training sample set, i.e. before executing S210 above, the following steps may also be performed: performing at least two different data augmentation processes on each of the multiple user behavior sequences to obtain at least two augmentation sequences corresponding to each behavior sequence.
[0073] S220, Perform first training on the neural network model using the first training sample set to obtain an initial similarity analysis model. The first training process includes: Performing first training on the neural network model based on the positive and negative sample pairs of the comparison learning task to obtain an initial similarity analysis model.
[0074] The first training process described in S220 above involves performing first training on the neural network model based on the positive and negative sample pairs of the contrastive learning task determined in S210 above, to obtain an initial similarity analysis model. This first training process is an unsupervised model training process based on the contrastive learning task. In this embodiment, performing S220 may include... Figure 3 S220-1 to SS220-4 are shown. S220-1 to SS220-4 will be described in detail below.
[0075] S220-1 uses a neural network model to process the positive and negative sample pairs of the contrastive learning task, and obtains the feature vectors of the positive and negative sample pairs of the contrastive learning task.
[0076] In this embodiment, the neural network model has encoding capabilities. That is, the neural network model can encode the two samples in an input sample pair to obtain an encoded output. The input sample pair includes a positive sample pair and a negative sample pair for a contrastive learning task. The encoded output includes two feature vectors (also called representation vectors) corresponding to the two samples in the input sample pair, with each feature vector identifying that sample. The model type of the neural network is not specifically limited and can be selected according to actual needs. In other words, the neural network model described in S220 can, in principle, be any model that meets the requirements. In practical applications, considering the inherent characteristics of the enhanced behavioral sequence data, the neural network model can be a sequence model. For example, the sequence model can be, but is not limited to, any of the following sequence models: a gated recurrent unit (GRU) model, a long short-term memory (LSTM) model, a bidirectional long short-term memory (BiLSTM) model, a temporal convolutional network (TCN) model, a Transformer model, or a variation of any of the above models. Exemplarily, in some implementations, the neural network model described in S220 above can be an encoder included in a Transformer model.
[0077] S220-2, determine the contrastive loss for the contrastive learning task based on the feature vectors of the positive sample pairs and the feature vectors of the negative sample pairs.
[0078] In this embodiment of the application, the above-mentioned S220-1 is performed, that is, the contrast loss of the contrast learning task is determined according to the feature vectors of the positive sample pairs and the feature vectors of the negative sample pairs of the contrast learning task. This includes: determining the temporal contrast loss according to the feature vectors of the positive sample pairs and the feature vectors of the first type of negative sample pairs of the contrast learning task. The first type of negative sample pairs are obtained by the following method: for the contrast learning task between the same user behavior sequences, the behavioral data at different times in at least two augmented sequences corresponding to the same user behavior sequence are used to form the first type of negative sample pairs. The same user behavior sequence is any one of multiple user behavior sequences. Based on the feature vectors of positive sample pairs and second-type negative sample pairs in the contrastive learning task, the instance contrast loss is determined. The second-type negative sample pairs are obtained as follows: For the contrastive learning task between different user behavior sequences, the behavioral data with the same time interval in any one of the at least two augmented sequences corresponding to the first user behavior sequence and any one of the at least two augmented sequences corresponding to the second user behavior sequence constitute the second-type negative sample pairs. The multiple user behavior sequences include the first user behavior sequence and the second user behavior sequence. The contrast loss for the contrastive learning is determined based on the temporal contrast loss and the instance contrast loss. In the above implementation, the methods for determining the first-type and second-type negative sample pairs are the same as those described in S210 above. Details not described here can be found in the relevant descriptions in S210 above.
[0079] In some implementations, the aforementioned temporal contrastive loss is used to: make the two feature vectors corresponding to the two positive samples in a positive sample pair as similar as possible, and to make the feature vectors of the positive samples and the feature vectors of the negative samples in a first-type negative sample pair as dissimilar as possible. Specifically, the physical meaning of the temporal contrastive loss is: to make the feature vectors of behavioral data at the same time in at least two augmented sequences corresponding to the same user behavior sequence as similar as possible (positive sample pair), and to make the feature vectors of behavioral data at different time in at least two augmented sequences corresponding to the same user behavior sequence as dissimilar as possible (first-type negative sample pair). The aforementioned instance contrastive loss is used to: make the two feature vectors corresponding to the two positive samples in a positive sample pair as similar as possible, and to make the feature vectors of the positive samples and the feature vectors of the negative samples in a second-type negative sample pair as dissimilar as possible. Specifically, the physical meaning of the instance contrast loss function is: for the same user behavior sequence, the feature vectors of the behavior data at the same time in at least two augmented sequences are as similar as possible (positive sample pair); and for different user behavior sequences, for any one of the at least two augmented sequences corresponding to the first user behavior sequence, the feature vectors of the behavior data at the same time in at least one of the at least two augmented sequences corresponding to the second user behavior sequence are as dissimilar as possible (second type negative sample pair).
[0080] In this application embodiment, the method for determining the alignment loss of contrastive learning based on temporal contrastive loss and instance contrastive loss is not specifically limited. In some implementations, the contrastive learning loss is the result obtained by averaging the temporal contrastive loss and the instance contrastive loss. For example, the contrastive loss function of the neural network model described by formula (5.1) in S604-2 below is a specific example of the contrastive loss of contrastive learning mentioned above. It is understood that the temporal contrastive loss function described in S604-2 below is a specific example of the temporal contrastive loss mentioned above, and the instance contrastive loss function described in S604-2 below is a specific example of the instance contrastive loss mentioned above.
[0081] In this application embodiment, the method for determining the above-mentioned temporal contrast loss and instance contrast loss is not specifically limited. Below, we introduce a method provided by this application embodiment for determining temporal contrast loss based on the feature vectors of positive sample pairs and the feature vectors of negative sample pairs of the first type in a contrastive learning task. It should be understood that the method for determining temporal contrast loss described below is merely illustrative and does not constitute any limitation on the method provided by this application embodiment for determining temporal contrast loss based on the feature vectors of positive sample pairs and the feature vectors of negative sample pairs of the first type in a contrastive learning task.
[0082] In some implementations, the time-series comparison loss described above can be expressed by the following formula:
[0083]
[0084] In the above formula (2.1), R′ represents the temporal comparison loss of multiple user behavior sequences included in the behavior sequence dataset at timestamp (also known as time t); Ω1 represents the timestamp intersection, which includes the same time in at least two augmented sequences corresponding to any one of the multiple user behavior sequences; t represents any one of the multiple times corresponding to the multiple behavior data included in the user behavior sequence; R′ t R″ represents the feature vector of the behavioral data corresponding to any one of the at least two augmented sequences in one of the multiple time points of the augmented sequence for any given user behavior sequence; t R′ represents the feature vector of the behavioral data corresponding to any one of the multiple times in one of the at least two augmented sequences corresponding to any given user behavior sequence; t' represents any timestamp in the timestamp intersection; R′ t′ R″ represents the feature vector of the behavioral data corresponding to the intersection of timestamps in at least one of the at least two augmented sequences corresponding to any given user behavior sequence; t′ R′ represents the feature vector of the behavioral data corresponding to the intersection of timestamps in one of the at least two augmented sequences corresponding to any given user behavior sequence; 1 represents the indicator function (the value of the exponential function). The two feature vectors corresponding to the two positive samples in the above positive sample pair can be expressed as in formula (2.1): R′ t ·R″ t , or R′ t ·R″ t′ And t'∈Ω1, t∈Ω1. The feature vectors of the positive samples and the feature vectors of the negative samples included in the first type of negative sample pair can be expressed as in the above formula (2.1): R′ t ·R″ t′ , and t'∈Ω1, where t is any time other than Ω1 among multiple time points corresponding to any user behavior sequence; or the feature vectors of the positive samples and the feature vectors of the negative samples included in the first type of negative sample pair can be expressed as in the above formula (2.1): R′ t ·R′ t′ , and t≠t'.
[0085] In some implementations, the contrastive loss in the above examples can be expressed by the following formula:
[0086]
[0087] In the above formula (2.2), R′ represents the time-series comparison loss of multiple user behavior sequences included in the behavior sequence dataset at timestamp (also known as time t); t represents any one of the multiple times corresponding to the multiple behavior data included in any given user behavior sequence; batch represents the batched dataset, which can be the behavior sequence dataset or a subset of the behavior sequence dataset; 1 represents the indicator function (the value of the exponential function); R′ t 、R″ t It is the at least two feature vectors corresponding to at least two augmented sequences corresponding to the first user behavior sequence; R′ t and R″ t It refers to at least two feature vectors corresponding to at least two enhanced sequences corresponding to the second user behavior sequence. The two feature vectors corresponding to the two positive samples in the above positive sample pair can be expressed as in formula (2.2): R′ t ·R″ t , or R′ t ·R″ t And R∈batch, R=R. The feature vectors of the positive samples and the feature vectors of the negative samples included in the second type of negative sample pair can be expressed as in the above formula (2.2): R′ t ·R″ t And R∈batch, R≠R; or the feature vectors of the positive samples and the feature vectors of the negative samples included in the second type of negative sample pair can be expressed as in the above formula (2.2): R′ t ·R′ t And R≠R.
[0088] S220-3 adjusts the parameters of the neural network model based on the contrastive loss.
[0089] S220-4: When the training reaches the first preset training condition, stop adjusting the parameters of the neural network model to obtain the initial similarity analysis model.
[0090] The first preset training condition is not specifically limited and can be set according to the actual scenario. Optionally, in some implementations, any one of the first and second preset training conditions may include at least one of the following conditions: the number of training iterations of the model associated with any preset training condition meets a preset number of training iterations; the training time of the model associated with any preset training condition meets a preset training time; or the loss result of the model associated with any preset training condition is less than a preset loss threshold. The preset number of training iterations, the preset number of training iterations, and the preset loss threshold are not specifically limited and can be set according to actual needs.
[0091] S230, the initial similarity analysis model is trained a second time using the second training sample set to obtain a similarity analysis model. The second training sample set includes training samples and training labels. The training samples include any two user behavior sequences from a subset of user behavior sequences. The training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar. The similarity analysis model is used to determine whether different user behavior sequences are similar.
[0092] In this embodiment of the application, performing the method described in S230 above may specifically include Figure 4 S230-1 to S230-4 are shown. S230-1 to S230-4 will be described below.
[0093] S230-1 uses an initial similarity analysis model to process the training samples and obtains two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training samples.
[0094] S230-2, based on the two feature vectors corresponding to any two user behavior sequences in the training sample, determine the behavior sequence similarity result, whereby the behavior sequence similarity result indicates whether any two user behavior sequences in the training sample are similar. The above determination of the behavior sequence similarity result based on the two feature vectors corresponding to any two user behavior sequences in the training sample may include the following steps:
[0095] Based on the similarity calculation formula, the similarity between the two feature vectors corresponding to any two user behavior sequences in the training samples is calculated to obtain the behavior sequence similarity result. There is no specific limitation on the similarity calculation formula; it can be selected according to actual needs. For example, the similarity calculation formula can be, but is not limited to, any of the following formulas: Euclidean distance, cosine similarity, or Pearson correlation coefficient.
[0096] S230-3, adjust the parameters of the initial similarity analysis model based on the difference between the training labels and the behavioral sequence similarity results.
[0097] The difference between the training labels and the behavioral sequence similarity results described above can be represented by a loss function. There is no specific limitation on the type of loss function; it can be selected according to actual needs. For example, the loss function can be, but is not limited to, the cross-entropy loss function.
[0098] S230-4, When the training reaches the second preset training condition, stop adjusting the parameters of the initial similarity analysis model and obtain the similarity analysis model.
[0099] The second preset training condition is not specifically limited and can be set according to the actual scenario. Optionally, in some implementations, any one of the first and second preset training conditions may include at least one of the following conditions: the number of training iterations of the model associated with any preset training condition meets a preset number of training iterations; the training time of the model associated with any preset training condition meets a preset training time; or the loss result of the model associated with any preset training condition is less than a preset loss threshold. The preset number of training iterations, the preset number of training iterations, and the preset loss threshold are not specifically limited and can be set according to actual needs.
[0100] Optionally, in some implementations, before performing a second training on the initial similarity analysis model using the second training sample set to obtain the similarity analysis model, i.e., before performing step 230 above, the following steps may also be performed: selecting a subset of user behavior sequences from the behavior sequence dataset; calculating the similarity between any two user behavior sequences in the subset of user behavior sequences according to the similarity calculation formula to obtain a similarity label between any two user behavior sequences in the subset of user behavior sequences, where the similarity label indicates whether any two user behavior sequences in the subset of user behavior sequences are similar or dissimilar; determining any two user behavior sequences in the subset of user behavior sequences as training samples, and determining the similarity label between any two user behavior sequences in the subset of user behavior sequences as training labels, to obtain a second training sample set. The above similarity calculation formula is not specifically limited; for example, the above similarity calculation formula may be, but is not limited to, any of the following formulas: Euclidean distance, cosine similarity, or Pearson correlation coefficient.
[0101] It should be understood that the above Figure 2 The methods shown are for illustrative purposes only and do not constitute any limitation on the methods for processing user behavior sequences provided in this application. For example, the above data augmentation processing may also include other augmentation methods besides rotation processing, random cropping processing, and time masking processing. There are no specific limitations on other data augmentation methods, and they can be selected according to the actual application scenario.
[0102] In this embodiment, the first training sample set includes positive and negative sample pairs generated from the behavior sequence dataset for a contrastive learning task; that is, the first training sample set is an unlabeled training set. In other words, the first training is an unsupervised training process based on a contrastive learning task. This reduces the cost of manually labeling data while ensuring the accuracy of the obtained initial similarity analysis model. The second training sample is a labeled training set, determined based on a subset of behavior sequence data from multiple user behavior sequences included in the behavior sequence dataset. In other words, the second training process is a supervised training process, requiring only a small amount of labeled data to fine-tune the parameters of the initial similarity analysis model to obtain the model. In summary, compared with traditional technologies, the method for processing user behavior sequences provided in this embodiment has high computational efficiency, high accuracy in obtaining user behavior sequence similarity calculation results, and low labor costs.
[0103] Figure 5 This is a schematic diagram illustrating another method for processing user behavior sequences provided in this application embodiment. The method for processing user behavior sequences provided in this application embodiment can be executed by an execution device. It is understood that the execution device can be implemented as software, or a combination of software and hardware. For example, the execution device in this application embodiment can be, but is not limited to, a server or a terminal device used by the user. Figure 5 As shown, the method for processing user behavior sequences provided in this application embodiment includes S510 and S520. S510 and S520 will be described in detail below.
[0104] S510, obtain the first user behavior sequence and the second user behavior sequence.
[0105] The aforementioned first user behavior sequence and the aforementioned second user behavior sequence can include multiple behavioral data points corresponding to that user at multiple times, wherein there is a one-to-one correspondence between the multiple times and the multiple behavioral data points. The type of any single user behavior data point is not specifically limited and can be set according to actual needs. For example, the single user behavior data point could be behavioral data generated by the user playing a game. Or, the single user behavior data point could be behavioral data of the user shopping online.
[0106] S520, The first user behavior sequence and the second user behavior sequence are processed using a similarity analysis model to obtain similarity analysis results, wherein the similarity analysis results indicate whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar.
[0107] The similarity analysis model described in S520 above can be the above Figure 2The similarity analysis model described in the provided method for processing user behavior sequences. In other words, it can be based on the above... Figure 2 The method described above obtains the similarity analysis model described in S520. For details not elaborated here, please refer to the relevant description above.
[0108] It should be understood that the above Figure 5 The methods shown are for illustrative purposes only and do not constitute any limitation on the methods for processing user behavior sequences provided in this application.
[0109] In this embodiment, a trained similarity analysis model is used to analyze the similarity between the first user behavior sequence and the second user behavior sequence to be processed, which can improve the efficiency of obtaining similarity analysis results. The above-mentioned similarity analysis model is obtained using a "pre-training-fine-tuning" training method, meaning that the results obtained based on the similarity analysis model have high accuracy. In summary, the method provided by this embodiment has the following beneficial effects: high computational efficiency, high accuracy of the obtained user behavior sequence similarity calculation results, and low labor cost.
[0110] Below, in conjunction with Figure 6 This application introduces yet another method for processing user behavior sequences, provided in its embodiments. It is understood that... Figure 6 The method for processing user behavior sequences described above is as follows. Figure 2 A specific example of the described method for processing user behavior sequences, Figure 6 The methods described are for illustrative purposes only and do not constitute any limitation on the methods for processing user behavior sequences provided in this application.
[0111] Figure 6 This is a schematic diagram of another method for processing user behavior sequences provided in an embodiment of this application. For example... Figure 6 As shown, the method includes steps S601 to S608. Steps S601 to S608 are described in detail below.
[0112] S601, Obtain the player behavior sequence dataset, which includes the behavior sequence data of 100 players.
[0113] In this embodiment, the player behavior sequence dataset includes behavior sequence data of 100 different players. The player behavior sequence dataset B can be represented as: B = {T1, T2, ..., T...} |100|}, where |100| represents the size of the behavior sequence dataset; T1 represents the behavior sequence data of the first player, T2 represents the behavior sequence data of the second player, ..., and so on, T |100|This represents the behavior sequence data of the 100th player. The behavior sequence data for any player includes their actions at multiple points in time during the game, where each point in time corresponds to a specific timestamp. Specifically, the behavior sequence data T for each player in the player's behavior sequence dataset can be represented as: T = {t1, t2, ..., t...} p}, where t p This represents the behavior data corresponding to the p-th timestamp of player 1, where p is a positive integer greater than or equal to 1. In this embodiment, the value of p can be equal to 8. That is, the behavior sequence dataset of players described in this embodiment includes 8 behavior data corresponding to 8 timestamps for each player, wherein the 8 timestamps and 8 behavior data correspond one-to-one, that is, each behavior data is the behavior data generated at the corresponding timestamp.
[0114] In this embodiment, the behavior sequence data of any player included in the player behavior sequence dataset can be a word vector, wherein the word vector is obtained by processing the behavior sequence of that player. Based on this, executing S601 above, i.e., obtaining the player behavior sequence dataset, wherein the player behavior sequence dataset includes the behavior sequence data of multiple players, may include the following steps: collecting a certain number of behavior sequences to construct a "corpus"; learning the representation vector of each behavior through the word2vec algorithm to construct a "vocabulary"; vectorizing any behavior sequence included in the behavior sequences of multiple players according to the "vocabulary" to obtain the player behavior sequence dataset.
[0115] S602, perform data augmentation on any player's behavior sequence data included in the player behavior sequence dataset to obtain an augmented player behavior sequence dataset, wherein the augmented player behavior sequence dataset includes two augmented behavior sequence data corresponding to any player's behavior sequence data.
[0116] The behavior sequence data of any player described in S602 above can be abbreviated as T. Based on this, the two enhanced behavior sequence data corresponding to the behavior sequence data of this player can be abbreviated as T′ and T″, respectively. Among them, T′ includes a portion of the behavior sequence data in T, T″ includes a portion of the behavior sequence data in T, and a portion of the behavior sequence data included in all the behavior sequence data in T′ is the same as a portion of the behavior sequence data included in all the behavior sequence data in T″. It can be understood that the portion of the behavior sequence data included in T′ is the same as the portion of the behavior sequence data included in T″, that is, T′ and T″ are not completely identical. Among them, the behavior sequence data T of any player can be represented as: T = {t1, t2, ..., t8}, T′ can be the view obtained after performing data augmentation processing on {t1, t2, t3, t4, t5} included in the behavior sequence data T of any player; T″ can be the view obtained after performing data augmentation processing on {t3, t4, t5, t6, t7} included in the behavior sequence data T. The timestamps where T′ and T″ intersect include timestamp 3, timestamp 4, and timestamp 5. In other words, T′ and T″ include the same behavioral sequence data t3, t4, and t5. Executing S602 involves performing data augmentation on any behavioral sequence data T in the player's behavioral sequence dataset obtained in S601 to obtain two augmented samples T′ and T″ corresponding to any player's behavioral sequence data T. It can be understood that the behavioral sequence data T of any player before augmentation and the two augmented behavioral sequence data of that player (i.e., T′ and T″) are essentially different versions of the same sample.
[0117] In this embodiment, the data augmentation process described in S602 above should retain the most essential features of the original data. Specifically, the data augmentation process described in S602 may include random pruning and timestamp masking. Therefore, executing S602 may include the following steps: randomly pruning the behavior sequence data T of any player in the player behavior sequence dataset to randomly select two overlapping sub-processing samples. and Where 0 ≤ i1 ≤ i2 ≤ j1 ≤ j2 ≤ |T|, specifically, i1 = 1, i2 = 3, j1 = 5, j2 = 7; |T| represents the length of any action sequence data T, and |T| is specifically equal to 8; the sub-processed samples obtained by random pruning. Perform timestamp masking process 1 to obtain the enhanced sample T′ corresponding to any action sequence data T; process the sub-processed samples obtained by random cropping. Perform timestamp masking processing 2 to obtain the enhanced sample T″ corresponding to any action sequence data T. Here, timestamp masking processing 1 can be understood as sampling processing 1, which includes: processing samples with a probability of 0.5. The behavioral sequence data at each timestamp in the dataset undergoes masking to obtain the enhanced sample T′ corresponding to the behavioral sequence data T. Timestamp masking processing 2 can be understood as sampling processing 2, which includes: processing samples with a probability of 0.2. The behavioral sequence data at each timestamp in the dataset undergoes masking to obtain the enhanced sample T″ corresponding to the behavioral sequence data T. It is understandable that the difference between timestamp masking process 1 and timestamp masking process 2 lies in the different probabilities of the masks. For example, The behavioral sequence data at timestamp 3 in the data can be represented as:
[0118] (a,b,c,d,e,f,r,t,t,e), and The behavioral sequence data at timestamp 3 in the data can be represented as:
[0119] (a,b,c,d,e,f,r,t,t,e). (This is a partial sentence and doesn't need a direct translation.) The timestamp 3 in the above time masking process 1 can obtain the masked behavior sequence data, which can be represented as: (a,0,c,0,e,0,0,t,t,0); for The timestamp 3 in the above timestamp 3, after performing the above timestamp masking process 2, can obtain the masked behavior sequence data, which can be represented as:
[0120] (a,0,c,d,e,0,r,t,t,e), where "0" represents the result after masking.
[0121] S603, based on the enhanced player behavior sequence dataset, construct positive sample pairs and negative sample pairs for the contrastive learning task.
[0122] In this embodiment, a positive sample pair includes two positive samples, both of which are associated with the same player's behavior sequence data. Specifically, a positive sample pair includes enhanced behavior sequence data T′ corresponding to the same player's behavior sequence data in the player's behavior sequence dataset, and behavior sequence data with the same timestamp in the enhanced behavior sequence data T″ corresponding to the same player's behavior sequence data. In this embodiment, for the same player's behavior sequence data, the same timestamps in the enhanced behavior sequence data T′ and enhanced behavior sequence data T″ include: timestamp 3, timestamp 4, and timestamp 5. Based on this, for the same player's behavior sequence data, the same player's behavior sequence data corresponds to 3 positive sample pairs, which are respectively denoted as sample pair 1, sample pair 2, and sample pair 3. Specifically, positive sample pair 1 includes: the behavior data corresponding to timestamp 3 in the enhanced behavior sequence data T′ corresponding to the player's behavior sequence data T, and the behavior data corresponding to timestamp 3 in the enhanced behavior sequence data T″ corresponding to the player's behavior sequence data T. Positive sample pair 2 includes: the behavior data corresponding to timestamp 4 in the enhanced behavior sequence data T′ corresponding to the player's behavior sequence data T, and the behavior data corresponding to timestamp 4 in the enhanced behavior sequence data T″ corresponding to the player's behavior sequence data T. Positive sample pair 3 includes: the behavior data corresponding to timestamp 5 in the enhanced behavior sequence data T′ corresponding to the player's behavior sequence data T, and the representation behavior data corresponding to timestamp 5 in the enhanced behavior sequence data T″ corresponding to the player's behavior sequence data T.
[0123] In this embodiment, a negative sample pair includes one positive sample and one negative sample. The two methods for generating negative sample pairs provided in this embodiment are described below with reference to Implementation Method 1 and Implementation Method 2, respectively.
[0124] Implementation method 1:
[0125] In implementation method one, the positive and negative samples included in the negative sample pair are determined based on the enhanced behavior sequence data corresponding to the behavior sequence data of the same player in the player behavior sequence dataset, and the timestamps corresponding to the positive samples and the negative samples are different.
[0126] In some implementations, the positive and negative samples included in a negative sample pair are determined by the enhanced behavior sequence data T′ corresponding to the behavior sequence data T of the same player in the root player's behavior sequence dataset, and the behavior data with different timestamps in the enhanced behavior sequence data T′. Specifically, when the positive samples included in a negative sample pair are the behavior data corresponding to any one of timestamps 3, 4, or 5 in the enhanced behavior sequence data T′, the negative samples included in the negative sample pair can be the behavior data corresponding to any one of timestamps 1 or 2 in the enhanced behavior sequence data T′. For example, a negative sample pair can be represented as: (behavior data corresponding to timestamp 3 in the enhanced behavior sequence data T′, behavior data corresponding to timestamp 1 in the enhanced behavior sequence data T′).
[0127] Optionally, in other implementations, the positive and negative samples included in the negative sample pair are determined by the enhanced behavior sequence data T″ corresponding to the behavior sequence data T of the same player in the root player's behavior sequence dataset, and the behavior data with different timestamps in the enhanced behavior sequence data T″. Specifically, when the positive sample included in the negative sample pair is the behavior data corresponding to any one of timestamps 3, 4, or 5 in the enhanced behavior sequence data T″, the negative sample included in the negative sample pair can be the behavior data corresponding to any one of timestamps 6 or 7 in the enhanced behavior sequence data T″. For example, a negative sample pair can be represented as: (the behavior data corresponding to timestamp 3 in the enhanced behavior sequence data T′, and the behavior data corresponding to timestamp 6 in the enhanced behavior sequence data T′).
[0128] Implementation Method Two:
[0129] In implementation method two, the positive and negative samples included in the negative sample pair are determined based on the timestamp-identical behavioral data from the enhanced behavioral sequence data of two different players within the enhanced player behavioral sequence dataset. For ease of description, the behavioral sequence data of the two different players are denoted as: T s and T v Where s and v are integers greater than or equal to 1 and less than or equal to 100, and s and v are distinct. Based on this, negative sample pairs are determined according to T. s and T v The data is determined by behavioral data with the same timestamp. Specifically, the positive samples included in the negative sample pair are T. s In the case of the behavior data corresponding to timestamp 3 in the enhanced behavior sequence data, the negative sample pair includes T negative samples. v The corresponding behavior data for timestamp 3 in the enhanced behavior sequence data; the positive samples included in the negative sample pair are T.s In the case of the behavior data corresponding to timestamp 4 in the enhanced behavior sequence data, the negative sample pair includes T negative samples. v The corresponding behavior data for timestamp 4 in the enhanced behavior sequence data; the positive samples included in the negative sample pair are T. s In the case of the behavior data corresponding to timestamp 5 in the enhanced behavior sequence data, the negative sample pair includes T negative samples. v The behavior data corresponding to timestamp 5 in the enhanced behavior sequence data.
[0130] S604 uses positive sample pairs and negative sample pairs from the contrastive learning task to pre-train the neural network model and obtain the initial behavior similarity analysis model.
[0131] The neural network model described in S604 above has encoding capabilities. That is, this neural network model can encode the input training samples to obtain the encoded output. The encoded output is a representation vector (also known as a feature vector). The type of neural network model is not specifically limited and can be selected according to actual needs. In other words, the neural network model described in S604 above can, in principle, be any model that meets the requirements. In practical applications, considering the inherent characteristics of the enhanced behavioral sequence data, the neural network model can be a sequence model. In this embodiment, the neural network model described in S604 above may include the encoder in a Transformer model.
[0132] In the embodiments of this application, performing the above-described S604 may include S604-1 to S604-4. S604-1 to S604-4 will be described below.
[0133] S604-1 uses a neural network model to encode the positive sample pairs and negative sample pairs of the contrastive learning task to obtain the representation vectors corresponding to the positive sample pairs and negative sample pairs of the contrastive learning task.
[0134] The representation vector corresponding to a positive sample pair in a contrastive learning task is also called the feature vector corresponding to the positive sample pair in the contrastive learning task. In other words, the feature vector corresponding to a positive sample pair in a contrastive learning task represents the essential features of the positive sample pair. It can be understood that the representation vector corresponding to a positive sample pair specifically includes the two representation vectors corresponding to the two positive samples included in the positive sample pair. Similarly, the representation vector corresponding to a negative sample pair in a contrastive learning task is also called the feature vector corresponding to the negative sample pair in the contrastive learning task. In other words, the representation vector corresponding to a negative sample pair in a contrastive learning task represents the essential features of the negative sample pair. It can be understood that the feature vector corresponding to a negative sample pair specifically includes the representation vector corresponding to the positive sample in the negative sample pair, and the representation vector corresponding to the negative sample in the negative sample pair.
[0135] S604-2, Based on the representation vectors corresponding to the positive sample pairs and the negative sample pairs of the contrastive learning task, determine the contrastive loss function of the neural network model, wherein the contrastive loss function is determined based on the temporal contrastive loss function and the instance contrastive loss function.
[0136] In this embodiment, the contrastive loss function is determined based on the temporal contrastive loss function and the instance contrastive loss function. That is, in this embodiment, the neural network model performs overall optimization by combining temporal contrastive loss and instance contrastive loss at multiple scales within a hierarchical framework. The contrastive loss function of the neural network model can be expressed by the following formula:
[0137]
[0138] In the above formula (5.1), L represents the contrastive loss function of the neural network model; B represents the player's behavior sequence dataset; T represents the behavior sequence data of any player included in the player's behavior sequence dataset; Represents the time-series comparison loss function; The instance contrast loss function is represented by t; the timestamp t represents any one of the multiple moments corresponding to the multiple behavioral data points included in the behavioral sequence data of any player. The definitions and mathematical expressions of the temporal contrast loss function and the instance contrast loss function provided in the embodiments of this application are described in detail below.
[0139] The temporal contrastive loss function is used to: make the two representation vectors corresponding to the two positive samples in a positive sample pair as similar as possible, and to make the representation vectors of the positive samples and the representation vectors of the negative samples in a negative sample pair determined based on the above implementation method one as dissimilar as possible. Specifically, the physical meaning of the temporal contrastive loss function is: for any player's behavior sequence data in the player's behavior sequence dataset, the representation vectors of the timestamp intersection portion of two augmented samples are as similar as possible (positive sample pair), and the representation vectors of the timestamp intersection portion of the same augmented sample corresponding to the behavior sequence data of that player are as dissimilar as possible to the representation vectors of the same augmented sample excluding the timestamp intersection (i.e., the negative sample pair determined based on the above implementation method one).
[0140] In the embodiments of this application, the above-mentioned time-series contrast loss function This can be expressed by the following formula:
[0141]
[0142] In the above formula (5.2), The temporal comparison loss of the player behavior sequence data T at timestamp t represents the time sequence comparison of any player's behavior sequence data T in the player behavior sequence dataset; Ω represents the two overlapping sub-processing samples described above. and The intersection of timestamps, specifically including the following timestamps: timestamp 3, timestamp 4, and timestamp 5; timestamp t represents any one of the multiple moments corresponding to the multiple behavioral data included in the behavioral sequence data of any player; t′ represents any timestamp in the timestamp intersection; r′t ′ Let r' be the representation vector corresponding to the intersection of timestamps in the augmented sample T' of any player's behavior sequence data T in the player's behavior sequence dataset, or r'. t′ The representation vector r′ is the augmented sample T′ corresponding to any player's behavior sequence data T in the player behavior sequence dataset. t The representation vector corresponding to the intersection of the timestamps; r″ t′ Let r' be the representation vector corresponding to the intersection of timestamps in the augmented sample T'' of any player's behavior sequence data T in the player's behavior sequence dataset, or r'' t′ The representation vector r″ of the augmented sample T″ corresponding to any player's behavior sequence data T in the player behavior sequence dataset. t′ The representation vector corresponding to the intersection of the timestamps; This indicates the indicator function (the value of the exponential function).
[0143] The instance contrast loss function is used to: make the two representation vectors corresponding to the two positive samples in a positive sample pair as similar as possible, and to make the representation vectors of the positive samples and the negative samples in a negative sample pair determined based on the above implementation method two as dissimilar as possible. Specifically, the physical meaning of the instance contrast loss function is: for any player's behavior sequence data in the player's behavior sequence dataset, the representation vectors of the intersection of timestamps in the two augmented samples are as similar as possible (positive sample pair); and for the same player's behavior sequence dataset, the representation vectors of the same timestamp in the augmented samples corresponding to two different samples to be processed are as dissimilar as possible (i.e., negative sample pairs determined based on the above implementation method two).
[0144] In this embodiment, the instance contrast loss function can be expressed by the following formula:
[0145]
[0146] In the above formula (5.3), Let r′ represent the instance contrast loss of behavior sequence T at timestamp t; timestamp t represents any one of the multiple timestamps corresponding to the multiple behavior data included in the behavior sequence data of any player; batch represents the player's behavior sequence dataset; r′ t 、r″ t It is two representation vectors corresponding to the two enhanced behavior sequence data of a player in the player behavior sequence dataset (e.g., T1); and The enhanced representation vector corresponding to the behavior sequence data of another player (e.g., T2) in the player's behavior sequence dataset, wherein the aforementioned behavior sequence data of one player and the behavior sequence data of the other player are behavior sequence data of two different players included in the player's behavior sequence dataset, and the behavior sequence data of these two different players are different.
[0147] S604-3, The parameters of the neural network model are adjusted according to the contrastive loss function of the neural network model, so that the representation vectors of positive sample pairs included in the contrastive loss function are closer to each other, and the representation vectors of negative sample pairs are farther apart.
[0148] Performing S604-3 above may include the following steps: adjusting the parameters of the neural network model based on the results of the contrastive loss function of the neural network model, so that the representation vectors of positive sample pairs in the contrastive loss function of the adjusted neural network model are closer to each other, and the representation vectors of negative sample pairs are farther apart.
[0149] S604-4, until the training stopping condition is met, the pre-training process of the neural network model ends, and the initial behavior similarity analysis model is obtained.
[0150] In this embodiment, the pre-training stopping conditions described in S604-4 are not specifically limited, and can be set according to actual needs. For example, the pre-training stopping conditions described in S604-4 can be, but are not limited to, any of the following: the number of training iterations of the neural network model is greater than a preset number of training iterations, the loss value corresponding to the output result of the neural network model is within a preset error range, or the output result of the neural network model reaches a preset recognition accuracy. The preset number of training iterations, the preset error range, and the preset recognition accuracy can be selected according to actual needs, and this embodiment does not specifically limit them. For example, the preset number of training iterations can be, but is not limited to, 1000 rounds of iterative training.
[0151] The steps S601 to S604 described above constitute the pre-training phase of the neural network model based on the contrastive learning task. Specifically, in the pre-training process described in S601 to S604, a self-supervised (also known as unsupervised) approach is used to pre-train the neural network model to obtain an initial behavioral similarity analysis model. This training process requires unlabeled training data; that is, obtaining the initial behavioral similarity analysis model does not require a large amount of labeled training data, thus solving the problem of difficulty in obtaining large amounts of labeled training data in practical applications.
[0152] Furthermore, to improve the accuracy of the initial behavior similarity analysis model, a small amount of labeled training data can be used to fine-tune the initial behavior similarity analysis model to obtain a new behavior similarity analysis model. During the fine-tuning process, only a small amount of labeled training data is needed, solving the problem of difficulty in obtaining large amounts of labeled training data in relevant scenarios. The following section, in conjunction with S605 to S607, describes the process of fine-tuning the initial behavior similarity analysis model provided by the embodiments of this application.
[0153] S605. Randomly select M players' behavior sequence data from the player behavior sequence dataset B, and label the M players' behavior sequence data to obtain M labeled player behavior sequence data, where M is a positive integer less than B.
[0154] Each labeled player's behavior sequence data represents the corresponding behavior. For example, if a player's behavior data is the behavior of picking up virtual items in the game, the label for that player's behavior sequence data could be the picking-up behavior.
[0155] M is a positive integer less than B and greater than or equal to 2, where the difference between M and B can be greater than a preset threshold. In this embodiment, M can be a number much smaller than B. Specifically, B is 100, and M can be, but is not limited to, 10. That is to say, the value of M is not specifically limited in this embodiment and can be selected according to the actual scenario.
[0156] The random selection method in S605 described above is not specifically limited. The method for labeling the behavior sequence data of the M players is also not specifically limited. For example, the behavior sequence data of the M players can be labeled manually to obtain the behavior sequence data of the M labeled players. It is understood that although the method described in S605 of this application involves a manual labeling process, M is a number much smaller than B. Compared with the traditional method that requires labeling the behavior sequence data of all players included in the player behavior sequence dataset B, this application embodiment only needs to label the behavior sequence data of a small number of M players in the player behavior sequence dataset B. This saves labor costs and also helps improve model training efficiency.
[0157] S606. Construct a training sample set based on the behavioral sequence data of M labeled players.
[0158] In the embodiments of this application, performing the above-described S606 may include S606-1 to S606-3. S606-1 to S606-3 will be described below.
[0159] S606-1, Calculate the similarity between any two player behavior sequence data in M labeled player behavior sequence data according to the Euclidean distance formula.
[0160] The above Euclidean distance formula is the similarity calculation formula. Optionally, in some other implementations, the above Euclidean distance can also be replaced by any of the following similarity calculation formulas: cosine similarity, or Pearson correlation coefficient.
[0161] In this embodiment of the application, the behavior sequence data T of the i-th player in the behavior sequence data of M labeled players is... i And the behavior sequence data T of the j-th player from the behavior sequence data of M labeled players. j Similarity between #D i,j This can be expressed by the following formula, where i and j are integers greater than or equal to 1 and less than or equal to M, and i and j are not equal:
[0162] D i,j=f(T) i ,T j ) Formula (5.4)
[0163] In the above formula (5.4), D i,j Indicates sample T i and sample T j The similarity distance.
[0164] S606-2, Calculate the similarity score matrix between any two players' behavior sequence data in the M labeled player behavior sequence data based on the similarity # between any two players' behavior sequence data in the M labeled player behavior sequence data.
[0165] Performing step S605-2 above, that is, calculating the similarity score matrix between any two players' behavior sequences in the M labeled player behavior sequence data based on the similarity # between any two players' behavior sequence data, can include the following steps: Based on the similarity # between any two players' behavior sequence data in the M labeled player behavior sequence data, the similarity distance matrix D between any two players' behavior sequence data in the M labeled player behavior sequence data can be obtained. i,j The similarity distance matrix D between the behavioral sequence data of any two players i,j After normalization, obtain the similarity distance matrix D between any two players' behavior sequence data from the M labeled player behavior sequence data. i,j The corresponding similarity score matrix. Wherein, D is the similarity distance matrix between any two players' behavior sequence data from the M players' behavior sequence data. i,j The corresponding similarity score matrix S i,j This can be expressed by the following formula:
[0166]
[0167] In formula (5.5) above, α represents the adjustment parameter used to control the scaling ratio of the data; D i,j T represents the behavior sequence data of the i-th player in a set of M labeled player behavior sequence data. i The behavior sequence data T of the j-th player from the behavior sequence data of M labeled players. j The similarity distance between them; D i,m T represents the behavior sequence data of the i-th player in a sample of M labeled player behavior sequence data. i The behavior sequence data of M labeled players, excluding the behavior sequence data of the i-th player, T. iBehavior sequence data T of any player other than m The similarity distance between them.
[0168] S606-3: Based on the similarity score matrix between the behavior sequence data of any two players in the behavior sequence data of M labeled players, process the behavior sequence data of M labeled players to obtain a training sample set.
[0169] In this embodiment, executing S606-3 may include the following steps: traversing the behavior sequence data of M labeled players, using the behavior sequence data A of each player in the M labeled players' behavior sequence data as an anchor point, and selecting the m most similar players' behavior sequence data as a positive sample set P for each player's behavior sequence data A based on the similarity score matrix between any two players' behavior sequence data in the M labeled players' behavior sequence data, and selecting the m least similar players' behavior sequence data as a negative sample set N for each player's behavior sequence data A; wherein, m is a scalar parameter, and the value of m can be adjusted according to business requirements, and the similarity score matrix S of the full sample corresponding to the behavior sequence data of the M labeled players includes: the similarity score matrix between any two players' behavior sequence data in the M labeled players' behavior sequence data; generating m positive sample pairs corresponding to each player's behavior sequence data A based on the m most similar players' behavior sequence data corresponding to each player's behavior sequence data A as the positive sample set P, wherein any positive sample pair among the m positive sample pairs... The training sample set includes the behavior sequence data of two of the m most similar players. It also includes a negative sample set N, based on the behavior sequence data of the m least similar players corresponding to each player's behavior sequence data A, and a positive sample set P, generating m negative sample pairs corresponding to each player's behavior sequence data A. Each of the m positive sample pairs includes the behavior sequence data of one player from the m most similar players and the behavior sequence data of one player from the m least similar players. Any one of the m positive sample pairs corresponding to each player's behavior sequence data A is selected as a training sample in the training sample set, where the label of this training sample indicates that the behavior sequence data of the two players associated with this training sample are similar. Finally, any one of the m negative sample pairs corresponding to each player's behavior sequence data A is selected as a training sample in the training sample set, where the label of this training sample indicates that the behavior sequence data of the two players associated with this training sample are dissimilar.
[0170] S607, Fine-tune the initial behavior similarity analysis model based on the training sample set to obtain the behavior similarity analysis model.
[0171] In this embodiment, performing step S607, which involves fine-tuning the initial behavior similarity analysis model based on the training sample set to obtain the behavior similarity analysis model, may include the following steps: processing the training samples included in the training sample set using the initial behavior similarity analysis model to obtain the predicted training sample results, wherein the predicted training sample results indicate whether the behavior sequence data of two players associated with the training samples predicted by the initial behavior similarity analysis model are similar; fine-tuning the parameters of the initial similarity analysis model based on the difference between the labels of the training samples and the predicted training sample results; and stopping the fine-tuning of the parameters of the initial similarity analysis model until the termination condition of the fine-tuning training is met, thereby obtaining the behavior similarity analysis model.
[0172] The above-mentioned method of processing the training samples in the training sample set using an initial behavior similarity analysis model to obtain the predicted training samples may include the following steps: processing the training samples in the training sample set using the initial behavior similarity analysis model to obtain the representation vectors corresponding to the behavior sequence data of the two players associated with the training sample; calculating the similarity between the representation vectors corresponding to the behavior sequence data of the two players associated with the training sample based on Euclidean distance to obtain the predicted training samples. The representation vectors corresponding to the behavior sequence data of the two players associated with the training sample can be denoted as V. i and V j Based on the Euclidean distance, these two representation vectors V i and V j Perform similarity calculations to obtain the similarity between positive sample pairs included in the player's behavior sequence data pairs; wherein, the similarity between the representation vectors corresponding to the behavior sequence data of two players associated with the training sample (i.e., the result of the pre-trained samples) can be expressed by the following formula:
[0173] g(T i ,T j ) = exp(-Euclidean(V i V j )) Formula (5.6)
[0174] In the above formula (5.6), g(T) i ,T j The similarity between the representation vectors corresponding to the behavior sequence data of two players associated with the training samples is represented by ). Euclidean() is used to calculate the distance between the two vectors in Euclidean space.
[0175] The difference between the results of the training sample labels and the predicted training sample can be represented by a loss function. Specifically, the loss function in the fine-tuning stage can be expressed by the following formula:
[0176] L′=∑ A∈M ∑ l∈P∪N (g(T A ,T l )-f(T A ,T l )) 2 .Formula (5.7)
[0177] In formula (5.7) above, L′ represents the loss function used to describe the difference in similarity # between any two players' behavioral sequence data in M labeled players' behavioral sequence data; g(T A ,T l f(T) represents the predicted result of the training samples; A ,T l ) represents the similarity between any two player behavior sequence data in M labeled player behavior sequence data.
[0178] The termination condition for the above fine-tuning training is not specifically limited and can be set according to actual needs. In some implementations, the termination condition for the above fine-tuning training can be at least one of the following: meeting a preset number of training iterations, meeting a preset training time, or the difference between the label of the training sample and the result of the predicted training sample is less than a preset difference.
[0179] The fine-tuning process described in S607 above can be understood as a regression task (supervised learning), where the goal of this regression task is to use labeled samples to make g(T) more efficient. A ,T l Learn how to fit f(T) A ,T l Specifically, this involves fine-tuning the parameters of the initial behavioral similarity analysis model so that the loss function of the initial behavioral similarity model includes g(T). A ,T l The result should fit f(T) as closely as possible. A ,T l The result, that is, making g(T) A ,T l The results of f(T) and f(T) A ,T l The difference between the results is less than a preset threshold. To make the behavioral similarity analysis model obtained after the fine-tuning stage more accurate, the preset threshold can be as small as possible. For example, the preset threshold can be, but is not limited to, zero.
[0180] In this embodiment, steps S605 to S607, which is the fine-tuning stage of the initial behavior sequence analysis model, are performed. Using a small amount of behavior sequence pairs labeled with selected similarity metrics, supervised learning is conducted based on deep metric learning techniques to fine-tune the initial behavior sequence analysis model to fit the results of the similarity metric calculation. After performing steps S601 to S607, a trained behavior similarity analysis model can be obtained. Next, model inference can be performed using the trained behavior similarity analysis model.
[0181] The following section, in conjunction with S608, introduces the process of performing model inference using a trained behavior similarity analysis model.
[0182] S608: Input the behavioral sequence data of player A and player B into the behavioral similarity analysis model. The behavioral similarity analysis model outputs that the behavioral sequence data of player A and player B are similar.
[0183] Executing S608 above is the stage of applying the trained behavior similarity analysis model. Here, the behavior sequence data of player A described in S608 is a representation vector, and the behavior sequence data of player B is also a representation vector. The behavior sequence data of any one of the players is obtained by performing Word2vec processing on that player's behavior sequence.
[0184] It should be understood that the above Figure 6 The illustrated methods for processing user behavior sequences are merely illustrative and do not constitute any limitation on the methods for processing user behavior sequences provided in the embodiments of this application. For example, the data augmentation processing described above may also include other processing methods besides random pruning and timestamp masking. For example, the Euclidean distance used to calculate similarity above may be replaced by the cosine similarity formula.
[0185] In this embodiment, the "pre-training-fine-tuning" paradigm fully leverages the capabilities of both unsupervised and supervised learning algorithms, simultaneously improving efficiency and accuracy. Specifically, firstly, a large amount of unlabeled behavior sequence data is used for pre-training based on contrastive learning to capture the behavioral patterns inherent in the behavior sequence data. Then, a small amount of behavior sequence pairs labeled with selected similarity metrics are used for fine-tuning based on deep metric learning techniques to fit the results of the similarity metric calculation. Compared to traditional techniques, the method for processing user behavior sequences provided in this embodiment has high computational efficiency and high accuracy in obtaining the user behavior sequence similarity calculation results.
[0186] The above, combined with Figures 1 to 6This paper details the application scenarios applicable to the user behavior sequence processing method provided in this application, as well as the method itself. The following section will combine... Figures 7 to 10 This application introduces the apparatus, training device, and execution device for processing user behavior sequences. It should be understood that the method for processing user behavior sequences described above corresponds to the apparatus, training device, and execution device for processing user behavior sequences described below. Therefore, any content not described in detail below can be found in the relevant descriptions in the above method embodiments.
[0187] Corresponding to the method for processing user behavior sequences provided in the embodiments of this application, the embodiments of this application provide an apparatus for processing user behavior sequences.
[0188] Figure 7 This is a structural diagram of an apparatus for processing user behavior sequences provided in an embodiment of this application. Figure 7 As shown, the apparatus for processing user behavior sequences includes an acquisition unit 701, a first training unit 702, and a second training unit 703.
[0189] The acquisition unit 701 is configured to: acquire a first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; the first training unit 702 is configured to: perform a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model, wherein the first training process includes: performing the first training on the neural network model based on the positive sample pairs and negative sample pairs of the contrastive learning task to obtain the initial similarity analysis model; the second training unit 703 is configured to: perform a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training sample set includes: training samples and training labels, the training samples include any two user behavior sequences from a subset of the multiple user behavior sequences, the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar.
[0190] Optionally, in some implementations, each of the plurality of user behavior sequences includes multiple behavior data corresponding to each user at multiple times. Each user behavior sequence corresponds to at least two augmentation sequences, and the at least two augmentation sequences corresponding to each user behavior sequence are sequences obtained by performing at least two different data augmentation processes on each user behavior sequence. The step of obtaining the first training sample set includes: for a contrastive learning task between the same user behavior sequences, constructing positive sample pairs for the contrastive learning task by taking the behavior data at the same time from the at least two augmentation sequences corresponding to the same user behavior sequence; and constructing positive sample pairs for the at least two augmentation sequences corresponding to the same user behavior sequence by taking the behavior data at the same time from the at least two augmentation sequences. In a strong sequence, behavioral data at different times constitute a first type of negative sample pair, wherein the same user behavior sequence is any one of the plurality of user behavior sequences, and the negative sample pair of the contrastive learning task includes the first type of negative sample pair; for a contrastive learning task between different user behavior sequences, behavioral data at the same time in any one of the at least two augmented sequences corresponding to the first user behavior sequence and any one of the at least two augmented sequences corresponding to the second user behavior sequence constitute a second type of negative sample pair, wherein the plurality of user behavior sequences includes the first user behavior sequence and the second user behavior sequence, and the negative sample pair of the contrastive learning task also includes the second type of negative sample pair.
[0191] Optionally, in some other implementations, the apparatus further includes a processing unit 704, which is configured to: perform the at least two different data augmentation processes on each of the plurality of user behavior sequences before acquiring the first training sample set, to obtain at least two augmented sequences corresponding to each behavior sequence.
[0192] Optionally, in other implementations, the first training unit 702 is further configured to: process the positive and negative sample pairs of the contrastive learning task using the neural network model to obtain the feature vectors of the positive and negative sample pairs of the contrastive learning task; determine the contrastive loss of the contrastive learning task based on the feature vectors of the positive and negative sample pairs of the contrastive learning task; adjust the parameters of the neural network model based on the contrastive loss; and stop adjusting the parameters of the neural network model when the training reaches a first preset training condition to obtain the initial similarity analysis model.
[0193] Optionally, in other implementations, the first training unit 702 is further configured to: determine a temporal contrastive loss based on the feature vectors of the positive sample pairs and the feature vectors of the first type of negative sample pairs in the contrastive learning task, wherein the first type of negative sample pairs are obtained by: for a contrastive learning task between the same user behavior sequences, constructing a first type of negative sample pair by combining behavioral data at different times in at least two augmented sequences corresponding to the same user behavior sequence, wherein the same user behavior sequence is any one of the plurality of user behavior sequences; determine an instance contrastive loss based on the feature vectors of the positive sample pairs and the second type of negative sample pairs in the contrastive learning task, wherein the second type of negative sample pairs are obtained by: for a contrastive learning task between different user behavior sequences, constructing a second type of negative sample pair by combining behavioral data at the same time in any one of at least two augmented sequences corresponding to the first user behavior sequence and any one of at least two augmented sequences corresponding to the second user behavior sequence, wherein the plurality of user behavior sequences includes the first user behavior sequence and the second user behavior sequence; and determine the alignment loss of the contrastive learning based on the temporal contrastive loss and the instance contrastive loss.
[0194] Optionally, in other implementations, the second training unit 703 is further configured to: process the training samples 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 samples; determine a behavior sequence similarity result based on the two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training samples, wherein the behavior sequence similarity result indicates whether any two user behavior sequences in the partial user behavior sequences included in the training samples are similar; adjust the parameters of the initial similarity analysis model based on the difference between the training label and the behavior sequence similarity result; and stop adjusting the parameters of the initial similarity analysis model when the training reaches a second preset training condition, thereby obtaining the similarity analysis model.
[0195] Optionally, in some other implementations, any one of the first preset training conditions and the second preset training conditions may include at least one of the following conditions: the number of training iterations of the model associated with any one preset training condition meets a preset number of training iterations, the training time of the model associated with any one preset training condition meets a preset training time, or the loss result of the model associated with any one preset training condition is less than a preset loss threshold.
[0196] Optionally, in some other implementations, the processing unit 704 is further configured to: before performing a second training on the initial similarity analysis model using the second training sample set to obtain the similarity analysis model, perform the following operations: select the partial user behavior sequences from the behavior sequence dataset; calculate the similarity between any two user behavior sequences in the partial user behavior sequences according to the similarity calculation formula to obtain a similarity label between any two user behavior sequences in the partial user behavior sequences, wherein the similarity label indicates whether any two user behavior sequences in the partial user behavior sequences are similar or dissimilar; determine any two user behavior sequences in the partial user behavior sequences as the training samples, and determine the similarity label between any two user behavior sequences in the partial user behavior sequences as the training label, to obtain the second training sample set.
[0197] Optionally, in other implementations, the method is applied to the gaming field, wherein each of the plurality of user behavior sequences specifically includes: a plurality of behavior data corresponding to a plurality of moments generated by each user during the game, wherein the plurality of moments correspond one-to-one with the plurality of behavior data.
[0198] It should be noted that for a detailed description of the device embodiments provided in this application, please refer to the relevant description in the method for processing user behavior sequences provided in this application, which will not be repeated here.
[0199] Corresponding to the method for processing user behavior sequences provided in the embodiments of this application, the embodiments of this application provide an apparatus for processing user behavior sequences.
[0200] Figure 8 This is a structural diagram of an apparatus for processing user behavior sequences provided in an embodiment of this application. Figure 8 As shown, the device includes an acquisition unit 801 and a processing unit 802.
[0201] The acquisition unit 801 is used to: acquire a first user behavior sequence and a second user behavior sequence; the processing unit 802 is used to: process the first user behavior sequence and the second user behavior sequence using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result indicates whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar.
[0202] It should be noted that for a detailed description of the device embodiments provided in this application, please refer to the relevant description in the method for processing user behavior sequences provided in this application, which will not be repeated here.
[0203] Corresponding to the method for processing user behavior sequences provided in the embodiments of this application, the embodiments of this application provide a training device.
[0204] Figure 9 This is a schematic diagram of the structure of a training device provided in an embodiment of this application. See also... Figure 9 The training device 900 shown can be equipped with training equipment 900. Figure 7 The apparatus for processing user behavior sequences described in the corresponding embodiments is used to implement the above. Figure 3 and Figure 4 The various steps of the described method, and Figure 6 The description outlines the steps of the model pre-training phase and the model fine-tuning phase. Specifically, the training device 900 is implemented by one or more servers. The training device 900 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 922 (e.g., one or more processors) and memory 932, and one or more storage media 930 (e.g., one or more mass storage devices) for storing application programs 942 or data 944. The memory 932 and storage media 930 can be temporary or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the illustration), each module including a series of instruction operations on the training device. Furthermore, the CPU 922 may be configured to communicate with the storage media 930 and execute the series of instruction operations in the storage media 930 on the training device 900.
[0205] The training device 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input / output interfaces 958, and / or one or more operating systems 941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0206] In one embodiment of this application, the central processing unit 922 is used for the functions described above. Figure 3 and Figure 4 The various steps of the described method, and Figure 6 The description details the steps involved in the model pre-training phase and the model fine-tuning phase. The specific method by which the CPU 922 executes these steps is consistent with the above description. Figure 3 and Figure 4 The various steps of the described method, and Figure 6The steps in the model pre-training stage and the steps in the model fine-tuning stage described herein are based on the same concept, and the resulting technical effects are the same as those in this application. Figure 3 and Figure 4 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0207] Corresponding to the method for processing user behavior sequences provided in the embodiments of this application, the embodiments of this application provide an execution device.
[0208] Figure 10 This is a schematic diagram of the structure of an execution device provided in an embodiment of this application. See also... Figure 10 The execution device 1000 shown can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop, a smart wearable device, a monitoring data processing device, or a radar data processing device, etc., and is not limited here. The execution device 1000 may be equipped with... Figure 7 The apparatus for processing user behavior sequences described in the corresponding embodiments is used to implement... Figure 2 and Figure 5 The steps of the described method, and Figure 6 The described method comprises the various steps of the model application phase. Specifically, the execution device 1000 includes: a receiver 1001, a transmitter 1002, a processor 1003, and a memory 1004 (wherein the execution device 1000 may have one or more processors 1003). Figure 10 (Taking a processor as an example), processor 1003 may include application processor 10031 and communication processor 10032. In some embodiments of this application, receiver 1001, transmitter 1002, processor 1003 and memory 1004 may be connected via bus or other means.
[0209] Memory 1004 may include read-only memory and random access memory, and provides instructions and data to processor 1003. A portion of memory 1004 may also include non-volatile random access memory (NVRAM). Memory 1004 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0210] Processor 1003 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.
[0211] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1003. The processor 1003 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 1003 or by instructions in software form. The processor 1003 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1003 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1004. Processor 1003 reads the information in memory 1004 and, in conjunction with its hardware, completes the steps of the above method.
[0212] Receiver 1001 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1002 can be used to output digital or character information through the first interface; transmitter 1002 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1002 may also include a display device such as a display screen.
[0213] In this embodiment of the application application, the application processor 10031 in the processor 1003 is used to execute... Figure 2 and Figure 5 The steps of the described method, and Figure 6The described method outlines the various steps in the model application phase. It should be noted that the specific method by which the application processor 10031 executes each step is similar to that described above. Figure 2 and Figure 5 The steps of the described method, and Figure 6 The various steps in the model application phase of the described method are based on the same concept, and the resulting technical effects are the same as those in this application. Figure 2 , Figure 5 and Figure 6 The corresponding method embodiments are the same, and for details, please refer to the description in the method embodiments shown above in this application, which will not be repeated here.
[0214] This application provides a computer-readable storage medium, which includes computer instructions. When executed by a processor, the computer instructions are used to implement the technical solution of any one of the methods in this application.
[0215] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored on a computer-readable medium and includes several instructions to cause a computing device (which may be a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments disclosed in this application.
[0216] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0217] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0218] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0219] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0220] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A method for processing user behavior sequences, characterized in that, The method includes: Obtain a first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; perform a first training on a neural network model using the first training sample set to obtain an initial similarity analysis model, wherein the first training process includes: performing the first training on the neural network model based on the positive sample pairs and negative sample pairs of the contrastive learning task to obtain the initial similarity analysis model; The first training process further includes: optimizing the parameters of the neural network model using temporal contrast loss and instance contrast loss, including: determining the temporal contrast loss based on positive sample pairs composed of behavioral data at the same time in the augmented sequence corresponding to the same user behavior sequence and negative sample pairs composed of behavioral data at different times; determining the instance contrast loss based on positive sample pairs composed of behavioral data at the same time in the augmented sequence corresponding to the same user behavior sequence and negative sample pairs composed of behavioral data at the same time in the augmented sequences corresponding to different user behavior sequences; performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training process is a supervised training process used to fine-tune the parameters of the initial similarity analysis model; the second training sample set includes: training samples and training labels, wherein the training samples include any two user behavior sequences from a subset of the multiple user behavior sequences, and the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar.
2. The method according to claim 1, characterized in that, Each of the plurality of user behavior sequences includes multiple behavior data corresponding to each user at multiple times. Each user behavior sequence corresponds to at least two augmentation sequences, and the at least two augmentation sequences corresponding to each user behavior sequence are sequences obtained by performing at least two different data augmentation processes on each user behavior sequence. The step of obtaining the first training sample set includes: For the contrastive learning task between the same user behavior sequence, the behavior data with the same time in at least two augmentation sequences corresponding to the same user behavior sequence constitutes the positive sample pair of the contrastive learning task, and the behavior data with different time in at least two augmentation sequences corresponding to the same user behavior sequence constitutes the negative sample pair of the first type. The same user behavior sequence is any one of the multiple user behavior sequences, and the negative sample pair of the contrastive learning task includes the negative sample pair of the first type. For the comparative learning task between different user behavior sequences, the behavior data with the same time in any one of the at least two augmented sequences corresponding to the first user behavior sequence and any one of the at least two augmented sequences corresponding to the second user behavior sequence are constituted as a second type of negative sample pair. The multiple user behavior sequences include the first user behavior sequence and the second user behavior sequence, and the negative sample pair of the comparative learning task also includes the second type of negative sample pair.
3. The method according to claim 2, characterized in that, Before obtaining the first training sample set, the method further includes: Perform the at least two different data augmentation processes on each of the plurality of user behavior sequences to obtain at least two augmentation sequences corresponding to each behavior sequence.
4. The method according to any one of claims 1 to 3, characterized in that, The step of performing a first training on the neural network model using the first training sample set to obtain an initial similarity analysis model includes: The neural network model is used to process the positive and negative sample pairs of the contrastive learning task to obtain the feature vectors of the positive and negative sample pairs of the contrastive learning task. The contrastive loss of the contrastive learning task is determined based on the feature vectors of the positive sample pairs and the feature vectors of the negative sample pairs in the contrastive learning task. The parameters of the neural network model are adjusted based on the contrastive loss. Once the training reaches the first preset training condition, the adjustment of the parameters of the neural network model is stopped, and the initial similarity analysis model is obtained.
5. The method according to claim 4, characterized in that, Determining the contrastive loss for the contrastive learning task based on the feature vectors of the positive sample pairs and the feature vectors of the negative sample pairs includes: Based on the feature vectors of the positive sample pairs and the feature vectors of the first type of negative sample pairs in the contrastive learning task, the temporal contrastive loss is determined, wherein the first type of negative sample pairs are obtained by the following method: for the contrastive learning task between the same user behavior sequences, the behavioral data at different times in at least two augmented sequences corresponding to the same user behavior sequence are used to form the first type of negative sample pairs, wherein the same user behavior sequence is any one of the multiple user behavior sequences; Based on the feature vectors of the positive sample pairs and the second type of negative sample pairs in the contrastive learning task, the instance contrastive loss is determined, wherein the second type of negative sample pairs are obtained by the following method: for the contrastive learning task between different user behavior sequences, the behavior data with the same time in any one of the at least two augmented sequences corresponding to the first user behavior sequence and any one of the at least two augmented sequences corresponding to the second user behavior sequence constitute the second type of negative sample pairs, wherein the plurality of user behavior sequences include the first user behavior sequence and the second user behavior sequence; The alignment loss for the contrastive learning is determined based on the temporal contrast loss and the instance contrast loss.
6. The method according to any one of claims 1-3 or 5, characterized in that, The step of performing a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model includes: The initial similarity analysis model is used to process the training samples to obtain two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training samples; Based on the two feature vectors corresponding to any two user behavior sequences in the partial user behavior sequences included in the training sample, a behavior sequence similarity result is determined, wherein the behavior sequence similarity result indicates whether any two user behavior sequences in the partial user behavior sequences included in the training sample are similar. The parameters of the initial similarity analysis model are adjusted based on the difference between the training labels and the behavioral sequence similarity results. Once the training reaches the second preset training condition, the adjustment of the parameters of the initial similarity analysis model is stopped, and the similarity analysis model is obtained.
7. The method according to claim 6, characterized in that, Either the first preset training condition or the second preset training condition may include at least one of the following conditions: The training times of the model associated with any one of the preset training conditions meet the preset training times, the training time of the model associated with any one of the preset training conditions meets the preset training time, or the loss result of the model associated with any one of the preset training conditions is less than the preset loss threshold.
8. The method according to any one of claims 1-3, 5 or 7, characterized in that, Before performing a second training on the initial similarity analysis model using the second training sample set to obtain the similarity analysis model, the method further includes: Select the portion of user behavior sequences from the behavior sequence dataset; The similarity between any two user behavior sequences in the partial user behavior sequence is calculated according to the similarity calculation formula to obtain a similarity label between any two user behavior sequences in the partial user behavior sequence, wherein the similarity label indicates whether any two user behavior sequences in the partial user behavior sequence are similar or dissimilar. The second training sample set is obtained by determining any two user behavior sequences from the partial user behavior sequences as the training samples and the similarity label between any two user behavior sequences from the partial user behavior sequences as the training label.
9. The method according to any one of claims 1-3, 5 or 7, characterized in that, The method is applied to the gaming industry. Each of the multiple user behavior sequences specifically includes: multiple behavioral data corresponding to multiple moments generated by each user during the game, with each moment corresponding to one of the multiple behavioral data.
10. A method for processing user behavior sequences, characterized in that, The method includes: Obtain the first user behavior sequence and the second user behavior sequence; The first user behavior sequence and the second user behavior sequence are processed using a similarity analysis model to obtain similarity analysis results, wherein the similarity analysis results indicate whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar. The similarity analysis model is obtained by the method described in any one of claims 1-3, 5 or 7.
11. A training device, characterized in that, The device includes: The acquisition unit is configured to: acquire a first training sample set, wherein the first training sample set includes: positive sample pairs and negative sample pairs of a contrastive learning task generated based on a behavior sequence dataset; the behavior sequence dataset includes multiple user behavior sequences; The first training unit is used to: perform first training on a neural network model using the first training sample set to obtain an initial similarity analysis model. The first training process includes: performing the first training on the neural network model based on positive and negative sample pairs from the contrastive learning task to obtain the initial similarity analysis model. The first training process further includes: optimizing the neural network model parameters using temporal contrast loss and instance contrast loss, including: determining the temporal contrast loss based on positive sample pairs composed of behavioral data at the same time in the augmented sequences corresponding to the same user behavior sequence and negative sample pairs composed of behavioral data at different times; and determining the instance contrast loss based on positive sample pairs composed of behavioral data at the same time in the augmented sequences corresponding to the same user behavior sequence and negative sample pairs composed of behavioral data at the same time in the augmented sequences corresponding to different user behavior sequences. The second training unit is used to: perform a second training on the initial similarity analysis model using a second training sample set to obtain a similarity analysis model, wherein the second training process is a supervised training process used to fine-tune the parameters of the initial similarity analysis model; the second training sample set includes: training samples and training labels, wherein the training samples include any two user behavior sequences from a subset of the plurality of user behavior sequences, and the training labels indicate whether any two user behavior sequences from the subset of user behavior sequences are similar; the similarity analysis model is used to determine whether different user behavior sequences are similar.
12. An actuator, characterized in that, The device includes: The acquisition unit is used to: acquire a first user behavior sequence and a second user behavior sequence; The processing unit is configured to: process the first user behavior sequence and the second user behavior sequence using a similarity analysis model to obtain a similarity analysis result, wherein the similarity analysis result indicates whether the first user behavior sequence and the second user behavior sequence are similar or dissimilar; The similarity analysis model is obtained by the method described in any one of claims 1-3, 5 or 7.
13. A training device, characterized in that, The training device includes: a memory and a processor, wherein the memory and the processor are coupled together; The memory is used to store one or more computer instructions; The processor is configured to execute one or more computer instructions to implement the method as described in any one of claims 1-3, 5 or 7.
14. An execution device, characterized in that, The execution device includes: a memory and a processor, wherein the memory and the processor are coupled together; The memory is used to store one or more computer instructions; The processor is used to execute the one or more computer instructions to implement the method as described in claim 10.
15. A computer-readable storage medium storing one or more computer instructions thereon, characterized in that, The instruction is executed by the processor to implement the method as described in any one of claims 1-3, 5, 7, or 10.
Citation Information
Patent Citations
Upper bound substitution method for evaluating matching effect of multi-modal feature embedded pre-training network
CN113158584A
Method and device for processing user behavior sequence
CN114090401A
Video feature extraction method and device and electronic equipment
CN115311595A