Method, device and equipment for acquiring user portrait and storage medium

By constructing a training sample set and using a differential learning model and triplet loss algorithm to optimize user portraits, the problem of insufficient user portrait accuracy is solved and more accurate personalized recommendations are achieved.

CN114764470BActive Publication Date: 2025-10-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110035190.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-12
Publication Date
2025-10-10
Estimated Expiration
2041-01-12

AI Technical Summary

Technical Problem

In existing technologies, user portraits are not accurate enough to effectively reflect the differences between users, resulting in poor personalized recommendation results.

Method used

By constructing a training sample set, the user behavior sequences of target users and non-target users are iteratively trained using a difference learning model to maximize the difference between target users and non-target users, learn the representation vector of the target user, and use the triplet loss algorithm to optimize the user portrait.

Benefits of technology

The comprehensiveness and accuracy of user portraits are improved, enabling more accurate personalized streaming media object recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114764470B_ABST
    Figure CN114764470B_ABST
Patent Text Reader

Abstract

The application discloses a method, device and equipment for obtaining a user portrait and a storage medium, relates to the technical field of computers, and is used for obtaining a representation vector of a user with respect to a streaming media, and improving the comprehensiveness and accuracy of the user portrait. In the method, a training sample set can be constructed according to user behavior sequences of target users and non-target users, and an iterative training is performed on a difference learning model, and then the differences between the users are learned when the model converges, so that the representation vector of the target user obtained is finally updated and can be used as a representation of the target user in the streaming media, so that the content of the user portrait is more abundant, the comprehensiveness and accuracy of the user portrait are improved, a basis is laid for subsequent streaming media object recommendation and user analysis, and then the accuracy of user recommendation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to the technical field of artificial intelligence (AI), and provides a method, device and equipment for obtaining user portrait and a storage medium. BACKGROUND

[0002] In short, user portrait is to use a vector to represent a user or a feature of a user. In a scenario involving streaming media objects such as music or video, it is usually necessary to recommend streaming media objects for users. Taking music as an example, in order to accurately recommend music for users, the representation of users, i.e. user portrait, is often used. The portrait of users in the aspect of music can express the user's preference for music and can assist in personalized music recommendation for users. In addition, user portrait is also needed in scenarios such as user group division and analysis. Accurate user portrait is a prerequisite for subsequent accurate recommendation and user analysis, so accurate user portrait is also necessary.

[0003] Therefore, how to improve the accuracy of user portrait is a problem to be considered. SUMMARY

[0004] The embodiments of the present application provide a method, device and equipment for obtaining user portrait and a storage medium, which are used to obtain a representation vector of a user in the aspect of streaming media, and improve the comprehensiveness and accuracy of user portrait.

[0005] In one aspect, a method for obtaining user portrait is provided, and the method comprises:

[0006] Obtaining user behavior sequences of a target user and a plurality of non-target users; wherein one user behavior sequence comprises a plurality of streaming media objects operated by one user;

[0007] Constructing a training sample set according to each user behavior sequence; wherein one training sample comprises a first object set composed of at least two streaming media objects in the user behavior sequence of the target user, and a second object set composed of at least two streaming media objects in the user behavior sequence of one non-target user, and the first object set and the second object set have an intersection;

[0008] Iteratively training a difference learning model according to the training sample set; wherein, in each training, a plurality of loss values are obtained according to the user representation vector of the target user and the first object set and the second object set of each training sample, one loss value is used to represent the difference between the target user and the corresponding non-target user, and the user representation vector is updated according to the plurality of loss values;

[0009] When it is determined that the difference degree learning model converges according to the plurality of loss values, a user portrait of the target user is obtained according to the user representation vector.

[0010] In an aspect, a method for recommending a streaming media object is provided, and the method comprises:

[0011] The user representation vector of the target user is obtained by the method of the aspect above.

[0012] According to a matching result of the user representation vector of the target user and an object representation vector of each streaming media object, a streaming media object with a matching degree greater than a set matching degree threshold is recommended to the target user; or,

[0013] The user representation vector of the target user is similar to the user representation vector of another user, and a similar user with a similarity greater than a set similarity threshold is determined, and a streaming media object in a user behavior sequence of the similar user is recommended to the target user.

[0014] In an aspect, an apparatus for obtaining a user portrait is provided, and the apparatus comprises:

[0015] A user sequence obtaining unit is configured to obtain user behavior sequences of a target user and a plurality of non-target users; wherein one user behavior sequence comprises a plurality of streaming media objects operated by one user;

[0016] A training sample constructing unit is configured to construct a training sample set according to each user behavior sequence; wherein one training sample comprises a first object set composed of at least two streaming media objects in the user behavior sequence of the target user, and a second object set composed of at least two streaming media objects in the user behavior sequence of one non-target user, and the first object set and the second object set have an intersection;

[0017] A training unit is configured to iteratively train a difference degree learning model according to the training sample set; wherein, at each time of training, a plurality of loss values are obtained according to the user representation vector of the target user, and the first object set and the second object set of each training sample, one loss value is used to represent the difference degree between the target user and the corresponding non-target user, and the user representation vector is updated according to the plurality of loss values;

[0018] A portrait unit is configured to obtain a user portrait of the target user according to the user representation vector when it is determined that the difference degree learning model converges according to the plurality of loss values.

[0019] Optionally, the first object set consists of at least two consecutive streaming media objects in the user behavior sequence of the target user, and the second object set consists of at least two consecutive streaming media objects in the user behavior sequence of the non-target user.

[0020] Optionally, in each training sample, the intersection of the first object set and the second object set, the difference between the first object set and the intersection, and the difference between the second object set and the intersection form a triple;

[0021] The training unit is specifically used to:

[0022] According to the user representation vector of the target user and the triples corresponding to the training samples, the triple loss values ​​corresponding to the training samples are obtained.

[0023] Optionally, the training unit is specifically used to:

[0024] For each training sample, obtaining, based on the user representation vector and the object representation vectors of the streaming media objects in each training sample, a first probability that the user behavior sequence of the target user includes the first object set and a second probability that the user behavior sequence includes the second object set;

