Training method of user representation model, user representation method and device

By training the machine learning network with the similarity between user representations, the problem that existing user representation models cannot accurately represent user attributes is solved, resulting in more accurate user representation and improved personalized service experience.

CN115510318BActive Publication Date: 2026-06-30ZHEJIANG E COMMERCE BANK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG E COMMERCE BANK CO LTD
Filing Date
2022-09-22
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing user representation models can only learn user behavior representations and cannot accurately represent user attributes, resulting in insufficient service experience.

Method used

By acquiring sample behavior sequences from multiple users, a pre-defined machine learning network is used to calculate the similarity between user representations. The network is then trained based on the similarity until the training stops, resulting in a user representation model that can accurately represent user attributes.

Benefits of technology

This improves the accuracy of user representation models, enabling determined user representations to better reflect user attributes and enhance the personalization and accuracy of services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510318B_ABST
    Figure CN115510318B_ABST
Patent Text Reader

Abstract

This specification provides a method for training a user representation model, a user representation method, and an apparatus. The method for training the user representation model includes: acquiring sample behavior sequences of multiple users, wherein each user's sample behavior sequence includes behavioral description information of that user at different times; based on the user's sample behavior sequences, using a preset machine learning network, obtaining user representations of each user at different times, and calculating a first similarity between user representations of the same user at different times and a second similarity between user representations of different users; training the preset machine learning network based on the first and second similarities until a training stopping condition is met, thereby obtaining a user representation model. The user representation model trained in this way performs better, and the determined user representations can more accurately and reasonably represent user attributes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of machine learning technology, and in particular to a training method for a user representation model and a user representation method. Background Technology

[0002] With the development of information technology, more and more user services are provided to users through various network platforms such as the Internet. The behavior of users on various network platforms can reflect their personal attributes such as habits and preferences to a certain extent. Therefore, in order to bring users a better service experience, user representation models can be obtained by modeling user behavior sequences. Based on the user representation model, user representations can be determined, and various services can be provided to users based on these user representations.

[0003] However, user representation models obtained through current behavioral sequence modeling methods can only learn user behavioral representations, resulting in a determined user representation that can only represent user behavior and cannot accurately represent user attributes. Therefore, there is an urgent need for a training method to train user representation models so that the user representations output by the model can accurately represent user attributes. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a method for training a user representation model. One or more embodiments of this specification also relate to a user representation method, a user representation model training apparatus, a user representation device, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a method for training a user representation model is provided, comprising:

[0006] Obtain sample behavior sequences from multiple users, where each user's sample behavior sequence includes descriptions of that user's behavior at different times;

[0007] Based on the sample behavior sequences of each user, a preset machine learning network is used to obtain the user representations of each user at different times, and to calculate the first similarity between the user representations of the same user at different times and the second similarity between the user representations of different users.

[0008] Based on the first similarity and the second similarity, the preset machine learning network is trained until the training stops, and a user representation model is obtained.

[0009] According to a second aspect of the embodiments of this specification, a user representation method is provided, comprising:

[0010] Obtain behavioral description information of the target user;

[0011] The behavioral description information is input into the user representation model to obtain the user representation of the target user, wherein the user representation model is trained by the method described in the first aspect above.

[0012] According to a third aspect of the embodiments of this specification, a training apparatus for a user representation model is provided, comprising:

[0013] The first acquisition module is configured to acquire sample behavior sequences of multiple users, wherein the sample behavior sequence of any user includes behavioral description information of that user at different times;

[0014] The calculation module is configured to obtain user representations of each user at different times based on the sample behavior sequence of each user using a preset machine learning network, and to calculate the first similarity between user representations of the same user at different times and the second similarity between user representations of different users.

[0015] The training module is configured to train the preset machine learning network based on the first similarity and the second similarity until the training stops, thereby obtaining a user representation model.

[0016] According to a fourth aspect of the embodiments of this specification, a user characterization device is provided, comprising:

[0017] The second acquisition module is configured to acquire behavioral description information of the target user;

[0018] The acquisition module is configured to input the behavior description information into a user representation model to obtain a user representation of the target user, wherein the user representation model is trained by the method described in the first aspect above.

[0019] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising:

[0020] Memory and processor;

[0021] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the above-described user representation model training method or user representation method.

[0022] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the above-described training method for a user representation model or user representation method.

[0023] According to a seventh aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described user representation model training method or user representation method.

[0024] One embodiment of this specification obtains sample behavior sequences of multiple users, wherein each user's sample behavior sequence includes behavioral description information of that user at different times. Based on the sample behavior sequences of each user, a preset machine learning network is used to obtain user representations of each user at different times, and a first similarity between user representations of the same user at different times and a second similarity between user representations of different users are calculated. Based on the first and second similarities, the preset machine learning network is trained until a training stopping condition is met to obtain a user representation model. That is, in the process of training the user representation model, after determining the user representation based on the sample behavior sequences, the parameters of the user representation model are adjusted by calculating the similarity between user representations of the same user at different times and the similarity between user representations of different users. This allows the user representation model to achieve the effect that the user representations of the same user at different times are relatively similar, and the user representations of different users are relatively different. Therefore, the user representations determined based on this user representation model can more accurately and reasonably represent user attributes, that is, the trained user representation model has a better effect. Attached Figure Description

[0025] Figure 1 This is a flowchart illustrating a user representation model training method and a user representation method under a user representation system architecture provided in an embodiment of this specification.

[0026] Figure 2 This is a flowchart of a training method for a user representation model according to an embodiment of this specification;

[0027] Figure 3 This is a data flow diagram of a training method for a user representation model provided according to an embodiment of this specification;

[0028] Figure 4 This is a flowchart illustrating the processing steps of a user representation model training method according to an embodiment of this specification.

[0029] Figure 5 This is a data flow diagram of a training method for another user representation model provided according to an embodiment of this specification;

[0030] Figure 6 This is a flowchart of a user representation method provided according to an embodiment of this specification;

[0031] Figure 7 This is a schematic diagram of the structure of a training device for a user representation model according to an embodiment of this specification;

[0032] Figure 8 This is a schematic diagram of a user characterization device provided according to an embodiment of this specification;

[0033] Figure 9 This is a structural block diagram of a computing device provided according to one embodiment of this specification. Detailed Implementation

[0034] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0035] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0036] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0037] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0038] Behavioral sequence: A sequence of user actions such as clicking, sharing, commenting, and browsing on an App (Application) or web platform.

[0039] Embedding: A common layer in deep learning network models, primarily used to handle vector representations of sparse features. It not only solves the length problem of one-hot encoded vectors but also represents the similarity between features.

[0040] Self-supervised learning: an unsupervised learning approach that uses an auxiliary task (pretext) to mine its own supervisory information from large-scale unsupervised data. The network is then trained using this constructed supervisory information, thereby learning representations that are valuable for downstream tasks.

[0041] Hyperbolic space: A manifold space with constant negative curvature.

[0042] Self-attention mechanism: A variant of the attention mechanism, self-attention reduces reliance on external information and is better at capturing the internal correlations of data or features. In text processing, self-attention primarily addresses long-distance dependencies by calculating the mutual influence between words.

[0043] Behavioral description information: Information used to describe user behavior, which can be text information.

[0044] Behavioral sequence modeling plays a crucial role in many scenarios, such as ad placement. However, most current modeling solutions are task-specific, such as DIN (Deep Interest Network) and DIEN (Deep Interest Evolution Network). While these task-specific models are effective in their respective scenarios, they lack generality, and the frequent design and training of models represents a significant waste of human and computational resources. Furthermore, as data accumulates over time, much of it lacks labeling information, rendering much of the unlabeled data unusable in specific scenarios.