[0025] A loss value of each training sample is obtained according to the first probability and the second probability, wherein the loss value is positively correlated with the first probability and negatively correlated with the second probability.

[0026] Optionally, the first object set includes a first streaming media object and a second streaming media object, and the second object set includes the second streaming media object and a third streaming media object;

[0027] The training unit is specifically used to:

[0028] Obtaining a first correlation between the first streaming media object and the second streaming media object relative to the user representation vector, and obtaining a second correlation between the second streaming media object and the third streaming media object relative to the user representation vector;

[0029] The first probability is obtained according to the first correlation degree, and the second probability is obtained according to the second correlation degree; wherein the correlation degree value is positively correlated with the probability value.

[0030] Optionally, the convergence conditions of the difference learning model include:

[0031] The loss value of each training sample is not less than a set first threshold; and / or,

[0032] The sum of loss values of all training samples is not less than a set second threshold value, the second threshold value being greater than the first threshold value.

[0033] Optionally, the apparatus further comprises an object vector obtaining unit, configured to:

[0034] obtain a feature vector sequence of each stream media object according to stream media data of each stream media object respectively;

[0035] perform vector coding according to the feature vector sequence of each stream media object respectively to obtain an object representation vector of each stream media object.

[0036] Optionally, the object vector obtaining unit is specifically configured to:

[0037] sample audio data of each audio to obtain an audio spectrum graph corresponding to each audio respectively;

[0038] The audio spectrum graph comprises a frequency sequence of a plurality of time segments of each audio in time, and the frequency sequence of one time segment corresponds to one feature vector in the feature vector sequence.

[0039] Optionally, the object vector obtaining unit is specifically configured to:

[0040] For each audio, time domain sampling is performed on audio data of the audio according to a set time interval to obtain a plurality of time sequences of the audio in time domain;

[0041] combining the plurality of time sequences according to a set time segment length to obtain a plurality of time sequence combinations;

[0042] For each time sequence combination, after time-frequency conversion is performed on the time sequence combination, sampling is performed on a frequency domain signal according to a set frequency interval to obtain a frequency sequence corresponding to the time sequence combination.

[0043] In one aspect, a stream media object recommendation apparatus is provided, the apparatus comprising:

[0044] a user vector obtaining unit configured to obtain a user representation vector of a target user by the method of the above aspect;

[0045] a recommendation unit configured to recommend a stream media object to the target user according to a matching result of the user representation vector of the target user and the object representation vector of each stream media object, the stream media object having a matching degree greater than a set matching degree threshold value; or perform similar matching on the user representation vector of the target user and user representation vectors of other users to determine similar users having a similarity greater than a set similarity threshold value, and recommend a stream media object in a user behavior sequence of the similar user to the target user.

[0046] In one aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.

[0047] In one aspect, a computer storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the steps of any of the above methods are implemented.

[0048] In one aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of any of the above methods.

[0049] In the method for obtaining user portraits provided in the embodiment of the present application, a training sample set can be constructed based on the user behavior sequences of the target user and the non-target user, and the difference learning model can be iteratively trained. Wherein, each training sample includes a first object set located in the user behavior sequence of the target user and a second object set located in the user behavior sequence of the non-target user, which can be used to characterize the preference information of the target user and the preference information of the non-target user, respectively. Then, in each training process, a loss value representing the difference between the target user and the non-target user is obtained based on the representation of the target object included in each training sample and the representation of each streaming media object, and then the representation of the target user is updated based on the loss value. The differences between the users are learned through the above-mentioned training process, and the representation vector of the target user obtained by the final update can be used as the representation of the target user in terms of streaming media, making the content of the user portrait richer and improving the comprehensiveness and accuracy of the user portrait. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0051] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;

[0052] Figure 2 Another schematic diagram of a scenario provided in an embodiment of the present application;

[0053] Figure 3A flowchart of a method for obtaining a user portrait provided in an embodiment of the present application;

[0054] Figure 4 The model architecture of the differential learning model based on the triplet loss algorithm provided in the embodiment of the present application;

[0055] Figure 5 A schematic diagram of the training process of the difference learning model provided in the embodiment of the present application;

[0056] Figure 6 A schematic diagram of the process of obtaining an audio spectrogram by audio sampling provided in an embodiment of the present application;

[0057] Figure 7 A schematic diagram of the frequency spectrum after audio decomposition provided in an embodiment of the present application;

[0058] Figure 8 A schematic diagram of the structure of an apparatus for obtaining a user portrait provided in an embodiment of the present application;

[0059] Figure 9 A schematic diagram of the structure of a streaming media object recommendation device provided in an embodiment of the present application;

[0060] Figure 10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other in any way. In addition, although a logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0062] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0063] Streaming media objects: may include objects transmitted using streaming media technology, such as audio, video, or images, etc.

[0064] User behavior sequence: a sequence of objects targeted by a user's operation behavior. Taking audio as an example, the user behavior sequence can be multiple songs that the user has played in the past. For example, if the order of the songs played in the past is S1, S2, S3, and S4, then the user behavior sequence of the user can be {S1, S2, S3, S4}.

[0065] In short, a user portrait is a vector that represents a user or a user characteristic. In scenarios involving streaming media objects such as music or videos, it is often necessary to recommend streaming media objects to users. Taking music as an example, in order to accurately recommend music to users, it is often necessary to use user representations, that is, user portraits. User music portraits can express the user's preferences for music and can assist in making personalized music recommendations for users. In addition, user portraits are also needed in scenarios such as user group segmentation and analysis. Accurate user portraits are a prerequisite for subsequent recommendations and user analysis, so accurate user portraits are also very necessary.

[0066] Currently, user profiles are typically obtained through direct modeling. This involves processing, extracting, and representing basic user information and historical data. However, this approach only represents basic user information, ignoring differences between users. Consequently, the resulting user identification vector representation is incomplete, making it difficult to accurately make recommendations.

[0067] Considering that the differences between different users' preferences for streaming media objects such as music can actually reflect the differences between users, and in scenarios such as music recommendation, more accurate personalized recommendations can be made for users based on the differences between users.

[0068] In view of this, the embodiment of the present application provides a method for obtaining a user portrait, in which a training sample set can be constructed according to the user behavior sequences of target users and non-target users, and a difference learning model is iteratively trained. Each training sample includes a first object set in the user behavior sequence of a target user and a second object set in the user behavior sequence of a non-target user, which can be used to represent the preference information of the target user and the preference information of the non-target user, respectively. Then, in each training process, the loss value representing the difference between the target user and the non-target user is obtained according to the representation of the target object included in each training sample and the representation of each streaming media object, and then the representation of the target user is updated according to the loss value. The difference between each user is learned through the above training process, so that the final updated representation vector of the target user can be used as the representation of the target user in the streaming media, so that the content of the user portrait is more abundant, and the comprehensiveness and accuracy of the user portrait are improved.

[0069] In addition, the embodiment of the present application uses the idea of triplet loss to maximize the difference between the first object set of the target user and the second object set of the non-target user, so that the target user and the non-target user can be more easily distinguished, which is equivalent to learning the difference between the target user and the non-target user. The learned representation vector can be used to depict the portrait of the target user.

[0070] After introducing the design idea of the embodiment of the present application, the technology involved in the embodiment of the present application is briefly introduced.

[0071] Artificial intelligence (AI) is the use of digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.

[0072] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.

[0073] Key technologies in speech technology include automatic speech recognition (ASR), text-to-speech (TTS), and voiceprint recognition. Enabling computers to hear, see, speak, and feel is the future direction of human-computer interaction, with speech becoming one of the most promising methods of human-computer interaction.

[0074] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0075] The solutions provided in the embodiments of this application mainly involve speech processing technology and machine learning / deep learning technologies belonging to the field of artificial intelligence, which will be specifically explained through subsequent embodiments.

[0076] Below, we briefly introduce the application scenarios to which the technical solutions of the embodiments of this application can be applied. It should be noted that the application scenarios described below are only used to illustrate the embodiments of this application and are not limiting. In the specific implementation process, the technical solutions provided by the embodiments of this application can be flexibly applied according to actual needs.

[0077] The solution provided in the embodiment of the present application can be applied to most scenarios involving streaming media objects that require obtaining user portraits and user analysis or personalized recommendation scenarios.

[0078] See Figure 1 1 is a schematic diagram of a scenario to which an embodiment of the present application can be applied, wherein the scenario includes a server 101 and multiple terminals 102 .

[0079] The server 101 may include one or more processors 1011, a memory 1012, and an I / O interface 1013 for interacting with a terminal. Furthermore, the server 101 may be configured with a database 1014, which may be used to store learned representation vectors of each user and trained model parameters. For example, the server 101 may be a backend server for an application that plays streaming media objects such as audio or video.

[0080] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms, but is not limited to these.

[0081] Among them, the memory 1012 of the server 101 can store program instructions of the method for obtaining user portraits provided in the embodiment of the present application. When these program instructions are executed by the processor 1011, they can be used to implement the steps of the method for obtaining user portraits provided in the embodiment of the present application to obtain the user's representation of streaming media objects. In addition, the memory 1012 of the server 101 can also store program instructions of the streaming media object recommendation method provided in the embodiment of the present application. When these program instructions are executed by the processor 1011, they can be used to implement the steps of the streaming media object recommendation method provided in the embodiment of the present application. The user's representation vector can be obtained according to the above method to make personalized streaming media object recommendations for the user.

[0082] The server 101 and the multiple terminals 102 can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, other possible networks are also possible, and the embodiments of the present application are not limited thereto.

[0083] See Figure 2 , which is a schematic diagram of another scenario provided by an embodiment of the present application. In this scenario, a streaming object server 201 , a database 202 , a computing cluster 203 , a vector storage server 204 and a user terminal 205 may be included.

[0084] The streaming media object server 201 may be a server that provides streaming media objects, for example, an application server for an audio application or a video application, or a website server for an audio website or a video website.

[0085] Database 202 can be used to store user behavior data generated when users operate on streaming media objects and streaming media data of streaming media objects. When obtaining user profiles, the corresponding user behavior data and streaming media data of corresponding streaming media objects can be obtained from database 202 according to actual needs. Database 202 can adopt various data storage solutions, such as a Structured Query Language (SQL) database, a HIVE-based Hadoop Distributed File System (HDFS / HIVE), or a key-value (KV) non-relational data storage solution.

[0086] The computing cluster 203 may be used to provide computing resources for the process of obtaining the user's representation vector.

[0087] Vector storage server 204 can be used to store the obtained user representation vectors and provide vector query and matching functions to streaming object server 201. When similar user matching is required, streaming object server 201 can provide the user to be matched to vector storage server 204. Vector storage server 204 can then perform vector matching based on the user's representation vector and return the matching similar user to streaming object server 201.

[0088] Alternatively, when a streaming media object needs to be recommended to a user, the streaming media object server 201 can provide the user to be recommended to the vector storage server 204. The vector storage server 204 can then perform vector matching based on the user's representation vector and return the matching streaming media object to the streaming media object server 201. The user terminal 205 can install an application corresponding to the streaming media object server 201, and can then view the recommended streaming media objects in the application.

[0089] In actual applications, the streaming object server 201, database 202, computing cluster 203, and vector storage server 204 can be different devices, or some or all of them can be implemented by the same device. For example, the streaming object server 201 and the vector storage server 204 can be the same device.

[0090] In addition, the technical solutions of the embodiments of the present application can also be applied to in-vehicle scenarios, such as user representation and music or video recommendations in in-vehicle music or video platforms.

[0091] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 or Figure 2The application scenarios shown can also be used in other possible application scenarios, and the present application embodiment does not limit them. Figure 3 , which is a flow chart of a method for obtaining a user portrait provided in an embodiment of the present application. The method can be performed by Figure 1 Server 101 or Figure 2 The method is executed by the computing cluster 203 shown in FIG. 2 , and the process of the method is described as follows.

[0092] Step 301: Obtain user behavior sequences of a target user and multiple non-target users.

[0093] When obtaining a user's representation vector, in order to learn the differences between this user and all other users, we can first obtain the user behavior sequences of all users in the system. Of course, in certain specific scenarios, only some users need to be involved, so we can also obtain the user behavior sequences of only these users. A user behavior sequence includes multiple streaming media objects operated by a user.