[0045] Currently, many projects frequently launch different activities during daily operations and major promotions (e.g., daily activities are launched every 2-3 weeks, and major promotions are launched every 1-2 months). The current approach is to model each activity separately, which faces two long-term problems: (1) Small sample size problem. Many activities have short launch periods (especially during major promotions), requiring modeling based on the limited amount of data accumulated online to improve project effectiveness; however, behavioral features, as an important component of marketing features, often have characteristics such as numerous behaviors and severe long-tail distribution, making it difficult to learn their effective representations when directly used for small sample modeling. (2) High training resource consumption. Each activity model is trained from 0 to 1, requiring an average of 6-12 hours per model.

[0046] The PeterRec (pre-trained + transfer learning) method proposes a general algorithmic framework for representation transfer, utilizing transfer learning to propagate user information across domains. However, the pre-trained model primarily focuses on representing behavior, resulting in relatively low accuracy of user representations. Furthermore, the pre-trained model needs to be retrained for new tasks. This approach fails to enable rapid reuse of defined user representations in downstream tasks, still requiring significant storage and computational resources from downstream tasks.

[0047] Schemes based on BERT, primarily inspired by pre-training in the field of NLP (Natural Language Processing), utilize two loss calculation methods—Masked Language Modeling (Masked Language Modeling, predicting masked words) and Next Sentence Prediction (NSP)—for self-supervised training to obtain user representations. A drawback of this approach is that the loss design is mainly determined based on behavioral representations, focusing instead on the accuracy of behavioral representations rather than the representation of user attributes.

[0048] SUMN is a self-supervised training scheme that uses text data from all items clicked by a user to build a model. Based on the assumption of behavioral consistency, it uses text data representations from a certain period to predict text data from the next period. The drawback of this method is that it uses text representations to define behavior, making it difficult to apply to other scenarios. For example, in the e-commerce domain, some behaviors may contain dense data such as monetary amounts, which are difficult to represent. Furthermore, this scheme still focuses on representing the behavior itself, rather than representing user attributes.

[0049] Therefore, this specification provides a method for training a user representation model, which can solve the above-mentioned technical problems. For specific implementation details, please refer to the relevant descriptions of the following embodiments.

[0050] This specification provides a method for training a user representation model. It also relates to a user representation method, a user representation model training device, a user representation device, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0051] See Figure 1 , Figure 1 This document illustrates a training method for a user representation model under a user representation system architecture, and a flowchart of the user representation method, according to an embodiment of this specification.

[0052] The system may include a training terminal 101 and an application terminal 102. The training terminal 101 is used to execute the training method of the user representation model, and the application terminal 102 is used to execute the user representation method. The training terminal 101 and the application terminal 102 may be integrated in the same computing device or in different independent computing devices. This application embodiment does not limit this.

[0053] The aforementioned computing device can be a terminal or a server. The terminal can be any electronic product that can interact with the user. The server can be a single server, a server cluster consisting of multiple servers, or a cloud computing service center. This application embodiment does not limit the specific type of server.

[0054] In one or more embodiments of this specification, the training method of the user representation model and the user representation method are described using the example of a computing device being a server and the training end 101 and the application end 102 being integrated in the same server.

[0055] The training end 101 obtains sample behavior sequences of multiple users stored in the server. Each user's sample behavior sequence includes behavioral description information of the user at different times. The sample behavior sequences of each user are input into a preset machine learning network to obtain user representations of each user at different times. The first similarity between user representations of the same user at different times and the second similarity between user representations of different users are calculated. Based on the first similarity and the second similarity, the preset machine learning network is trained until the training stopping condition is met to obtain a user representation model. The user representation model is then sent to the application end 102.

[0056] After receiving the user representation model, the application 102 stores it. When the application is in use, it obtains the behavioral description information of the target user stored in the server and inputs the behavioral description information into the user representation model to obtain the user representation of the target user.

[0057] It should be noted that the training end can also obtain sample behavior sequences of multiple users from the existing historical behavior database, and the application end can also obtain the behavior description information of the target user from the terminal. This application embodiment does not limit this.

[0058] The scheme applied in the embodiments of this specification, during the training of the user representation model, after determining the user representation based on the sample behavior sequence, adjusts the parameters of the user representation model by calculating the similarity between the user representations of the same user at different times and the similarity between the user representations of different users. This enables the user representation model to achieve the effect that the user representations of the same user at different times are relatively similar, and the user representations of different users are relatively different. That is, the user representation model trained has a better representation effect. Therefore, the user representation of the target user determined based on the user representation model can obtain a more accurate and reasonable representation of user attributes.

[0059] See Figure 2 , Figure 2 A flowchart is shown of a training method for a user representation model according to an embodiment of this specification, which specifically includes the following steps.

[0060] Step 202: Obtain sample behavior sequences of multiple users, wherein the sample behavior sequence of any user includes description information of the user's behavior at different times.

[0061] In some embodiments of this specification, a user's sample behavior sequence is a set of behavioral description information for that user, and the behavioral description information in this set is arranged according to the time point in time when the behavior it represents occurred. Furthermore, the user's behavioral description information can be information generated by operations performed by the user in any item of any app.

[0062] It should be noted that the user-related information (including but not limited to user behavior description information) and user-related data involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by all parties.

[0063] Among these, behavioral description information is used to describe user behavior, and can be text information (such as a piece of text). Furthermore, behavioral description information can include the target of the described behavior, the time when the behavior occurred, and the result of the behavior. Alternatively, behavioral description information may not include the time when the behavior occurred, but it can carry a timestamp. For example, behavioral description information could be "The user purchased product A at 19:26" or "The user purchased a quantity of n resources in project A," etc.

[0064] In some embodiments, behavioral description information represents the behavior generated by a user performing operations on a platform that provides services to the user, such as software, applications, or web pages. Therefore, behavioral description information can be obtained from the backend servers of these platforms used by the user, from the terminals that host these platforms, or from existing historical behavior databases. This application embodiment does not limit this.

[0065] Furthermore, after a user performs an action and generates a behavior, the behavior description information is stored in the backend server, terminal, and historical behavior database. The behavior description information can be sorted according to the time point when the behavior occurs. Therefore, when obtaining sample behavior sequences, it is not necessary to sort the behavior description information, and the sample behavior sequences can be obtained quickly.

[0066] In one or more embodiments of this specification, before training the user representation model, it is necessary to obtain training samples (sample behavior sequences of multiple users) to provide data support for model training.

[0067] Step 204: Based on the sample behavior sequence of each user, use a preset machine learning network to obtain the user representation of each user at different times, and calculate the first similarity between the user representations of the same user at different times, and the second similarity between the user representations of different users.

[0068] In the embodiments of this specification, after obtaining sample behavior sequences of multiple users, a preset machine learning network is trained based on these sample behavior sequences to obtain a user representation model. During training, the model parameters need to be adjusted to ensure that the user representations output by the model better reflect the actual user. Therefore, the sample behavior sequences of users can be input into the preset machine learning network to obtain user representations for each user at different times. The user representations determined for the same user should be relatively similar, while the user representations determined for different users should differ significantly. Therefore, a first similarity between user representations of the same user at different times and a second similarity between user representations of different users can also be calculated.

[0069] In one or more embodiments of this specification, the specific implementation of obtaining user representations of each user at different times using a preset machine learning network based on the sample behavior sequences of each user may include:

[0070] Using a pre-defined machine learning network, based on the behavioral description information in the sample behavioral sequence of the first user, a behavioral representation sequence corresponding to the first user is obtained, where the first user is any one of multiple users;

[0071] Based on the behavioral representation sequence, determine the user representation of the first user at different times.

[0072] In other words, for any user among multiple users, the corresponding behavioral representation sequence can be determined based on the behavioral description information in the user's sample behavioral sequence. Since the performance of the user representation model needs to be verified based on the user's user representation at different times, the user representation of the user at different times can be determined based on the behavioral representation sequence. Based on this, the user representation of each user among multiple users at different times can be determined.

[0073] As an example, a behavioral representation sequence includes multiple behavioral representations, each corresponding to a behavioral description, and the multiple behavioral representations are arranged in the behavioral representation sequence according to the order of their corresponding behavioral descriptions in the sample behavioral sequence.

[0074] In one possible implementation of this specification, for any behavior description information in the sample behavior sequence of the first user, multiple characters in the behavior description information can be encoded or vectorized. Then, the processing results of the multiple characters are concatenated or summed to obtain the behavior representation of the behavior description information. After applying the above encoding method to each behavior description information in the sample behavior sequence, the behavior representation of each behavior description information in the sample behavior sequence can be determined. According to the order of the multiple behavior description information in the sample behavior sequence, the behavior representations of the multiple behavior description information are concatenated to obtain the behavior representation sequence of the sample behavior sequence, that is, the behavior representation sequence corresponding to the first user. In this method, directly determining the behavior representation as the user representation can improve the efficiency of determining the user representation.

[0075] It should be noted that one-hot encoding, word2vec, or other encoding methods can be used to encode the characters in the behavior description information, and this application embodiment does not limit this.

[0076] In another possible implementation of this specification, keywords can be extracted from the behavioral description information, then encoded or vectorized. The processing results are then concatenated or summed to obtain the behavioral representation of the behavioral description information. Concatenating the behavioral representations of each behavioral description information yields the behavioral representation sequence corresponding to the first user. This implementation can filter out useless words that are not helpful to the behavioral representation or may affect its accuracy, thus reducing the encoding workload, improving the efficiency of determining the behavioral representation, and also improving the accuracy of the determined behavioral representation.

[0077] As an example, after determining the behavioral representation sequence, since the sequence includes multiple behavioral representations, each behavioral representation corresponds to a behavioral description, each behavioral description describes a behavior, and each behavior necessarily corresponds to a time when that behavior occurred. Therefore, the behavioral representation sequence can be understood as the user's behavioral representations at different times. The behavioral representations of the first user at different times can be determined as the user representations of the first user at different times. For example, assuming the sample behavioral sequence includes behavioral descriptions of the first user's actions at 9:00, 12:00, 18:30, and 20:00, then the user representations of the first user at 9:00, 12:00, 18:30, and 20:00 can be determined respectively.

[0078] In the embodiments of this specification, the behavioral representation of each behavioral description information is determined based on the keywords in the sample behavioral sequence, thereby obtaining the user's behavioral representation at different times. Then, the sequence of behavioral representations at different times is determined as the user's user representation at different times, which can quickly and accurately determine the user's user representation at different times.

[0079] In another possible implementation of this specification, the preset machine learning network may include a feature extraction layer; in this case, the specific implementation of obtaining the behavior representation sequence corresponding to the first user based on the behavior description information in the sample behavior sequence of the first user using the preset machine learning network may include:

[0080] Using a feature extraction layer, features are extracted from each behavior description information in the sample behavior sequence of the first user to obtain the initial behavior representation sequence corresponding to the first user. The initial behavior representation sequence includes the initial behavior representation corresponding to each behavior description information.

[0081] Determine the time interval between the first line of description information and the second line of description information to obtain the time representation of the time interval, wherein the first line of description information is any one in the sample behavior sequence, and the second line of description information is one in the sample behavior sequence that is temporally adjacent to the first line of description information;

[0082] The time representation and the initial behavior representation corresponding to the first behavior description information are fused to obtain the behavior representation corresponding to the first behavior description information.

[0083] Based on the behavioral representations corresponding to each behavioral description information, the behavioral representation sequence corresponding to the first user is obtained.

[0084] In other words, for the first user among multiple users, the sample behavior sequence of the first user can be input into the feature extraction layer of a pre-defined machine learning network. The feature extraction layer extracts features from the behavioral description information in the sample behavior sequence to obtain the initial behavioral representation of each behavioral description. Since some behaviors are executed at short intervals and others at long intervals, the user attributes reflected may differ significantly or even be opposite. Therefore, the time interval feature can be incorporated into the initial behavioral representation to obtain the behavioral representation corresponding to each behavioral description, and thus obtain the behavioral representation sequence corresponding to the user.

[0085] In some embodiments of this specification, the feature extraction layer can be any network layer in a machine learning network that has feature extraction capabilities, used to map the input to a vector space to obtain the output. This feature extraction layer can be an embedding layer, an encoding layer, etc., and this application does not limit this. After inputting the sample behavior sequence into the feature extraction layer, for any behavior description information in the sample behavior sequence, the behavior description information can first be segmented into multiple characters. Then, useless words in the multiple characters are filtered out. The remaining characters after filtering are encoded or vectorized to obtain the representation of each remaining character. By concatenating or adding the representations of the remaining characters, the initial behavior representation of the behavior description information can be obtained.

[0086] However, in practical applications, for example, in e-commerce advertising scenarios, the time interval between actions is often negligible because users access such platforms frequently. Although the time intervals between actions differ, the difference is small and has little impact on the representation of user attributes. However, in financial scenarios, the same two actions, one day apart and one month apart, are very different. For example, consider the actions of subscribing to and redeeming resources in Project A. User A subscribed to resource x on January 1st and redeemed resource x on January 2nd. User B subscribed to resource y on January 1st and redeemed resource y on February 1st. Without considering the time interval, the machine learning network might learn that user A and user B have similar attributes. However, redeeming resources one day apart and redeeming resources one month apart are completely different habits; that is, user A and user B's financial habits may be completely opposite. This could lead to inaccurate user representations. Therefore, the time interval between actions should be considered when determining behavioral representations.

[0087] In some embodiments of this specification, the second description information may be the preceding behavior description information adjacent in time to the first description information, meaning the first description information is not the first in the sample behavior sequence. The second description information may also be the following one adjacent in time to the first description information, meaning the first description information can be any one in the sample behavior sequence. Furthermore, the behavior description information may include the time point in time at which the described behavior occurs. Therefore, for the first behavior description information in the sample behavior sequence, the time interval between the first and second behavior description information can be determined first based on the time points in the first and second behavior description information. Then, the time interval is encoded or vectorized to obtain a time representation of the time interval. This time representation is added to the initial behavior representation corresponding to the first behavior description information to obtain the behavior representation corresponding to the first behavior description information. Through this method, the behavior representation corresponding to each behavior description information can be determined. By concatenating the behavior representations corresponding to each behavior description information, the behavior representation sequence corresponding to the first user can be obtained.

[0088] As an example, a base embedding can be pre-set. After obtaining the time interval, the time interval is normalized. The product of the normalized time interval and the base embedding is determined as the time representation of the time interval. Then, the time representation is added to the initial behavior representation of the first line of description information to obtain the behavior representation of the first line of description information.

[0089] As an example, since adding vectors with different dimensions may lead to errors, before adding the time representation to the initial behavioral representation of the first behavioral description information, the time representation and the initial behavioral representation can be adjusted to representations with the same dimension, and then the feature values ​​at the corresponding positions are added to obtain the behavioral representation.

[0090] For example, if the basic time code is the time code corresponding to a time interval of 1 day and the basic time code is a 10-dimensional vector, then if the time interval is 5 days, multiplying the basic time code by 5 can determine the time representation (10-dimensional vector) of the time interval of 5 days. Assuming that the initial behavioral representation of the first row of descriptive information is a 12-dimensional vector, the initial behavioral representation can be sampled to obtain the initial behavioral representation represented by a 10-dimensional vector. Adding the two 10-dimensional vectors can obtain the behavioral representation of the first row of descriptive information.

[0091] For example, suppose the first action description is "the user spends 1k at the fresh food supermarket", and the previous action description, i.e. the second action description, is "the user stores 10k in the bank card". The interval between these two actions is 10 days. The preset time encoding is the base embedding. After normalizing the interval time, multiplying it by the base embedding, we get the time representation of the 10-day time interval. Adding this time representation to the initial action representation of the first action description, we can get the action representation of the action "the user spends 1k at the fresh food supermarket".