[0094] Since the user profiling process for each user is similar, a user is specifically taken as an example for introduction here. Among them, the user who needs to be profiled is called the target user. During the gliding process of the target user, the other users among the above users are relatively non-target users.

[0095] The user's operation on the streaming media object can reflect the user's preferences, so the user's operation behavior data can be obtained, and then the representation vector of the streaming media object can be obtained based on the user's operation behavior data.

[0096] Specifically, after obtaining the operation behavior data of each user, the user behavior sequence of each user can be obtained based on the operation behavior data of each user. For example, for music, the user's operation behavior can be a play operation, so the historical play data of each user can be obtained to sort out the play sequence of each user. For example, if the order of music played by user A in the past is S1, S2, S3 and S4, then the user behavior sequence of this user can be {S1, S2, S3, S4}. If the order of music played by user B in the past is S2, S5 and S6, then the user behavior sequence of this user can be {S2, S5, S6}.

[0097] Step 302: Construct a training sample set based on each user behavior sequence.

[0098] In the embodiment of the present application, after obtaining the user behavior sequence of each user, the streaming media objects included in the user behavior sequence of each user can be obtained, and then a training sample set is constructed based on these streaming media objects and the user behavior sequence.

[0099] A training sample includes a first object set consisting of at least two streaming media objects in a user behavior sequence of a target user, and a second object set consisting of at least two streaming media objects in a user behavior sequence of a non-target user, and the first object set and the second object set have an intersection.

[0100] In this embodiment of the present application, since continuous object operations can better reflect user preferences, the first object set can be composed of at least two consecutive streaming media objects in the user behavior sequence of the target user, and the second object set can be composed of at least two consecutive streaming media objects in the user behavior sequence of the non-target users. Taking music as an example, the first object set is the multiple songs played continuously by user u, and the second object set is the multiple songs played continuously by users other than user u.

[0101] In one possible implementation, the first object set may include a first streaming object S1 and a second streaming object S2 in the target user's user behavior sequence, and the second object set may include a second streaming object S2 and a third streaming object S3 in the non-target user's user behavior sequence. For example, S1 and S2 represent adjacent music in the listening sequence of user u, while S2 and S3 represent adjacent music in the listening sequence of users other than user u.

[0102] For example, for a target user's user behavior sequence {S1, S2, S3, S4} and a non-target user's user behavior sequence {S2, S5, S6}, a possible training sample is {S2, S3, S5}, where {S2, S3} is the first object set and {S2, S5} is the second object set.

[0103] Alternatively, according to another training sample construction method, for the target user's user behavior sequence {S1, S2, S3, S4, S5} and a non-target user's user behavior sequence {S2, S3, S4, S5, S6}, then a possible training sample is {S2, S3, S4, S5}, where {S2, S3, S4} is the first object set and {S3, S4, S5} is the second object set.

[0104] Step 303: Iteratively train the difference learning model according to the training sample set.

[0105] In an embodiment of the present application, the initialization of the initial user representation vector of each user can be performed by random assignment, or by using an initialization algorithm to obtain the initial user representation vector of each user, or by performing feature extraction based on the user's basic information to obtain the user's initial user representation vector. The user's basic information may include the user's nickname, age, region, and historical data on operations on streaming media objects, etc.

[0106] The differential learning model is iteratively trained using the training sample set and the target user's initial user representation vector until convergence is achieved. Iterative training involves multiple training steps, each involving similar data processing. Therefore, the following description will focus on a single training step as an example.

[0107] Specifically, during each training, multiple loss values ​​can be obtained based on the user representation vector of the target user, and the first object set and the second object set of each training sample. One loss value is used to characterize the difference between the target user and the corresponding non-target user, and the user representation vector is updated based on the multiple loss values.

[0108] Among them, any algorithm that can calculate the loss value based on two object sets with an intersection can be applied to the embodiments of the present application. One possible algorithm is the triplet loss algorithm. Then, in each training sample, the intersection of the first object set and the second object set, the difference between the first object set and the intersection, and the difference between the second object set and the intersection can form a triplet. Then, based on the user representation vector of the target user and the triplet corresponding to each training sample, the triplet loss value corresponding to each training sample can be obtained. Among them, the representation of each member in the triplet can be obtained by the object representation vector of the streaming media object included in the member. For example, one of the members of the triplet, the intersection of the first object set and the second object set, can be represented by the object representation vector of the streaming media object in the intersection.

[0109] The triplet loss algorithm is introduced below by taking an example in which the first object set includes the first streaming media object S1 and the second streaming media object S2, and the second object set includes the second streaming media object S2 and the third streaming media object S3.

[0110] See also Figure 4 As shown in Figure 1, it is the model architecture of the difference learning model based on the triplet loss algorithm.

[0111] Specifically, the idea of ​​triplet loss can be used to Figure 4The three streaming media objects S1, S2 and S3 from left to right are shown to be classified with maximum interval. Among these three streaming media objects, S1 and S2 are adjacent objects in the user behavior sequence of the target user u, and S2 and S3 are adjacent objects in the user behavior sequence of non-target users, that is, adjacent objects of other users different from the target user u.

[0112] like Figure 5 The figure shows the training process of the difference learning model.

[0113] Step 501: for each training sample, based on the user feature vector of the target user, respectively predict a first probability that the user behavior sequence of the target user includes a first object set and a second probability that the user behavior sequence includes a second object set.

[0114] In the embodiment of the present application, the purpose of difference learning is to learn the differences between users, and the differences between users are reflected in the user's behavior. For example, user A is more likely to play which songs continuously, and user B is more likely to play other songs continuously, thereby reflecting the difference between user A and user B. Therefore, for a given target user, the first probability that the first object set is located in the user behavior sequence of the target user can be predicted based on the user feature vector of the target user, and the second probability that the second object set is located in the user behavior sequence of the target user can be predicted. Theoretically speaking, because the first object set is extracted from the user behavior sequence of the target user, the expectation for the first probability is as large as possible, and the second object set is extracted from the user behavior sequence of non-target users, so the expectation for the second probability is as small as possible, thereby maximizing the highlighting of the difference between the target user and the non-target user.