[0092] In one or more embodiments of this specification, feature extraction is first performed on the behavioral description information through a feature extraction layer to obtain an initial behavioral representation. Then, the time interval between each behavioral description information and the adjacent behavioral description information is fused into the initial behavioral representation to obtain the behavioral representation of each behavioral description information. This achieves the effect of effectively representing the time interval in the behavioral representation. Furthermore, by combining the time interval between behaviors to determine the behavioral representation, the obtained behavioral representation can represent the user's habits or preferences in different situations. In other words, the obtained behavioral representation can more accurately represent user attributes and improve the accuracy of determining the behavioral representation.

[0093] In other embodiments of this specification, the specific implementation of using a feature extraction layer to extract features from the behavioral description information in the sample behavioral sequence of the first user to obtain the initial behavioral representation sequence corresponding to the first user may include:

[0094] Extract the numeric characters from the description information in the first line;

[0095] Discretize the numeric characters to obtain their initial representations, and encode the non-numeric characters to obtain their initial representations as well.

[0096] Based on the initial representations of numeric and non-numeric characters, the initial behavior representation corresponding to the first row of descriptive information is determined;

[0097] Based on the initial behavior representations corresponding to each behavior description information, the initial behavior representation sequence corresponding to the first user is obtained.

[0098] In one or more embodiments of this specification, since numeric characters are continuous and cannot be directly encoded or vectorized, the numeric characters in the first row of description information can be discretized to obtain the initial representation of the numeric characters. For non-numeric characters, the initial representation can be directly encoded. Then, the initial representations of numeric characters and non-numeric characters are concatenated or added together to obtain the initial behavioral representation of the first row of description information. Then, the initial behavioral representations corresponding to each behavioral description information are concatenated according to the order of the behavioral description information in the sample behavioral sequence to obtain the initial behavioral representation sequence corresponding to the first user.

[0099] In some embodiments, after inputting the sample behavior sequence of the first user into the feature extraction layer, keywords can be extracted from the behavior description information based on a preset keyword library. Numeric characters in the behavior description information can be directly identified as keywords. Then, the numeric characters in the keywords are discretized, and the non-numeric characters in the keywords are encoded to obtain the initial behavior representation of the behavior description information. The preset keyword library can be a pre-set lexicon containing keywords, where the keywords are determined empirically.

[0100] As an example, discretizing numeric characters can be done by first performing a logarithmic operation on the numeric character, then rounding the result, and finally vectorizing the rounded result to obtain the initial characteristics of the numeric character. For example, assuming the numeric character is 12.34, the discretization result is round(log12.34), where round() represents rounding the number in parentheses to the nearest integer. Vectorizing this result yields the initial representation of the numeric character. Encoding non-numeric characters can be achieved using one-hot encoding or word2vec encoding methods.

[0101] For example, assuming the behavioral description information is "the user subscribed to 10k in project A", the keywords can be extracted to include "project A", "subscription" and "10k". This can be simply encoded as "project A × subscription × log round(12.34)" and then the three keywords can be mapped to the vector space to obtain the initial representation of each keyword. By concatenating or summing the initial representations of the three keywords, the initial behavioral representation of the behavioral description information can be obtained.

[0102] In one or more embodiments of this specification, since some domains include unique behaviors, these unique behaviors may contain dense data such as numbers. For such dense data, it is necessary to first discretize it, and then perform embedding mapping on the processing result. Based on the embedding mapping of data characters (initial representation) and the embedding mapping of non-numeric characters (initial representation), the behavioral representation of the behavioral description information can be determined. Therefore, this method can process behaviors in various scenarios or domains, and the model obtained based on this can be applied to various scenarios, reducing the limitations of the model and making its application more widespread. For example, the financial field contains dense data such as monetary amounts, and this solution can map this type of data into vector representations.

[0103] In the above implementation, after determining the behavioral representation sequence based on the sample behavioral sequence, the behavioral sequences at different times are determined as the user representations of the user at different times. However, in practical applications, in order to make the determined user representations more accurate and reasonable, the user representation can be determined based on the user's behavioral representations over a period of time. That is, after determining the user representations of the first user at different times based on the behavioral representation sequence, the process also includes: fusing the user representations of the first user within a preset time period to obtain the user representation of the first user within the preset time period.

[0104] The preset time period can be set according to actual needs or by default by the computing device; this application embodiment does not limit this. For example, the preset time period can be 1 month, 1 day, 10 days, etc.

[0105] In some embodiments of this specification, sample behavior sequences of a first user in multiple historical time periods can be obtained, and then the user representations of the first user in a preset time period can be added together or averaged to obtain the user representation of the first user in the preset time period.

[0106] For example, multiple months of sample behavior sequences of user A are obtained, the behavioral representation of each behavioral description information in the sample behavior sequence is determined, and the behavioral representation of the behavioral description information within the same month is fused together with one month as a preset time period to obtain the user representation of user A based on the behavior of that month.

[0107] In one or more embodiments of this specification, after determining the user representation of a user at different times, the user representations within a preset time period can be fused to obtain the user representation of the user within the preset time period. This user representation incorporates more behavioral representations, has higher accuracy, and can better represent the user.

[0108] In other embodiments of this specification, the specific implementation of fusing the user representation of the first user within a preset time period to obtain the user representation of the first user within the preset time period may include: performing self-attention calculation on the user representation of the first user within the preset time period to obtain the user representation of the first user within the preset time period.

[0109] In other words, the self-attention mechanism can be used to perform self-attention calculation on each user representation within a preset time period, and multiple user representations can be merged together to represent a single user representation. This user representation is then the user representation of the first user within the preset time period.

[0110] As an example, the user representation model also includes a self-attention layer. The user representation of the first user within a preset time period is input into the self-attention layer for self-attention calculation, yielding outputs for each user representation. Each user representation's output not only represents its own behavior but also other behaviors. The user representation for the preset time period can be randomly selected from multiple outputs, or the last output in the sorted list can be chosen, or multiple outputs can be processed to obtain the user representation for the preset time period. Processing multiple outputs can include summing or averaging.

[0111] For example, assuming the preset time period is January 2nd, and there are 10 behaviors within the preset time period, there are 10 user representations corresponding to the preset time period. These 10 user representations are input into the self-attention layer for self-attention calculation, resulting in 10 new representations. One of the 10 new representations can be randomly selected as the user representation of the user on January 2nd, or the sum or average of the 10 new representations can be used as the user representation of the user on January 2nd, or the 10th new representation can be used as the user representation of the user on January 2nd.

[0112] It should be noted that the temporal representation in each user representation can be used as the position embedding (position feature) in the self-attention layer to participate in the self-attention operation.

[0113] In one or more embodiments of this specification, by capturing the correlation between user representations at different times through self-attention calculation, user representations with better representation performance within a preset time period can be obtained.

[0114] In some embodiments of this specification, the user representation of the first user within a preset time period conforms to a preset distribution pattern. In this case, a special method is required to process the user representation. Therefore, the specific implementation of performing self-attention calculation on the user representation of the first user within the preset time period to obtain the user representation of the first user within the preset time period may include:

[0115] The user representation of the first user within a preset time period is mapped to the target data space corresponding to the preset distribution pattern to obtain the enhanced user representations of the first user within the preset time period; self-attention calculation is performed on the enhanced user representations of the first user within the preset time period to obtain the user representation of the first user within the preset time period.

[0116] The preset distribution pattern can be a power-law distribution, and the target data space can be any space capable of processing data that conforms to a power-law distribution; for example, the target data space can be a hyperbolic space. The fact that the user representation of the first user within a preset time period conforms to the preset distribution pattern can be understood as the first user's behavior within the preset time period conforming to the preset distribution pattern.

[0117] In other words, if the user representation of the first user within a preset time period conforms to a preset distribution pattern, before performing self-attention calculation on each user representation within the preset time period, it is necessary to first map the user representation to the target data space corresponding to the preset distribution pattern to obtain an enhanced user representation. Then, perform self-attention calculation on the enhanced user representation to obtain the user representation of the first user within the preset time period.