[0115] like Figure 4 As shown in the figure, S1's feature vector sequence is vector-encoded by the vector encoder layer of the difference learning model to obtain S1's object feature vector h1. S2's feature vector sequence is vector-encoded by the vector encoder layer to obtain S2's object feature vector h2, and so on. The acquisition of object feature vectors for each streaming object will be explained in detail later, so I will not elaborate on it here.

[0116] The definition of Triplet loss is as follows:

[0117] J=max(0,f(h1,h2)-f(h2,h3)-δ)

[0118] Among them, J is the loss value of {S1, S2, S3} in a training sample; f is a mapping function that maps multiple vectors to a score value. f(h1, h2) maps the object feature vectors h1 and h2 corresponding to S1 and S2 to a score value, and f(h2, h3) maps the object feature vectors h2 and h3 corresponding to S2 and S3 to another score value. The score value can be used to represent similarity, distance, and the probability of a behavior belonging to a certain user, for example; δ is a small positive integer, also called an interval.

[0119] Since S1 and S2 are adjacent objects in the user behavior sequence of target user u, {S1, S2} can be considered positive samples that can represent target user u's behavior, while S2 and S3 are adjacent objects in the user behavior sequence of non-target users. With respect to target user u, {S2, S3} can be considered negative samples of target user u. The goal of J is to ensure that the difference between the score of the positive sample {S1, S2} and the score of the negative sample {S2, S3} is greater than δ, thereby maximizing the difference between positive and negative samples. Since {S1, S2} comes from target user u and {S2, S3} comes from other users, maximizing the difference between positive and negative samples is essentially equivalent to learning the difference between target user u and other users. This allows us to learn a representation vector that can represent the difference between target user u and other users, which can then be used to characterize the target user u.

[0120] In specific applications, in order to obtain the representation of the user related to the streaming media object, the initial user representation vector hu of the initialized target user u can be input into the triplet loss together with h1~h3, so that the above formula can be transformed into the following formula:

[0121] J=max(0,f(h1,h2,hu))-f(h2,h3,hu)-δ)

[0122] Wherein, f(h1, h2, hu) is a first probability that the user behavior sequence of the target user includes the first object set, and f(h2, h3, hu) is a second probability that the user behavior sequence of the target user includes the second object set.

[0123] In the embodiment of the present application, after introducing hu, the model can know that this triplet loss is unique to the target user u. For example, two users u1 and u2 may have some samples in common, such as they have played S1 and S2 successively, but have not played S2 and S3 successively. However, these two users will always have other samples that are different. Therefore, the model can learn the difference between u1 and u2 based on the introduction of hu.

[0124] Specifically, when obtaining the first probability and the second probability, a first correlation degree between the first and second streaming media objects relative to the target user's user feature vector can be obtained, and a second correlation degree between the second and third streaming media objects relative to the target user's user feature vector can be obtained. Based on the first correlation degree, a first probability for the first set of objects is obtained, and based on the second correlation degree, a second probability for the second set of objects is obtained. The correlation degree value is positively correlated with the probability value. In other words, from the perspective of the target user, looking at the correlation degree between the first and second streaming media objects, as well as the correlation degree between the second and third streaming media objects, generally speaking, the higher the correlation degree relative to the target user, the higher the probability that a set of streaming media objects is located in the user behavior sequence of that user.

[0125] Step 502: Obtain a loss value for each training sample according to the first probability and the second probability, wherein the loss value is positively correlated with the first probability and negatively correlated with the second probability.

[0126] In an embodiment of the present application, after obtaining the first probability corresponding to the first object set and the second probability corresponding to the second object set, the loss value of each training sample can be obtained based on the first probability and the second probability, wherein the loss value is positively correlated with the first probability and negatively correlated with the second probability.

[0127] Specifically, the loss value can be calculated according to f(h1, h2, hu) and f(h2, h3, hu) using the above formula, and the loss value is related to the difference between the first probability and the second probability.

[0128] Step 503: Determine whether the convergence condition is met.

[0129] When the determination result in step 503 is yes, that is, the model has satisfied the convergence condition, the training ends.

[0130] Step 504 : When the determination result of step 503 is no, update the user feature vector of the target user and jump to step 501 .

[0131] Through the above process, the loss values ​​corresponding to all training samples can be obtained. Then, based on the loss values, it is possible to determine whether the difference learning model has converged. If the convergence conditions are met, the iterative training ends. If the convergence conditions are not met, the user feature vector of the target user can be updated and the next training process can be entered. Among them, the user feature vector of the target user can be regarded as the model parameter of the difference learning model, which is gradually updated during the training process. Of course, in addition to the user feature vector of the target user, other model parameters can also be included and gradually optimized during the training process.

[0132] Specifically, the convergence condition may include one or more of the following conditions:

[0133] (1) The loss value of each training sample is not less than the set first threshold.

[0134] (2) The sum of the loss values ​​of all training samples is not less than a set second threshold, and the second threshold is greater than the first threshold.

[0135] Please continue to see below Figure 3 .

[0136] Step 304: When the difference learning model converges, a user portrait of the target user is obtained according to the user representation vector.

[0137] When the difference learning model converges, that is, when the difference between the target user and non-target users is maximized, the model can know that this triplet loss is unique to the target user u. Then, the user representation vector of the target user at the final convergence of the model can be used as the representation of the target user in terms of streaming media objects and added to the portrait of u.

[0138] The following describes a process for obtaining an object feature vector of a streaming media object. Since the process for obtaining an object feature vector of each streaming media object is similar, a streaming media object is used as an example for a detailed description.

[0139] In specific applications, the streaming media data of each streaming media object can be obtained, and then the feature vector sequence of each streaming media object can be obtained based on the streaming media data of each streaming media object. The feature vector sequence can express the streaming media data information of the streaming media object itself, and then vector encoding is performed based on the feature vector sequence of the streaming media object to obtain the object representation vector of each streaming media object.

[0140] When the streaming media object is a video, the corresponding feature vector sequence can be obtained according to the video stream data of each video.