[0118] As an example, user representations within a preset time period can be mapped to hyperbolic space. Compared to other spaces, hyperbolic space can better represent data that conforms to a power-law distribution. Furthermore, hyperbolic space can represent hierarchical information between data. In this scheme, hierarchical information can be understood as the number of times a behavior is executed. That is, the enhanced user representation obtained after mapping to hyperbolic space has increased hierarchical information representation compared to the user representation before mapping. It can represent the number of times a behavior is executed, thus better representing user attributes. Then, by inputting each enhanced user representation into a self-attention layer for self-attention calculation, the user representation of the first user within the preset time period can be obtained. This user representation can better represent user attributes.

[0119] Alternatively, if we consider the sample behavior sequences of multiple users as a whole, the user behavior exhibits a power-law distribution, meaning that a small portion of the behavior is performed by most users, while a large portion of the behavior is performed by only a small portion of users. In this case, after determining the behavioral representation of the behavioral description information in this scheme, the behavioral representations can be mapped to a hyperbolic space, and then self-attention calculation can be performed to obtain the user representation for a preset time period.

[0120] In one or more embodiments of this specification, user representations exhibiting power-law distribution are first mapped to hyperbolic space to obtain enhanced user representations, and then self-attention calculation is performed based on the enhanced user representations to obtain user representations for a preset time period. Since hyperbolic space can better represent data exhibiting power-law distribution, the mapped result can represent more information. Therefore, mapping to hyperbolic space before determining the user representation for the preset time period can yield more accurate and robust user representations.

[0121] In one or more embodiments of this specification, after determining the user representation of a user at different times or preset time periods, a first similarity between the user representations of the same user at different times or different preset time periods, and a second similarity between different users, can be calculated so as to adjust the parameters of the machine learning network based on the first similarity and the second similarity.

[0122] In this step, the sample behavior sequence is input into a preset machine learning network. First, the feature extraction layer extracts behavioral representations of the behavioral description information. Then, each behavioral representation within a preset time period is mapped to hyperbolic space to obtain an enhanced behavioral representation. Self-attention is then performed on each enhanced behavioral representation through a self-attention layer to obtain the user representation of the user within the preset time period. This user representation is more accurate and can better represent user attributes. Then, the first similarity between user representations of the same user at different times and the second similarity between user representations of different users are calculated. By learning the relationship between users, the preset machine learning network can ultimately achieve a high similarity between user representations of the same user and a low similarity between user representations of different users. The user representation model trained in this way can better represent user attributes when applied.

[0123] Step 206: Based on the first similarity and the second similarity, train the preset machine learning network until the training stopping condition is met to obtain the user representation model.

[0124] In some embodiments of this specification, a loss value can be determined based on a first similarity and a second similarity. Then, a preset machine learning network can be trained based on this loss value until a training stopping condition is met. If the first similarity is higher and the second similarity is lower, the loss value will be lower. Therefore, the training stopping condition can be that the loss value is less than a preset loss threshold. Alternatively, the training stopping condition can also be that the number of training iterations reaches a preset number of iterations threshold. Both the preset loss threshold and the preset number of iterations threshold can be set according to actual conditions or can be default settings of the computing device; this application does not limit these settings.

[0125] As an example, for a first user, a first similarity between the user representations of the first user at two different times can be determined, and a second similarity between the user representations of the first user and other users can be determined. Then, a loss value is determined based on the first similarity and multiple second similarities. After performing the same operation for each user, multiple loss values ​​can be obtained. Then, a preset machine learning network is trained based on the sum of multiple loss values ​​until the training stopping condition is reached.

[0126] For example, since the purpose of training the user representation model is to make the user representation model represent the same user in a similar way, the second similarity can be the similarity between the user representations of the first user and other users at the same time, or it can be the similarity between the user representations at different times.

[0127] In one or more embodiments of this specification, calculating a first similarity between user representations of the same user at different times and a second similarity between user representations of different users includes:

[0128] Based on the user representation of the first user at any two different times, calculate the first user representation difference information in the time dimension to obtain the first similarity, where the first user is any one of multiple users; based on the user representation of each user, calculate the second user representation difference information in the spatial dimension between the first user and other users to obtain the second similarity.

[0129] In this case, the specific implementation of training the preset machine learning network based on the first similarity and the second similarity may include:

[0130] The loss value is calculated based on the ratio of the first similarity to the second similarity; the preset machine learning network is then trained based on the loss value.

[0131] In some embodiments, the first user representation difference information in the time dimension can be the similarity between the first user's user representations at two different times, or it can be a smoothed similarity. The second user representation information between the first user and other users in the spatial dimension can be the similarity between the first user and other users' user representations at the same time or different times, or it can be a smoothed similarity.

[0132] In some embodiments, the loss value may be the quotient of the first similarity divided by the second similarity, or the quotient of the second similarity divided by the first similarity.

[0133] As an example, taking the loss value as the quotient of the first similarity divided by the second similarity, the loss value can be calculated using the following formula (1):

[0134]

[0135] In formula (1), loss i Let z represent the loss value corresponding to the i-th user. i and z i + represent the user representation of the i-th user at two different times, S(a,b) represents the similarity between a and b, and z j Let represent the user representation of the j-th user, k represent the number of users, and τ represent the temperature coefficient, which is a pre-set hyperparameter.

[0136] Furthermore, the temperature coefficient τ controls the model's ability to distinguish negative samples, which affects the performance of the user representation model. The larger the temperature coefficient is set, the smoother the distribution of user representations will be. In this case, the model will treat all negative samples (different users who should be far apart but whose user representations are close according to the model) equally, resulting in a lack of focus in model learning and poor learning performance. The smaller the temperature coefficient is set, the more the model will focus on particularly difficult negative samples, but those negative samples may actually be potential positive samples. This will make it difficult for the model to converge or have poor generalization ability. Therefore, the temperature coefficient should not be set too large or too small.

[0137] As an example, by taking each user as the first user, multiple loss values ​​can be determined. Then, by weighted summation or averaging of these multiple loss values, the total loss value can be determined.

[0138] It should be noted that the preset machine learning network can be trained by inputting sample behavior sequences in batches. The loss value can be determined based on the user representations of multiple users in the same batch. The parameters of the preset machine learning network can be adjusted. After multiple batches of training and reaching the training stopping condition, the user representation model can be obtained.

[0139] See Figure 3 , Figure 3 This diagram illustrates the data flow of a training method for a user representation model according to an embodiment of this specification. Sample behavior sequences from multiple users are input into the user representation model. The feature extraction layer of the user representation model extracts features from the sample behavior sequences of each user, obtaining the behavior representation sequences of each user. These behavior representation sequences are then input into a self-attention layer in hyperbolic space for self-attention calculation, yielding the user representations for each user. A first similarity is calculated between the user representations of the same user at different times, and a second similarity is calculated between the user representations of different users. A loss value is determined based on the first and second similarities. The model parameters of the user representation model are adjusted based on the loss value until the training stopping condition is met, resulting in a trained user representation model.

[0140] In one or more embodiments of this specification, a loss value is determined through contrastive learning to ensure that the user representation model can achieve a high degree of similarity in the representations of the same user and a low degree of similarity in the representations of different users. This allows the user representation model to better represent user attributes and improve the accuracy of task processing results when processing tasks based on user representations in the future.

[0141] The user representation model can be trained using the above method. This user representation model is used to determine the user representation. When processing certain downstream tasks, it is necessary to process them based on the user representation. Therefore, before processing the downstream tasks, it is also necessary to build a task model based on the user representation. The task model that needs to be built may be different for different tasks.

[0142] In this scheme, any task model that needs to be constructed using user representations can determine its user representation based on this user representation model, and any downstream task that needs to use user representations can obtain its user representation based on this user representation model. Furthermore, when a user's user representation is needed, if the user has not generated any new behavior, the user representation can be directly obtained from the user representation model; if the user has generated new behavior, the user representation can be determined based on the new behavior using the user representation model.