[0141] Specifically, for a video, the video stream data can be divided into multiple video segments in time, and then feature extraction can be performed on each video segment. A feature vector can be obtained for each video segment, thereby obtaining a feature vector sequence composed of the feature vectors of multiple video segments of the video. During feature extraction, a convolutional neural network (CNN) can be used to extract features for each video segment separately, or a long short-term memory network (LSTM) can be used to extract features while also extracting time series information between the video segments, thereby extracting richer features.

[0142] When the streaming media object is audio, when obtaining the audio feature vector sequence, sampling can be performed based on the audio data for each audio to obtain an audio spectrogram corresponding to each audio. The audio spectrogram includes a frequency sequence of multiple temporally consecutive time segments for each audio, and the frequency sequence of each time segment corresponds to a feature vector in the feature vector sequence.

[0143] In an embodiment of the present application, when obtaining a sequence of audio feature vectors, sampling may be performed based on the audio data for each audio frequency to obtain an audio spectrogram corresponding to each audio frequency. The audio spectrogram includes a frequency sequence of multiple temporally continuous time segments for each audio frequency, and the frequency sequence of each time segment corresponds to one feature vector in the sequence of feature vectors.

[0144] like Figure 6 As shown in FIG, it is a flowchart of obtaining an audio spectrum diagram by audio sampling.

[0145] S601: Perform time domain sampling on the audio data of each audio according to a set time interval to obtain multiple time series of each audio in the time domain.

[0146] Generally speaking, audio signals are expressed in two dimensions: time domain and frequency domain. They can be expressed as either a time series or a frequency series. Therefore, the audio signal is first sampled in the time dimension. For example, an audio signal can be sampled every 0.1s to obtain a discrete time series T1 to Tn, where each value represents the size of the audio at that sampling point.

[0147] Of course, in actual applications, the frequency domain may be sampled first, that is, the frequency domain and the time domain are swapped in actual operation, and the embodiments of the present application do not limit this.

[0148] S602: Combining multiple time series according to the set time segment length to obtain multiple time series combinations.

[0149] After obtaining the discrete time series T1 to Tn, they are combined according to the set time period length. For example, if the time period length is 3s and the sampling interval is 0.1s, then each group of sequences contains 3s / 0.1s=30 values. For example, T1 to T30 is a group named G1, T31 to T60 is named G2, and so on. Finally, multiple time series combinations G1 to Gm are obtained.

[0150] S603: For each time series combination, perform time-frequency conversion on each time series combination, sample the frequency domain signal according to a set frequency interval, and obtain a frequency sequence corresponding to each time series combination.

[0151] For each time series combination Gi, a time-frequency conversion is performed on it. For example, algorithms such as fast Fourier transform (FFT), Mel Frequency Cepstrum Coefficient (MFCC), and discrete Fourier transform (DFT) can be used to obtain the frequency signal of each time series combination Gi. A frequency signal represents the distribution of different frequencies contained in a set of time series.

[0152] Then, the frequency signal of each time series combination Gi is sampled according to the set frequency interval. For example, the frequency interval can be 10hz, so that a discrete frequency sequence is obtained. Assuming that the upper and lower limits of the frequency are 0~f, the number of each frequency sequence is f / 10. Each Gi can be represented by so many frequency sequences, but the difference is that the values ​​of the same frequency of different Gi are different. Corresponding to the audio, that is, some parts of the audio have heavy bass, then the low-frequency values ​​of these Gi are large, and some parts have high treble, then the high-frequency values ​​of these Gi are large. Assuming there are n Gi and m frequencies, we get an mxn matrix, which is the spectrum diagram. See Figure 7 As shown in the figure, it is a schematic diagram of the spectrum after audio decomposition, where the horizontal axis is the time axis, and the interval between the time periods is about 1.75s, that is, the length of each Gi time segment is 1.75s, and the vertical axis is the frequency axis, which represents the frequency corresponding to each time segment. The upper and lower limits of the frequency are 110hz~3520hz, and the grayscale value represents the size of the value corresponding to different frequencies.

[0153] In summary, through streaming media objects and user behavior, a profile related to the streaming media object is generated for each user. The resulting profile serves as part of the user's basic profile and more finely depicts the user's preferences.

[0154] In the embodiment of the present application, the representation vector of each user can be obtained through the above process, and the user's representation vector can be used in the process of recommending streaming media objects.

[0155] Specifically, when it is necessary to recommend a streaming media object to a user, the representation vector of the target user to be recommended can be matched with the object representation vectors of each streaming media object, and then the streaming media objects with a matching degree greater than a set matching degree threshold can be recommended to the target user.

[0156] Alternatively, streaming media objects can be recommended based on similar users. Specifically, the target user's user representation vector can be matched with the user representation vectors of other users to identify similar users with a similarity greater than a set similarity threshold. The streaming media objects that are in the user behavior sequences of the similar users can then be recommended to the target user.

[0157] See Figure 8 Based on the same inventive concept, the embodiment of the present application further provides a device 80 for obtaining a user portrait, the device comprising:

[0158] The user sequence acquisition unit 801 is used to acquire user behavior sequences of a target user and multiple non-target users; wherein a user behavior sequence includes multiple streaming media objects operated by a user;

[0159] A training sample construction unit 802 is configured to construct a training sample set based on each user behavior sequence; wherein a training sample includes a first object set consisting of at least two streaming media objects in the user behavior sequence of a target user, and a second object set consisting of at least two streaming media objects in the user behavior sequence of a non-target user, and the first object set and the second object set have an intersection;

[0160] A training unit 803 is configured to iteratively train the difference learning model based on the training sample set; wherein, during each training step, a plurality of loss values ​​are obtained based on the user representation vector of the target user and the first object set and the second object set of each training sample, wherein each loss value is used to represent the difference between the target user and the corresponding non-target user, and the user representation vector is updated based on the plurality of loss values;

[0161] The portrait unit 804 is used to obtain a user portrait of the target user according to the user representation vector when the difference learning model converges according to multiple loss values.

[0162] Optionally, the first object set consists of at least two consecutive streaming media objects in a user behavior sequence of a target user, and the second object set consists of at least two consecutive streaming media objects in a user behavior sequence of a non-target user.