[0143] In the embodiments described in this specification, a self-supervised learning approach is used to train the user representation model, and a contrastive learning approach is used to determine the loss value. That is, the loss value is determined by calculating the similarity between user representations of the same user at different times, and the similarity between user representations of different users. Based on the loss value, the parameters of the user representation model are adjusted so that the user representation model can achieve the effect that the user representations of the same user at different times are relatively similar, and the user representations of different users are relatively different. Therefore, the user representations determined based on this user representation model can more accurately and reasonably represent user attributes, that is, the trained user representation model has better performance.

[0144] The following is in conjunction with the appendix Figure 4 and attached Figure 5 Taking the application of the user representation model training method provided in this specification in the financial field as an example, the training method of the user representation model will be further explained. Figure 4 This specification illustrates a flowchart of the processing procedure for training a user representation model according to an embodiment of this specification. Figure 5 This diagram illustrates the data flow of another user representation model training method provided in one embodiment of this specification.

[0145] Step 402: Obtain the sample behavior sequence of user A in month n and month n+1, and obtain the sample behavior sequences of multiple users, including user B, in month n.

[0146] Step 404: Input the obtained sample behavior sequences into the preset machine learning network, and use the feature extraction layer to extract the initial behavior representation sequence of each sample behavior sequence.

[0147] Step 406: For each user, determine the time interval between the first behavior and the previous behavior in the sample behavior sequence, determine the time representation of the time interval, and multiply the time representation with the initial behavior representation of the first behavior to obtain the behavior representation of the first behavior.

[0148] Step 408: Map the behavior representation sequence of each user's sample behavior sequence to hyperbolic space to obtain the enhanced behavior representation sequence.

[0149] Step 410: Input the enhanced behavior representation sequences of multiple users, such as User A and User B, in the nth month into the self-attention layer to obtain the user representations of multiple users, such as User A and User B, in the nth month. Input the enhanced behavior representation sequence of User A in the (n+1)th month into the self-attention layer to obtain the user representation of User A in the (n+1)th month.

[0150] See Figure 5 We obtain user A's behavioral sequence for month n (subscribing to 12.34 yuan, redeeming 6.23 yuan after 5 days, clicking ad3 after 1 hour, ... conversion ...) and behavioral sequence for month n+1 (converting ad5, paying 6.33 yuan after 2 days, clicking ad3 after 1 hour, ... subscribing ...). We process the obtained behavioral sequences through hyperbolic space self-attention to obtain user representation of user A in month n and user representation of user A in month n+1.

[0151] The initial behavioral representation sequence is mapped to a hyperbolic space for self-attention computation to obtain the user representation.

[0152] Step 412: Determine the first similarity based on user A's user representation in month n and user A's user representation in month n+1. Determine multiple second similarities based on user A's user representation in month n+1 and user representations of multiple users, including user B, in month n.

[0153] Step 414: Determine the loss value based on the first similarity and the second similarity, and adjust the parameters of the preset machine learning network based on the loss value until the training stopping condition is met to obtain the user representation model.

[0154] See Figure 5Based on user representations (embedding) of user A in month n and user representations (embedding) of user A in month n+1, user representations (embedding) of user A in month n+1 and user representations (embedding) of user B in month n, user representations (embedding) of user A in month n+1 and user representations (embedding) of user C in month n, ..., user representations (embedding) of user A in month n+1 and user representations (embedding) of user N in month n, the loss value is determined by inception loss to train the model.

[0155] In the embodiments of this specification, during the training of the user representation model, after determining the user representation based on the sample behavior sequence, the parameters of the user representation model are adjusted by calculating the similarity between the user representations of the same user at different times and the similarity between the user representations of different users. This allows the user representation model to achieve the effect that the user representations of the same user at different times are relatively similar, while the user representations of different users are relatively different. Therefore, the user representations determined based on this user representation model can more accurately and reasonably represent user attributes, that is, the trained user representation model has a better effect.

[0156] See Figure 6 , Figure 6 A flowchart of a user characterization method according to an embodiment of this specification is shown, which specifically includes the following steps.

[0157] Step 602: Obtain behavioral description information of the target user.

[0158] Among them, behavioral description information can be information used to describe the behavior of the target user.

[0159] In some embodiments, the behavioral description information of the target user can be the behavior generated by the target user within a certain time period, which can be one or multiple. If there are multiple behavioral description information, the multiple behavioral description information can form a behavioral sequence.

[0160] Step 604: Input the behavioral description information into the user representation model to obtain the user representation of the target user, wherein the user representation model is trained using the training method of the user representation model described above.

[0161] In one or more embodiments of this specification, the preset machine learning network may include a feature extraction layer and a self-attention layer. When there are multiple behavioral descriptions, and these multiple behavioral descriptions form a behavioral sequence, the specific implementation of inputting the behavioral descriptions into the user representation model to obtain the user representation of the target user may include:

[0162] Based on the behavioral description information of the target user, obtain the behavioral representation sequence corresponding to the target user; determine the user representation of the target user based on the behavioral representation sequence.

[0163] In one or more embodiments of this specification, a specific implementation of obtaining the behavioral representation sequence corresponding to the target user based on the behavioral description information of the target user may include:

[0164] Using a feature extraction layer, features are extracted from each behavioral description in the target user's behavioral sequence to obtain an initial behavioral representation sequence corresponding to the target user. This initial behavioral representation sequence includes the initial behavioral representation corresponding to each behavioral description. The time interval between the first behavioral description and the second behavioral description is determined to obtain a temporal representation of the time interval. The first behavioral description is any one of the behavioral sequences, and the second behavioral description is the one in the behavioral sequence that is temporally adjacent to the first behavioral description. The temporal representation and the initial behavioral representation corresponding to the first behavioral description are fused to obtain the behavioral representation corresponding to the first behavioral description. Based on the behavioral representations corresponding to each behavioral description, the behavioral representation sequence corresponding to the target user is obtained.

[0165] In one or more embodiments of this specification, the specific implementation of using a feature extraction layer to extract features from the behavioral description information in the behavioral sequence of a target user to obtain the initial behavioral representation sequence corresponding to the target user may include:

[0166] Extract numeric characters from the first row of description information; discretize the numeric characters to obtain their initial representations, and encode the non-numeric characters to obtain their initial representations; based on the initial representations of the numeric and non-numeric characters, determine the initial behavior representations corresponding to the first row of description information; based on the initial behavior representations corresponding to each behavior description information, obtain the initial behavior representation sequence corresponding to the target user.

[0167] In one or more embodiments of this specification, a specific implementation of determining the user representation of a target user based on a behavioral representation sequence may include:

[0168] Self-attention calculation is performed on each behavioral representation in the behavioral representation sequence to obtain the user representation of the target user.

[0169] In one or more embodiments of this specification, if each behavioral representation in the behavioral representation sequence conforms to a preset distribution pattern, the specific implementation of performing self-attention calculation on each behavioral representation in the behavioral representation sequence to obtain the user representation of the target user may include:

[0170] The target user's behavioral representations are mapped to the target data space corresponding to the preset distribution pattern to obtain the target user's enhanced user representations; self-attention calculation is performed on the target user's enhanced user representations to obtain the target user's user representation.

[0171] In one or more embodiments of this specification, after obtaining the user representation of the target user, the user representation of the target user can be input into the target task model to obtain the task processing result for the target user.

[0172] In some embodiments, downstream tasks can be user-dimensional tasks, such as predicting a user's age, interests, assets, creating user profiles, and identifying potential customers. Therefore, the goal of training a user representation model is to enable it to learn user attributes. This means learning that user representations of users with similar genders, ages, interests, and assets are closer together, while user representations of users with different genders, ages, interests, and assets are farther apart. This allows the user representation model to output user attributes more effectively.

[0173] Taking the target task as potential customer mining and the target task model as a classification model as an example, we can first obtain the user representation of the target user, input the user representation into the classification model, and then determine the category of the target user, which includes whether the user is a potential customer or not.

[0174] It should be noted that parts not described in detail in this embodiment can be referred to the relevant descriptions in the above-described user representation model training method embodiment, and this embodiment does not limit them.