[0163] Optionally, in each training sample, the intersection of the first object set and the second object set, the difference between the first object set and the intersection, and the difference between the second object set and the intersection form a triplet;

[0164] The training unit 803 is specifically configured to:

[0165] According to the user representation vector of the target user and the triplet corresponding to each training sample, the triplet loss value corresponding to each training sample is obtained.

[0166] Optionally, the training unit 803 is specifically configured to:

[0167] For each training sample, obtaining a first probability that the target user's user behavior sequence includes a first set of objects and a second probability that the target user's user behavior sequence includes a second set of objects based on the user representation vector and the object representation vector of the streaming media object in each training sample;

[0168] A loss value of each training sample is obtained according to the first probability and the second probability, wherein the loss value is positively correlated with the first probability and negatively correlated with the second probability.

[0169] Optionally, the first object set includes a first streaming media object and a second streaming media object, and the second object set includes a second streaming media object and a third streaming media object;

[0170] The training unit 803 is specifically configured to:

[0171] Obtaining a first correlation between the first streaming media object and the second streaming media object relative to the user representation vector, and obtaining a second correlation between the second streaming media object and the third streaming media object relative to the user representation vector;

[0172] A first probability is obtained according to the first correlation degree, and a second probability is obtained according to the second correlation degree; wherein the correlation degree value is positively correlated with the probability value.

[0173] Optionally, the convergence conditions for the difference learning model include:

[0174] The loss value of each training sample is not less than a set first threshold; and / or,

[0175] The sum of the loss values ​​of all training samples is not less than a set second threshold, and the second threshold is greater than the first threshold.

[0176] Optionally, the device further includes an object vector acquiring unit 805, configured to:

[0177] Obtaining a feature vector sequence of each streaming media object according to the streaming media data of each streaming media object;

[0178] Vector encoding is performed according to the feature vector sequence of each stream media object respectively, to obtain an object representation vector of each stream media object.

[0179] Optionally, the object vector obtaining unit 805 is specifically configured to:

[0180] The audio data of each audio is sampled to obtain an audio spectrum graph corresponding to each audio.

[0181] The audio spectrum graph includes a frequency sequence of a plurality of time segments of each audio in time, and the frequency sequence of a time segment corresponds to a feature vector in the feature vector sequence.

[0182] Optionally, the object vector obtaining unit 805 is specifically configured to:

[0183] For each audio, the audio data of each audio is sampled in time domain according to a set time interval, to obtain a plurality of time sequences of each audio in time domain.

[0184] The plurality of time sequences are combined according to a set time segment length, to obtain a plurality of time sequence combinations.

[0185] For each time sequence combination, after time-frequency conversion of each time sequence combination, a frequency domain signal is sampled according to a set frequency interval, to obtain a frequency sequence corresponding to each time sequence combination.

[0186] The apparatus can be used to execute the method shown in the embodiments shown in the Figures 3-7 , so the functions and the like that can be achieved by the function modules of the apparatus can refer to the description of the embodiments shown in the Figures 3-7 , and will not be described in detail.

[0187] Please refer to Figure 9 , based on the same inventive concept, the embodiments of the present application further provide a stream media object recommendation apparatus 90, the apparatus comprises:

[0188] The user vector obtaining unit 901 is configured to obtain a user representation vector of a target user by the method of obtaining a user portrait.

[0189] The recommendation unit 902 is configured to recommend a stream media object with a matching degree greater than a set matching degree threshold to the target user according to a matching result of the user representation vector of the target user and the object representation vector of each stream media object, or perform similar matching on the user representation vector of the target user and the user representation vector of other users to determine similar users with a similarity greater than a set similarity threshold, and recommend a stream media object in a user behavior sequence of the similar user to the target user.

[0190] The device can be used to execute the steps of the streaming media object recommendation process. Therefore, for the functions that can be implemented by each functional module of the device, reference can be made to the description of the embodiment of the streaming media object recommendation process above, and no further details will be given.

[0191] See Figure 10 Based on the same technical concept, an embodiment of the present application also provides a computer device 100, which may include a memory 1001 and a processor 1002.

[0192] The memory 1001 is used to store computer programs executed by the processor 1002. The memory 1001 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the computer device, etc. The processor 1002 may be a central processing unit (CPU), or a digital processing unit, etc. The specific connection medium between the above-mentioned memory 1001 and the processor 1002 is not limited in the embodiment of the present application. The embodiment of the present application is Figure 10 In the embodiment, the memory 1001 and the processor 1002 are connected via a bus 1003. The bus 1003 is connected to the processor 1002 via a bus 1003. Figure 10 The bus 1003 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0193] Memory 1001 may be a volatile memory, such as random-access memory (RAM); a non-volatile memory, such as read-only memory, flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1001 may be a combination of the above memories.

[0194] The processor 1002 is configured to execute the following when calling the computer program stored in the memory 1001: Figures 3-7 The method executed by the device in the embodiment shown or the embodiment of the above-mentioned streaming media object recommendation process.

[0195] In some possible implementations, various aspects of the method provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to perform the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may perform the following steps: Figures 3-7 The embodiment shown is a method executed by a device in the embodiment of the above-mentioned streaming media object recommendation process.

[0196] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0197] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.

[0198] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A method for obtaining a user portrait, characterized in that: The method comprises: Obtaining user behavior sequences of a target user and multiple non-target users; wherein a user behavior sequence includes multiple streaming media objects operated by a user; A training sample set is constructed based on each user behavior sequence; wherein a training sample comprises a triple consisting of the intersection of a first object set and a second object set, the difference between the first object set and the intersection, and the difference between the second object set and the intersection, wherein the first object set is composed of at least two consecutive streaming media objects in the user behavior sequence of the target user, and the second object set is composed of at least two consecutive streaming media objects in the user behavior sequence of a non-target user; Iteratively training the difference learning model based on the training sample set; wherein, during each training, a plurality of loss values ​​are obtained based on the user representation vector of the target user and the triples corresponding to each training sample, each loss value being a triplet loss value corresponding to a corresponding training sample, and a loss value being used to characterize the difference between the target user and corresponding non-target users, and the user representation vector is updated based on the plurality of loss values; When it is determined that the difference learning model converges according to the multiple loss values, a user portrait of the target user is obtained according to the user representation vector.