[0175] In the embodiments applied to this specification, during the training of the user representation model, after determining the user representation based on the sample behavior sequence, the parameters of the user representation model are adjusted by calculating the similarity between the user representations of the same user at different times, and the similarity between the user representations of different users. This allows the user representation model to achieve the effect that the user representations of the same user at different times are relatively similar, while the user representations of different users are relatively different. Therefore, the user representations determined based on this user representation model can more accurately and reasonably represent user attributes, and when processing tasks through the target task model based on this user representation, more accurate task processing results can be obtained.

[0176] Corresponding to the above-described embodiments of the training method for the user representation model, this specification also provides embodiments of the training apparatus for the user representation model. Figure 7 A schematic diagram of a training apparatus for a user representation model according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:

[0177] The first acquisition module 702 is configured to acquire sample behavior sequences of multiple users, wherein the sample behavior sequence of any user includes behavioral description information of the user at different times;

[0178] The calculation module 704 is configured to obtain user representations of each user at different times based on the sample behavior sequence of each user and using a preset machine learning network, and to calculate the first similarity between user representations of the same user at different times and the second similarity between user representations of different users.

[0179] Training module 706 is configured to train a preset machine learning network based on a first similarity and a second similarity until the training stops and a user representation model is obtained.

[0180] In one or more embodiments of this specification, the computing module 704 is further configured to:

[0181] Using a pre-defined machine learning network, based on the behavioral description information in the sample behavioral sequence of the first user, a behavioral representation sequence corresponding to the first user is obtained, where the first user is any one of multiple users;

[0182] Based on the behavioral representation sequence, determine the user representation of the first user at different times.

[0183] In one or more embodiments of this specification, the computing module 704 is further configured to:

[0184] The user representations of the first user within a preset time period are fused to obtain the user representation of the first user within the preset time period.

[0185] In one or more embodiments of this specification, the preset machine learning network includes a feature extraction layer; the computation module 704 is further configured to:

[0186] Using a feature extraction layer, features are extracted from each behavior description information in the sample behavior sequence of the first user to obtain the initial behavior representation sequence corresponding to the first user. The initial behavior representation sequence includes the initial behavior representation corresponding to each behavior description information.

[0187] Determine the time interval between the first line of description information and the second line of description information to obtain the time representation of the time interval, wherein the first line of description information is any one in the sample behavior sequence, and the second line of description information is one in the sample behavior sequence that is temporally adjacent to the first line of description information;

[0188] The time representation and the initial behavior representation corresponding to the first behavior description information are fused to obtain the behavior representation corresponding to the first behavior description information.

[0189] Based on the behavioral representations corresponding to each behavioral description information, the behavioral representation sequence corresponding to the first user is obtained.

[0190] In one or more embodiments of this specification, the computing module 704 is further configured to:

[0191] Extract the numeric characters from the description information in the first line;

[0192] Discretize the numeric characters to obtain their initial representations, and encode the non-numeric characters to obtain their initial representations as well.

[0193] Based on the initial representations of numeric and non-numeric characters, the initial behavior representation corresponding to the first row of descriptive information is determined;

[0194] Based on the initial behavior representations corresponding to each behavior description information, the initial behavior representation sequence corresponding to the first user is obtained.

[0195] In one or more embodiments of this specification, the computing module 704 is further configured to:

[0196] Self-attention calculation is performed on the user representation of the first user within a preset time period to obtain the user representation of the first user within the preset time period.

[0197] In one or more embodiments of this specification, the user representation of the first user within a preset time period conforms to a preset distribution pattern; the calculation module 704 is further configured to:

[0198] Map the user representation of the first user within a preset time period to the target data space corresponding to the preset distribution pattern to obtain the enhanced user representation of the first user within the preset time period.

[0199] Self-attention calculation is performed on each enhanced user representation corresponding to the first user within a preset time period to obtain the user representation of the first user within the preset time period.

[0200] In one or more embodiments of this specification, the computing module 704 is configured to:

[0201] Based on the user representation of the first user at any two different times, calculate the difference information of the first user representation in the time dimension to obtain the first similarity, where the first user is any one of multiple users;

[0202] Based on the user representations of each user, calculate the second user representation difference information between the first user and other users in the spatial dimension to obtain the second similarity;

[0203] Training module 706 is also configured as follows:

[0204] The loss value is calculated based on the ratio of the first similarity to the second similarity.

[0205] The pre-defined machine learning network is trained based on the loss value.

[0206] In the embodiments applied to this specification, sample behavior sequences of multiple users are obtained, wherein each user's sample behavior sequence includes behavioral description information of that user at different times; based on the sample behavior sequences of each user, a preset machine learning network is used to obtain user representations of each user at different times, and a first similarity between user representations of the same user at different times and a second similarity between user representations of different users are calculated; based on the first and second similarities, the preset machine learning network is trained until a training stopping condition is reached to obtain a user representation model. That is, in the process of training the user representation model, after determining the user representation based on the sample behavior sequences, the parameters of the user representation model are adjusted by calculating the similarity between user representations of the same user at different times and the similarity between user representations of different users, so that the user representation model can achieve the effect that the user representations of the same user at different times are relatively similar, and the user representations of different users are relatively different. Therefore, the user representations determined based on this user representation model can more accurately and reasonably represent user attributes, that is, the trained user representation model has a better effect.

[0207] The above is a schematic scheme of a user representation model training device according to this embodiment. It should be noted that the technical solution of this user representation model training device and the technical solution of the user representation model training method described above belong to the same concept. For details not described in detail in the technical solution of the user representation model training device, please refer to the description of the technical solution of the user representation model training method described above.

[0208] Corresponding to the above-described user characterization method embodiments, this specification also provides user characterization device embodiments. Figure 8 A schematic diagram of a user characterization device according to one embodiment of this specification is shown. Figure 8 As shown, the device includes:

[0209] The second acquisition module 802 is configured to acquire behavioral description information of the target user;

[0210] The module 804 is configured to input the behavior description information into the user representation model to obtain the user representation of the target user, wherein the user representation model is trained by the user representation model training method described in the above embodiments.

[0211] In one or more embodiments of this specification, the user representation device further includes a task processing module, which is configured to:

[0212] The user representation of the target user is input into the target task model to obtain the task processing result for the target user.

[0213] In one or more embodiments of this specification, the number of behavior description information is multiple, and the multiple behavior description information constitutes a behavior sequence; the task processing module is further configured to:

[0214] Based on the behavioral descriptions of the target users, obtain the behavioral representations corresponding to the target users;

[0215] Determine the user representation of the target user based on the behavioral representation sequence.

[0216] In one or more embodiments of this specification, the task processing module is further configured to:

[0217] By using a feature extraction layer, features are extracted from the behavioral description information in the behavioral sequence of the target user to obtain the initial behavioral representation sequence corresponding to the target user. The initial behavioral representation sequence includes the initial behavioral representation corresponding to each behavioral description information.

[0218] Determine the time interval between the first and second line description information to obtain the time representation of the time interval, wherein the first line description information is any one in the line sequence, and the second line description information is one in the line sequence that is temporally adjacent to the first line description information.

[0219] The time representation and the initial behavior representation corresponding to the first behavior description information are fused to obtain the behavior representation corresponding to the first behavior description information.

[0220] Based on the behavioral representations corresponding to each behavioral description, a sequence of behavioral representations corresponding to the target user is obtained.

[0221] In one or more embodiments of this specification, the task processing module is further configured to:

[0222] Extract the numeric characters from the description information in the first line;

[0223] Discretize the numeric characters to obtain their initial representations, and encode the non-numeric characters to obtain their initial representations as well.

[0224] Based on the initial representations of numeric and non-numeric characters, the initial behavior representation corresponding to the first row of descriptive information is determined;

[0225] Based on the initial behavioral representations corresponding to each behavioral description information, the initial behavioral representation sequence corresponding to the target user is obtained.

[0226] In one or more embodiments of this specification, the task processing module is further configured to:

[0227] Self-attention calculation is performed on each behavioral representation in the behavioral representation sequence to obtain the user representation of the target user.

[0228] In one or more embodiments of this specification, the user representation of the target user within a preset time period conforms to a preset distribution pattern; the task processing module is further configured to:

[0229] By mapping the behavioral representations of the target user to the target data space corresponding to the preset distribution pattern, we can obtain the enhanced user representations of the target user.

[0230] Self-attention calculation is performed on each enhanced user representation of the target user to obtain the user representation of the target user.

[0231] In the embodiments of this specification, behavioral description information of the target user is obtained, and the behavioral description information is input into the user representation model to obtain the user representation of the target user. Since the user representation model is obtained by calculating the similarity between user representations of the same user at different times and adjusting parameters for the similarity between user representations of different users, the user representation model can achieve the effect that the user representations of the same user at different times are relatively similar, and the user representations of different users are relatively different. Therefore, the user representation determined based on the user representation model can more accurately and reasonably represent user attributes, and thus, processing downstream tasks based on the user representation model can obtain more accurate processing results.

[0232] Figure 9 A structural block diagram of a computing device 900 according to one embodiment of this specification is shown. The components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0233] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0234] In one embodiment of this specification, the above-described components of the computing device 900 and Figure 9 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 9 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0235] The computing device 900 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 900 can also be a mobile or stationary server.

[0236] The processor 920 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-mentioned training method or user representation method for the user representation model.

[0237] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solution of the user representation model training method or user representation method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the user representation model training method or user representation method described above.

[0238] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described user representation model training method or user representation method.

[0239] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solution of the user representation model training method or user representation method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the user representation model training method or user representation method described above.

[0240] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described user representation model training method or user representation method.

[0241] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the technical solution of the user representation model training method or user representation method described above. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solution of the user representation model training method or user representation method described above.

[0242] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0243] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0244] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0245] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0246] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for training a user representation model, comprising: Obtain sample behavior sequences from multiple users, where each user's sample behavior sequence includes descriptions of that user's behavior at different times; Based on the sample behavior sequences of each user, a preset machine learning network is used to obtain user representations of each user at different times, and to calculate a first similarity between user representations of the same user at different times and a second similarity between user representations of different users. The preset machine learning network includes a feature extraction layer. Obtaining user representations of each user at different times using the preset machine learning network includes: extracting features from the behavior description information of a first user through the feature extraction layer to obtain an initial behavior representation, where the first user is any one of the multiple users; fusing the time intervals between each behavior description and adjacent behavior descriptions into the initial behavior representation to obtain the behavior representation corresponding to each behavior description; determining the behavior representation sequence of the first user based on the behavior representations; and determining the user representations of the first user at different times based on the behavior representation sequence. Based on the first similarity and the second similarity, the preset machine learning network is trained until the training stops, and a user representation model is obtained.

2. The method according to claim 1, further comprising, after determining the user representation of the first user at different times based on the behavioral representation sequence: The user representations of the first user within a preset time period are fused to obtain the user representation of the first user within the preset time period.

3. The method according to claim 1, wherein the step of extracting features from the behavior description information of the first user through the feature extraction layer to obtain an initial behavior representation includes: Using the feature extraction layer, features are extracted from each behavior description information in the sample behavior sequence of the first user to obtain the initial behavior representation sequence corresponding to the first user, wherein the initial behavior representation sequence includes the initial behavior representation corresponding to each behavior description information. The time intervals between each of the aforementioned behavior descriptions and adjacent behavior descriptions are fused into the initial behavior representation to obtain the behavior representation corresponding to each of the aforementioned behavior descriptions. Based on the behavior representations, a behavior representation sequence for the first user is determined, including: Determine the time interval between the first behavior description information and the second behavior description information to obtain the time representation of the time interval, wherein the first behavior description information is any one of the sample behavior sequences, and the second behavior description information is one of the sample behavior sequences that is temporally adjacent to the first behavior description information. The time representation and the initial behavior representation corresponding to the first behavior description information are fused to obtain the behavior representation corresponding to the first behavior description information. Based on the behavioral representations corresponding to each behavioral description information, the behavioral representation sequence corresponding to the first user is obtained.

4. The method according to claim 3, wherein the step of using the feature extraction layer to extract features from each behavior description information in the sample behavior sequence of the first user to obtain the initial behavior representation sequence corresponding to the first user includes: Extract the numeric characters from the first line of description information; The numeric characters are discretized to obtain an initial representation of the numeric characters, and the non-numeric characters are encoded to obtain an initial representation of the non-numeric characters. Based on the initial representations of the numeric and non-numeric characters, the initial behavior representation corresponding to the first behavior description information is determined; Based on the initial behavior representations corresponding to each behavior description information, the initial behavior representation sequence corresponding to the first user is obtained.

5. The method according to any one of claims 2-4, wherein fusing the user representation of the first user within a preset time period to obtain the user representation of the first user within the preset time period comprises: Self-attention calculation is performed on the user representation of the first user within a preset time period to obtain the user representation of the first user within the preset time period.

6. The method according to claim 5, wherein the user representation of the first user within a preset time period conforms to a preset distribution pattern; the step of performing self-attention calculation on the user representation of the first user within the preset time period to obtain the user representation of the first user within the preset time period includes: The user representation of the first user within a preset time period is mapped to the target data space corresponding to the preset distribution pattern to obtain the enhanced user representations of the first user within the preset time period. Self-attention calculation is performed on each enhanced user representation corresponding to the first user within a preset time period to obtain the user representation of the first user within the preset time period.

7. The method according to any one of claims 1-4, wherein calculating the first similarity between user representations of the same user at different times and the second similarity between user representations of different users comprises: Based on the user representation of the first user at any two different times, calculate the first user representation difference information of the first user in the time dimension to obtain the first similarity, wherein the first user is any one of the plurality of users; Based on the user representations of each user, calculate the second user representation difference information between the first user and other users in the spatial dimension to obtain the second similarity. The step of training the preset machine learning network based on the first similarity and the second similarity includes: The loss value is calculated based on the ratio of the first similarity to the second similarity. The preset machine learning network is trained based on the loss value.

8. A user representation method, comprising: Obtain behavioral description information of the target user; The behavioral description information is input into the user representation model to obtain the user representation of the target user, wherein the user representation model is trained by the method described in any one of claims 1-7.

9. The method according to claim 8, further comprising, after inputting the behavioral description information into the user representation model to obtain the user representation of the target user: The user representation of the target user is input into the target task model to obtain the task processing result for the target user.

10. A training device for a user representation model, comprising: The first acquisition module is configured to acquire sample behavior sequences of multiple users, wherein the sample behavior sequence of any user includes behavioral description information of that user at different times; The calculation module is configured to obtain user representations of each user at different times based on the sample behavior sequences of each user using a preset machine learning network, and to calculate a first similarity between user representations of the same user at different times and a second similarity between user representations of different users. The preset machine learning network includes a feature extraction layer. Obtaining user representations of each user at different times using the preset machine learning network includes: extracting features from the behavior description information of a first user through the feature extraction layer to obtain an initial behavior representation, where the first user is any one of the plurality of users; fusing the time intervals between each behavior description and adjacent behavior descriptions into the initial behavior representation to obtain a behavior representation corresponding to each behavior description; determining a behavior representation sequence of the first user based on the behavior representations; and determining the user representations of the first user at different times based on the behavior representation sequence. The training module is configured to train the preset machine learning network based on the first similarity and the second similarity until the training stops, thereby obtaining a user representation model.

11. A user representation device, comprising: The second acquisition module is configured to acquire behavioral description information of the target user; The acquisition module is configured to input the behavior description information into a user representation model to obtain a user representation of the target user, wherein the user representation model is trained by the method described in any one of claims 1-7.

12. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the training method of the user representation model according to any one of claims 1-7, or implement the steps of the user representation method according to any one of claims 8-9.

13. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the training method for the user representation model according to any one of claims 1-7, or implement the steps of the user representation method according to any one of claims 8-9.