2. A method for obtaining a user portrait, characterized in that: The method comprises: Obtaining user behavior sequences of a target user and multiple non-target users; wherein a user behavior sequence includes multiple streaming media objects operated by a user; Constructing a training sample set based on each user behavior sequence; wherein one training sample includes a first object set consisting of at least two streaming media objects in the user behavior sequence of the target user, and a second object set consisting of at least two streaming media objects in the user behavior sequence of the non-target user, and the first object set and the second object set have an intersection; The difference learning model is iteratively trained based on the training sample set; wherein, during each training session, for each training sample, based on the user representation vector of the target user and the object representation vector of the streaming media object in each training sample, a first probability that the user behavior sequence of the target user includes the first object set and a second probability that the user behavior sequence includes the second object set are obtained respectively; based on the first probability and the second probability corresponding to each training sample, a plurality of loss values ​​are obtained, wherein each loss value is positively correlated with the first probability of the corresponding training sample and negatively correlated with the second probability, and a loss value is used to characterize the difference between the target user and the corresponding non-target user; and the user representation vector is updated based on the plurality of loss values; When it is determined that the difference learning model converges according to the multiple loss values, a user portrait of the target user is obtained according to the user representation vector.

3. The method according to claim 2, wherein The first object set includes a first streaming media object and a second streaming media object, and the second object set includes the second streaming media object and a third streaming media object; Then, for each training sample, based on the user representation vector and the object representation vectors of the streaming media objects in each training sample, respectively obtaining a first probability that the user behavior sequence of the target user includes the first object set and a second probability that the user behavior sequence includes the second object set, including: Obtaining a first correlation between the first streaming media object and the second streaming media object relative to the user representation vector, and obtaining a second correlation between the second streaming media object and the third streaming media object relative to the user representation vector; The first probability is obtained according to the first correlation degree, and the second probability is obtained according to the second correlation degree; wherein the correlation degree value is positively correlated with the probability value.

4. The method according to claim 1 or 2, wherein: The convergence conditions of the difference learning model include: The loss value of each training sample is not less than a set first threshold; and / or, The sum of the loss values ​​of all training samples is not less than a set second threshold, and the second threshold is greater than the first threshold.

5. The method according to claim 1 or 2, wherein: Before iteratively training the difference learning model according to the training sample set, the method further includes: Obtaining a feature vector sequence of each streaming media object according to the streaming media data of each streaming media object; Vector encoding is performed according to the feature vector sequence of each streaming media object to obtain the object representation vector of each streaming media object.

6. The method according to claim 5, wherein If each streaming media object is audio, then obtaining a feature vector sequence of each streaming media object based on the streaming media data of each streaming media object includes: The audio data of each audio is sampled respectively to obtain an audio spectrum corresponding to each audio; The audio spectrogram includes a frequency sequence of multiple time segments that are temporally continuous for each audio, and the frequency sequence of a time segment corresponds to a feature vector in the feature vector sequence.

7. The method according to claim 6, wherein The audio data of each audio is sampled separately to obtain the audio spectrum corresponding to each audio, including: For each audio, perform time domain sampling on the audio data of each audio according to a set time interval to obtain multiple time series of each audio in the time domain; Combining the multiple time series according to the set time segment length to obtain multiple time series combinations; For each time series combination, after performing time-frequency conversion on each time series combination, the frequency domain signal is sampled according to a set frequency interval to obtain a frequency sequence corresponding to each time series combination.

8. A device for obtaining a user portrait, characterized in that: The device comprises: A user sequence acquisition unit is used to acquire user behavior sequences of a target user and multiple non-target users; wherein a user behavior sequence includes multiple streaming media objects operated by a user; A training sample construction unit is configured to construct a training sample set based on each user behavior sequence; wherein a training sample comprises a triple consisting of the intersection of a first object set and a second object set, the difference between the first object set and the intersection, and the difference between the second object set and the intersection, wherein the first object set consists of at least two consecutive streaming media objects in the user behavior sequence of the target user, and the second object set consists of at least two consecutive streaming media objects in the user behavior sequence of a non-target user; a training unit, configured to iteratively train the difference learning model based on the training sample set; wherein, during each training session, a plurality of loss values ​​are obtained based on the user representation vector of the target user and the triples corresponding to the training samples, each loss value being a triplet loss value corresponding to the corresponding training sample, and a loss value being used to characterize the difference between the target user and the corresponding non-target users; and the user representation vector is updated based on the plurality of loss values; A determination unit is used to obtain a user portrait of the target user according to the user representation vector when it is determined that the difference learning model has converged according to the multiple loss values.

9. A device for obtaining a user portrait, characterized in that: The device comprises: A user sequence acquisition unit is used to acquire user behavior sequences of a target user and multiple non-target users; wherein a user behavior sequence includes multiple streaming media objects operated by a user; A training sample construction unit is configured to construct a training sample set based on each user behavior sequence; wherein a training sample includes a first object set consisting of at least two streaming media objects in the user behavior sequence of the target user, and a second object set consisting of at least two streaming media objects in the user behavior sequence of the non-target user, and the first object set and the second object set have an intersection; A training unit is configured to iteratively train the difference learning model based on the training sample set; wherein, during each training session, for each training sample, based on the user representation vector of the target user and the object representation vectors of the streaming media objects in each training sample, obtain a first probability that the user behavior sequence of the target user includes the first object set and a second probability that the user behavior sequence includes the second object set; based on the first probability and the second probability corresponding to each training sample, obtain multiple loss values, wherein each loss value is positively correlated with the first probability of the corresponding training sample and negatively correlated with the second probability, and one loss value is used to characterize the difference between the target user and the corresponding non-target user; and update the user representation vector based on the multiple loss values; A determination unit is used to obtain a user portrait of the target user according to the user representation vector when it is determined that the difference learning model has converged according to the multiple loss values.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • User behavior portrait construction method and device, equipment and storage medium

    CN111861545A