Model training method and related device

By extracting features and masking the song sequences in the music recommendation system, and adjusting the model parameters using machine learning, the problem of difficulty in identifying user interests was solved, resulting in more accurate song recommendations.

CN116401400BActive Publication Date: 2026-01-09TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310442515.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2026-01-09
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

Music recommendation systems struggle to accurately identify core interests after users have engaged in a wide range of listening behaviors, leading to an "interest collapse" problem and an inability to accurately recommend songs.

Method used

By obtaining the initial song sequence of the target user, masking is performed based on song tags and attributes to construct a comparison song sequence, and machine learning techniques are used to adjust model parameters to generate a target song recommendation model.

Benefits of technology

This improved the model training effect, enabling the recommendation model to more accurately recommend songs that users are interested in, thus solving the "interest collapse" problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116401400B_ABST
    Figure CN116401400B_ABST
Patent Text Reader

Abstract

The application discloses a model training method and related equipment. The method comprises the following steps: obtaining an initial song sequence generated according to song information of multiple songs of a target user, each song corresponding to a song label, the song label being a positive example label or a negative example label; performing mask processing on the initial song sequence according to the song attributes of each song with the positive example label to obtain a comparison song sequence; inputting the initial song sequence and the comparison song sequence into an initial song recommendation model respectively for processing to obtain a reference feature sequence of the initial song sequence and a comparison feature sequence of the comparison song sequence; determining a first difference parameter according to the reference feature sequence and the comparison feature sequence, adjusting model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model. Through the method, the model training effect can be improved, and the target song recommendation model obtained can accurately recommend songs of interest to the user.
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 a model training method, a computer device and a computer readable storage medium. BACKGROUND

[0002] The music recommendation system will recommend songs according to the user's listening interest points. The listening interest points are determined according to the user's historical listening data. However, when the user's listening behavior is particularly rich and the number of listening history reaches a certain value (such as 2000) or more, the "interest collapse" problem is likely to occur. The so-called "interest collapse" refers to that after the user's behavior is too rich, the recommendation system is difficult to accurately identify the user's core interest points, which are submerged by other accidental interest points.

[0003] Therefore, how to solve the "interest collapse" problem and more accurately recommend songs to users has become a technical problem to be solved. SUMMARY

[0004] The embodiments of the present application provide a model training method and related devices, which can improve the model training effect, so that the obtained target song recommendation model can accurately recommend songs of interest to users.

[0005] In one aspect, the embodiments of the present application disclose a model training method, which comprises:

[0006] An initial song sequence of a target user is obtained, the initial song sequence is generated according to song information of a plurality of songs involved in the listening behavior of the target user, each song in the plurality of songs corresponds to a song label, the song label is a positive example label or a negative example label, and the song label is determined according to a playing feature corresponding to the song;

[0007] A song attribute of each song whose song label is the positive example label is determined, and the initial song sequence is subjected to mask processing according to the song attribute to obtain a comparison song sequence, the song attribute is a key song attribute or a non-key song attribute;

[0008] The initial song sequence is input into an initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, and the comparison song sequence is input into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence.

[0009] A first difference parameter is determined according to the reference feature sequence and the comparison feature sequence, and a model parameter of the initial song recommendation model is adjusted according to the first difference parameter to obtain a target song recommendation model.

[0010] Correspondingly, the embodiment of the present application discloses a model training device, which comprises:

[0011] An acquisition unit is configured to acquire an initial song sequence of a target user, wherein the initial song sequence is generated according to song information of a plurality of songs involved in a song listening behavior of the target user, the plurality of songs are songs involved in the song listening behavior of the target user, each song in the plurality of songs corresponds to a song label, the song label is a positive example label or a negative example label, and the song label is determined according to a corresponding playing feature of the song.

[0012] A determination unit is configured to determine a song attribute of each song with the positive example label, and perform mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, wherein the song attribute is a key song attribute or a non-key song attribute.

[0013] A processing unit is configured to input the initial song sequence into an initial song recommendation model to obtain a reference feature sequence of the initial song sequence, and input the comparison song sequence into the initial song recommendation model to obtain a comparison feature sequence of the comparison song sequence.

[0014] The determination unit is further configured to determine a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjust a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

[0015] In a possible implementation manner, when determining the song attribute of each song with the positive example label, the determination unit is specifically configured to perform the following steps:

[0016] An operation behavior of a user for a target song is acquired, wherein the target song is any one of the songs with the positive example label in the plurality of songs.

[0017] If the operation behavior of the user for the target song has a target behavior, the song attribute of the target song is determined as the key song attribute, and the target behavior includes one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior.

[0018] If the operation behavior of the user for the target song does not have the target behavior, the song attribute of the target song is determined as the non-key song attribute.

[0019] In a possible implementation manner, when determining the song attribute of each song with the positive example label, the determination unit is specifically configured to perform the following steps:

[0020] determining a song feature of a first song and a song feature of a second song, the first song being any song in a song set, the second song being any song in the song set except the first song, the song set being composed of songs in the plurality of songs with the song tag being the positive example tag;

[0021] determining a song similarity of the first song and the second song according to the song feature of the first song and the song feature of the second song;

[0022] determining a proportion of songs in the song set having a song similarity with the first song greater than or equal to a similarity threshold according to the song similarity;

[0023] if the proportion is greater than or equal to a proportion threshold, determining that the song attribute of the first song is the key song attribute;

[0024] if the proportion is less than the proportion threshold, determining that the song attribute of the first song is the non-key song attribute.

[0025] In a possible implementation, a processing unit is configured to perform the following steps when performing mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence:

[0026] determining a first to-be-processed song from songs with the key song attribute, and performing mask processing on a sequence element corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;

[0027] determining a second to-be-processed song from songs with the non-key song attribute, and performing mask processing on a sequence element corresponding to the second to-be-processed song in the initial song sequence to obtain a second song sequence;

[0028] determining the first song sequence and the second song sequence as the comparison song sequence;

[0029] The processing of the comparison song sequence in the initial song recommendation model to obtain a comparison feature sequence of the comparison song sequence includes:

[0030] processing the first song sequence in the initial song recommendation model to obtain a first comparison feature sequence;

[0031] processing the second song sequence in the initial song recommendation model to obtain a second comparison feature sequence;

[0032] determining the first comparison feature sequence and the second comparison feature sequence as the comparison feature sequence.

[0033] In a possible implementation, when the determining unit determines the first difference parameter according to the reference feature sequence and the contrast feature sequence, the determining unit specifically performs the following steps:

[0034] determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,

[0035] determining a second similarity parameter between the reference feature sequence and the second contrast feature sequence,

[0036] determining the first difference parameter according to the first similarity parameter and the second similarity parameter.

[0037] In a possible implementation, the target user is included in a user set, the user set includes a plurality of users, and when the determining unit determines the first difference parameter according to the reference feature sequence and the contrast feature sequence, the determining unit specifically performs the following steps:

[0038] obtaining an initial song sequence of a reference user, inputting the initial song sequence of the reference user into an initial song recommendation model for processing to obtain a feature sequence of the initial song sequence of the reference user; the reference user is any one user in the user set except the target user;

[0039] determining a third similarity parameter between the reference feature sequence and the feature sequence of the initial song sequence of the reference user;

[0040] determining the first difference parameter according to the first similarity parameter, the second similarity parameter, and the third similarity parameter corresponding to each reference user.

[0041] In a possible implementation, the processing result of the initial song recommendation model on the initial song sequence further includes a prediction result set of the initial song sequence, the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate a recommendation degree of the each song.

[0042] The determining unit determines a second difference parameter according to the prediction result of each song in the plurality of songs and the song label.

[0043] When the processing unit adjusts the model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model, the processing unit specifically performs the following steps:

[0044] determining a target difference parameter according to the first difference parameter and the second difference parameter;

[0045] According to the target difference parameter, model parameters of the initial song recommendation model are adjusted to obtain a target song recommendation model.

[0046] In a possible implementation, the obtaining unit obtains song information of a song to be recommended and song recommendation indication information of a user to be recommended.

[0047] The processing unit inputs the song recommendation indication information and the song information of the song to be recommended into the target song recommendation model for processing to obtain a recommendation score of the song to be recommended, and performs song recommendation on the song to be recommended according to the recommendation score.

[0048] Accordingly, the embodiment of the present application discloses a computer device, which comprises a processor adapted to implement one or more computer programs; and a computer storage medium, which stores one or more computer programs, and the one or more computer programs are adapted to be loaded and executed by the processor to implement the above model training method.

[0049] Accordingly, the embodiment of the present application discloses a computer readable storage medium, which stores one or more computer programs, and the one or more computer programs are adapted to be loaded and executed by the processor to implement the above model training method.

[0050] Accordingly, the embodiment of the present application discloses a computer program product, which comprises a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program to make the computer device implement the above model training method.

[0051] In the embodiment of the present application, the initial song sequence of the target user is obtained, the initial song sequence is generated according to the song information (name, singer, style, language) of multiple songs, the multiple songs are the songs (historical listening songs) involved in the song listening behavior of the target user, each song in the multiple songs corresponds to a song label, the song label is a positive example label or a negative example label, and the song label is determined according to the corresponding playing feature of the song; the song attribute of each song with the positive example label is determined, and the initial song sequence is masked and processed according to the song attribute to obtain a comparison song sequence, and the song attribute is a key song attribute or a non-key song attribute; the songs with the positive example label are divided into attributes to obtain the comparison song sequence, and the comparison song sequence formed after introducing the attribute information can more accurately divide the initial song sequence of the user and can more accurately determine the interest point of the user. The initial song sequence is input into the initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, the comparison song sequence is input into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence; the first difference parameter is determined according to the reference feature sequence and the comparison feature sequence, and the model parameter of the initial song recommendation model is adjusted according to the first difference parameter to obtain a target song recommendation model. The model training can be improved by using the data processed by the above steps, that is, the interest point of the user can be trained more accurately, so that the target song recommendation model obtained can accurately recommend the songs interested by the user. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0053] Figure 1 is a network architecture schematic diagram of a model training system provided by an embodiment of the present application;

[0054] Figure 2 is a flowchart schematic diagram of a model training method provided by an embodiment of the present application;

[0055] Figure 3 is a schematic diagram for constructing a comparison song sequence provided by an embodiment of the present application;

[0056] Figure 4 is a framework diagram of a model provided by an embodiment of the present application;

[0057] Figure 5is a flowchart of another model training method provided by an embodiment of the present application.

[0058] Figure 6 is a structural diagram of a model training device provided by an embodiment of the present application.

[0059] Figure 7 is a structural diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to 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 the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0061] In order to more accurately recommend songs to users, the embodiments of the present application propose a model training method, which improves the original song recommendation model. Specifically, the training data is accurately divided, so that the training effect of the model is improved, and the obtained target song recommendation model can accurately recommend songs of interest to users.

[0062] The model training method provided by the embodiments of the present application can be based on artificial intelligence (Artificial Intelligence, AI). Artificial intelligence is the theory, method, technology and application system for simulating, extending and expanding human intelligence by using digital computers or machines controlled by digital computers, perceiving environment, acquiring knowledge and using knowledge to obtain optimal 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 the design principle and implementation method of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive subject, involving a wide range of fields, including both hardware and software technologies. Artificial intelligence basic technologies generally include sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning and other fields.

[0063] The model training method provided by the embodiments of the present application mainly relates to the machine learning (ML) technology in the AI technology. Machine learning is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other subjects. It is specially studied how a computer simulates or implements human learning behavior to obtain new knowledge or skills, and reorganizes the existing knowledge structure to continuously improve its performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its application is widespread in various fields of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and rule-based learning.

[0064] In a feasible embodiment, the model training method provided by the embodiments of the present application can also be implemented based on cloud technology and / or blockchain technology. Specifically, it can involve one or more of cloud storage, cloud database, and big data in cloud technology. For example, the data required for executing the model training method (such as the initial song sequence of the target user, the initial song recommendation model, etc.) can be obtained from the cloud database. For another example, the data required for executing the model training method can be stored in the form of blocks on the blockchain; the data generated by executing the model training method (such as the target song recommendation model) can be stored in the form of blocks on the blockchain; in addition, the data processing device for executing the model training method can be a node device in the blockchain network.

[0065] Specifically, cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, be used on demand, and is flexible and convenient. Cloud computing technology will become a crucial support. Cloud storage is a new concept that extends and develops from cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to aggregate a large number of various types of storage devices (also called storage nodes) in a network to work collaboratively, providing data storage and business access functions. A database, simply put, can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of application programs.

[0066] The following is combined with Figure 1 This paper introduces a model training system suitable for implementing the model training method provided in the embodiments of this application, and describes the application scenarios of the model training method. Please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of the network architecture of a model training system according to an embodiment of this application, such as... Figure 1 As shown, the model training system may include at least a server 101 and terminal devices 102, and the number of terminal devices 102 may be one or more. The server 101 may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. This application embodiment does not limit this. The terminal device 102 may be a smartphone, tablet computer, laptop computer, desktop computer, smart voice interaction device, smartwatch, vehicle terminal, smart home appliance, aircraft, etc., but is not limited to these. The server 101 and terminal device 102 may establish a direct communication connection via wired communication or an indirect communication connection via wireless communication. This application embodiment does not limit this.

[0067] based on Figure 1The model training system provided in the application embodiment can be executed by the server 101, and the model training process includes: the server 101, obtaining an initial song sequence of a target user, the initial song sequence being generated according to song information (name, singer, style, language) of a plurality of songs, the plurality of songs being songs (historical listening songs) involved in a song listening behavior of the target user, each song in the plurality of songs corresponding to a song label, the song label being a positive example label or a negative example label, the song label being determined according to a playing feature corresponding to the song; determining a song attribute of each song with the positive example label, and performing mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, the song attribute being a key song attribute or a non-key song attribute; performing attribute division on the song with the positive example label to obtain the comparison song sequence; inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence; determining a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjusting a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

[0068] After the target song recommendation model is trained based on the training process, the application of the model can be executed by the terminal device 102, which can be understood as deploying the target song recommendation model in the terminal device 102, and recommending music to the user in various music recommendation systems, that is, a music recommendation scene. In the music recommendation scene, the target song recommendation model is used to recommend songs to the user. After the user starts a music application program a, the terminal device 102 can call the target song recommendation model to obtain attribute information of the user (including an identifier, an avatar, a gender, and song recommendation indication information of the user), and then recommend songs that the user likes according to the attribute information and the interest point of the user. The recommended songs can be a set, and the set is stored in a music list and displayed as a user “recommendation list”, “daily recommendation” and the like. The user can play the songs through the list.

[0069] Alternatively, the terminal device 102 recommends songs to the user in real time. After the user starts a music application program a, the terminal device 102 can call the target song recommendation model to obtain attribute information of the user (including an identifier, an avatar, a gender, and song recommendation indication information of the user). When the user clicks a real-time type playing control such as “radio” or “live broadcast”, the terminal device 102 recommends songs to the user in real time based on the attribute information of the user and the interest point of the user. After the user listens to a song A, the terminal device 102 recommends songs with a style close to that of the song A to the user in real time.

[0070] Optionally, the model training described above can be used to train any and recommendation-related model, for example, a commodity recommendation model, which can recommend commodities of interest to a user to the user; a literature recommendation model, which can recommend literary works of interest to a user to the user; a video recommendation model, which can recommend videos of interest to a user to the user.

[0071] It can be understood that the model training system described in the embodiments of the present application is for more clearly illustrating the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be known by those skilled in the art that, with the evolution of system architecture and the appearance of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0072] It needs to be specially pointed out that, in various embodiments of the present application, data related to the song information of the collected object is involved. When the various embodiments of the present application are applied to specific products or technologies, the permission or consent of the object needs to be obtained, and the collection, use and processing of the related data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0073] Please refer to Figure 2 A flowchart of a model training method disclosed in the embodiments of the present application is shown. The model training method mainly introduces the training process of the target song recommendation model. The model training method can be executed by a computer device, which can be the server 101 in the model training system described above. As shown in Figure 2 The model training method can include but is not limited to the following steps S201-S204:

[0074] S201: Obtain an initial song sequence of a target user. The initial song sequence is generated according to the song information of a plurality of songs involved in the song listening behavior of the target user. Each song in the plurality of songs corresponds to a song tag, which is a positive example tag or a negative example tag. The song tag is determined according to the playing feature corresponding to the song.

[0075] In a possible implementation process, the process of obtaining the initial song sequence of the target user can include: first, obtaining a plurality of songs involved in the song listening behavior of the target user, i.e., the historical song listening songs of the target user, which can be obtained from a database (including local storage and online storage), and obtaining song information of the plurality of songs at the same time. The song information can include song name, song singer, song style, song language, song time information, and song playing characteristics. Then, using natural language processing technology, the song information of the plurality of songs and the user information of the target user are processed by feature extraction to obtain the initial song sequence of the target user. There are many feature extraction methods, including principal component analysis method, model extraction method, etc. As known from the above, each song corresponds to a song tag, and the determination process of the song tag corresponding to each song can include: obtaining the playing characteristics of the song included in the song information, determining the song tag of the song that meets the preset playing characteristics as a positive example tag, and determining the song tag of the song that does not meet the preset playing characteristics as a negative example tag. In this application, meeting the preset condition can include: the playing characteristics are one or more of complete playing or playing time reaching a time threshold. Not meeting the preset condition includes that the playing time does not reach the time threshold, and the specific performance of the user is to switch to the next song without listening to the song.

[0076] Before model training, relevant training data need to be obtained first. In the embodiment of the present application, the initial song sequence of the target user is the training data. The target user is only exemplary. In the actual training process, the initial song sequence of N users can be obtained, and N is a large number.

[0077] S202: Determine the song attribute of each song with the song tag as a positive example tag, and perform mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence. The song attribute is a key song attribute or a non-key song attribute.

[0078] In order to train a target song recommendation model with higher recommendation hit rate, after determining all songs with the song tag as a positive example tag and all songs with the song tag as a negative example tag, the songs with the song tag as a positive example tag are further distinguished to solve the "interest collapse" problem. In the embodiment of the present application, the song attribute of the song with the song tag as a positive example tag can adopt the following two schemes:

[0079] In the first scheme, the operation behavior of a user for a target song is obtained, and the target song is any one of the songs with positive example labels in the multiple songs. It can be understood that this step is performed for each song with a positive example label. If the operation behavior of the user for the target song has a target behavior, the song attribute of the target song is determined to be a key song attribute; the target behavior includes one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior; if the operation behavior of the user for the target song does not have a target behavior, the song attribute of the target song is determined to be a non-key song attribute. The key song attribute means that the user is more interested in the song corresponding to the attribute, and the non-key song attribute means that the song corresponding to the attribute may be a song that the user is not interested in.

[0080] In the second scheme, the song features of a first song and a second song are determined (for example, in the form of a vector), the first song is any one of the songs in a song set, the second song is any one of the songs in the song set except the first song, and the song set is composed of the songs with positive example labels in the multiple songs. According to the song features of the first song and the second song, the song similarity between the first song and the second song is determined. According to the song similarity, the proportion of the songs in the song set that have a song similarity with the first song greater than or equal to a similarity threshold is determined. If the proportion is greater than or equal to a proportion threshold, the song attribute of the first song is determined to be a key song attribute; if the proportion is less than the proportion threshold, the song attribute of the first song is determined to be a non-key song attribute. This process can be implemented by using a self-attention mechanism. The essence is to compare the similarities between the songs, and by this method, a more accurate division can be obtained.

[0081] Or, the first scheme and the second scheme are combined to determine the song attributes of all songs with positive example tags. For example, an intermediate branch can be determined based on the first scheme, and then the song attributes of each song are determined based on the second scheme. Specifically, the operation behavior of the user for the target song can be obtained first, the target song being any one of the songs with positive example tags in the plurality of songs; if the operation behavior of the user for the target song has a target behavior, the song attribute of the target song is determined to be a reference key song attribute; the target behavior includes one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior; if the operation behavior of the user for the target song does not have a target behavior, the song attribute of the target song is determined to be a non-key song attribute. Then, the second scheme is executed on the songs with the reference key song attribute to determine the song features of the third song and the fourth song (such as vector expression form), the third song being any one of the songs in the second song set, the fourth song being any one of the songs in the second song set except the third song, the second song set being composed of the songs with positive example tags and the reference key attribute in the plurality of songs; the song similarity between the third song and the fourth song is determined according to the song features of the third song and the fourth song; the proportion of the songs in the song set with a song similarity to the third song greater than or equal to a similarity threshold is determined according to the song similarity; if the proportion is greater than or equal to a proportion threshold, the song attribute of the third song is determined to be a key song attribute; if the proportion is less than the proportion threshold, the song attribute of the third song is determined to be a non-key song attribute.

[0082] Or, the song attributes of all songs with positive example tags can be determined using the first scheme, and then verified using the second scheme; or, the song attributes of all songs with positive example tags can be determined using the second scheme, and then verified using the first scheme. The two schemes are combined in any manner to process all songs with positive example tags to determine the attribute information of the songs.

[0083] Here, the user also includes the target user, and the determination of the key song attribute and the non-key song attribute of any user can adopt the above method.

[0084] Further, after determining the song attributes of all songs with positive example labels, the initial song sequence is masked according to the song attributes to obtain a comparison song sequence, which can include: first determining a first to-be-processed song from the songs with the key song attributes, the first to-be-processed song being part or all of the songs with the key song attributes, which can be selected according to a certain rule or randomly; masking the sequence elements corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence; determining a second to-be-processed song from the songs with the non-key song attributes, the second to-be-processed song being part or all of the songs with the non-key song attributes, which can also be selected according to a certain rule or randomly; and masking the sequence elements corresponding to the second to-be-processed song in the initial song sequence to obtain a second song sequence. The first song sequence and the second song sequence are determined as the comparison song sequence, that is, the comparison song sequence includes two song sequences, one being the first song sequence and the other being the second song sequence.

[0085] Alternatively, masking the initial song sequence according to the song attributes to obtain the comparison song sequence can also include: first determining a key song from the songs with the key song attributes, performing first random masking on the sequence elements corresponding to the key song in the initial song sequence to obtain a first song sequence; determining a non-key song from the songs with the non-key song attributes, performing second random masking on the sequence elements corresponding to the non-key song in the initial song sequence to obtain a second song sequence. The first song sequence and the second song sequence are determined as the comparison song sequence. The key song refers to all songs with positive example labels and key song attributes, and the non-key song refers to all songs with positive example labels and non-key song attributes. The first random masking and the second random masking can be the same or different. Random masking refers to partially or completely masking the sequence elements corresponding to the key song and the non-key song. The random masking can be set according to different situations, which is not limited in the present application.

[0086] The construction of the comparison song sequence is an important aspect of the embodiments of the present application, which can be illustrated by an example, please refer to Figure 3 is a schematic diagram for constructing a comparison song sequence provided by the embodiments of the present application. The initial song sequence is identified to obtain a key song sequence and a non-key song sequence. Then, the comparison song sequence is constructed, the initial song sequence is masked based on the key song sequence to obtain a first song sequence, and the initial song sequence is masked based on the non-key song sequence to obtain a second song sequence. In the embodiments of the present application, the key song sequence and the non-key song sequence are determined by identifying the key song attributes and the non-key song attributes in the initial song sequence. Figure 3The initial song sequence in the step S201 is processed, that is, the song sequence with the positive example label.

[0087] S203: inputting the initial song sequence into the initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence.

[0088] The step S203 mainly describes the processing of the model on the data, which can be combined with Figure 4 The step S203 is described, Figure 4 is a framework diagram of a model provided by an embodiment of the present application, which can include an embedding layer, a feature fusion layer, and a multi-task processing layer. The initial song sequence can be first input into the embedding layer of the initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, such as Figure 4 401 in the step S202 represents the initial song sequence of the model, including basic information of a user (such as an identifier, an avatar, a gender, a city, and the like), a song identifier, a song feature, and a user feature; according to the step S202, the comparison song sequence includes the first song sequence and the second song sequence, so that the comparison song sequence is input into the embedding layer of the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence, which can specifically include: inputting the first song sequence into the initial song recommendation model for processing to obtain a first comparison feature sequence; inputting the second song sequence into the initial song recommendation model for processing to obtain a second comparison feature sequence; and determining the first comparison feature sequence and the second comparison feature sequence as the comparison feature sequence, that is, the comparison feature sequence includes the first comparison feature sequence and the second comparison feature sequence. As shown in 402 in the step S202, the processing process of the first comparison feature sequence and the second comparison feature sequence is an intermediate step, which is to strengthen the input of the positive example song sequence. Figure 4

[0089] It should be noted that, Figure 4 The model structure shown in the figure is only exemplary, and a simple DNN network can also be directly used.

[0090] S204: determining a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjusting a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

[0091] The first difference parameter refers to Figure 4 ​The loss of the part shown as 402 in the middle is shown. The first difference parameter is determined according to the reference feature sequence and the contrast feature sequence, which mainly can include: determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence, determining a second similarity parameter between the reference feature sequence and the second contrast feature sequence, and determining the first difference parameter according to the first similarity parameter and the second similarity parameter.

[0092] Further, since the embodiment of the present application trains a general model, a large amount of data of other users is required to determine the target song recommendation model corresponding to the target user, and various user data is trained to train a general target song recommendation model applicable to all people. The target user is any one of the user set, the user set includes multiple users, and for the reference user, the initial song sequence of the reference user is obtained, the initial song sequence of the reference user is input into the initial song recommendation model for processing to obtain the feature sequence of the initial song sequence of the reference user; the reference user is any one user in the user set except the target user. Then determine the third similarity parameter between the reference feature sequence and the feature sequence of the initial song sequence of the reference user. Finally, the first difference parameter is determined according to the first similarity parameter, the second similarity parameter and the third similarity parameter corresponding to each reference user.

[0093] The calculation formula of the first difference parameter L1 can be seen from the following formula (1):

[0094]

[0095] The loss of one training calculated by formula (1), wherein s() represents a function, for example, it can be an inner product function, that is, the inner product operation of two data, the closer the two vectors are, the greater the inner product value is. Refers to the user representation of the i-th user (i.e., the feature sequence of the initial song sequence of the i-th user, if the i-th user is the target user, then That is, the reference feature sequence, Refers to the first contrast feature sequence of the i-th user, Refers to the second contrast feature sequence of the i-th user. Refers to the user representation of the j-th user (i.e., the feature sequence of the initial song sequence of the j-th user). The purpose of this formula is to make the user representation of the user i close to the first contrast feature sequence (positive example) vector, and far away from the second contrast feature sequence (negative example). In this way, the interest point of the user is more accurate.

[0096] In the actual training process, in addition to the auxiliary loss of the first difference parameter described above, there is also a loss of the main output of the model, that is, the loss calculated according to the prediction result of each song and the label data (either positive label or negative label) of each song. In the embodiments of the present application, the second difference parameter is used to describe the loss, and the second difference parameter can adopt a cross-entropy loss function. As described above, the processing result of the initial song recommendation model on the initial song sequence also includes a prediction result set of the initial song sequence, and the prediction result set includes a prediction result of each song in the plurality of songs. The prediction result can be a probability value. Therefore, in combination with the first difference parameter, the specific training process of the model can include: determining the second difference parameter according to the prediction result of each song in the plurality of songs and the song label; determining the target difference parameter according to the first difference parameter and the second difference parameter; and adjusting the model parameters of the initial song recommendation model according to the target difference parameter to obtain a target song recommendation model. That is, the model parameters of the initial song recommendation model are continuously adjusted according to the target difference parameter. When the target difference parameter of the model is less than the difference threshold or the number of iterations reaches a set number of times, the adjustment of the parameters of the model is stopped, and the model obtained by the current adjustment is taken as the target song recommendation model. Through such training, it is hoped that the target song recommendation model can estimate the to-be-recommended songs, and accurately estimate how long the user will listen to and whether the user will play the songs completely or not.

[0097] The calculation formula of the target difference parameter Lall can be seen from the following formula (2):

[0098]

[0099] In formula (2), L1 is the first difference parameter, L2 is the second difference parameter, l2_norm2 represents a feature sequence obtained by performing feature normalization on the prediction data, l2_norm1 represents a feature sequence obtained by performing feature normalization on the output data after the first difference parameter is calculated, and r represents a weight parameter. In the embodiments of the present application, the two difference parameters can be fused by using a meta-balance method. Since multi-task learning is used in the recommendation scene, a serious optimization imbalance problem is usually encountered. On the one hand, one or more auxiliary tasks can have a greater impact than the target task, or even dominate the network weight, resulting in a decrease in the recommendation accuracy of the target task. On the other hand, the impact of one or more auxiliary tasks can be too weak to help the target task. This imbalance changes dynamically throughout the training process and changes at different parts of the same network. The meta-balance method scales the gradient of the auxiliary task according to the gradient of the target task, and at the same time, a part of the gradient of the auxiliary task is retained, thereby alleviating the problem of too large or too small auxiliary task gradient. That is, the value of r is adjusted to make the gradients of different tasks similar.

[0100] In the embodiments of the present application, it is mainly explained how the target song recommendation model is trained. First, the training sample data is processed, that is, the initial song sequence of the target user is obtained. The initial song sequence is generated according to the song information (name, singer, style, language) of multiple songs. The multiple songs are the songs involved in the listening behavior of the target user (historical listening songs). Each song in the multiple songs corresponds to a song label. The song label is a positive example label or a negative example label. The song label is determined according to the corresponding playing feature of the song. The song attribute of each song whose song label is a positive example label is determined, and the initial song sequence is masked according to the song attribute to obtain a comparison song sequence. The song attribute is a key song attribute or a non-key song attribute. Then, the processed training sample is input into the initial song recommendation model to train the model. That is, the initial song sequence is input into the initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence. The comparison song sequence is input into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence. A first difference parameter is determined according to the reference feature sequence and the comparison feature sequence, and the model parameters of the initial song recommendation model are adjusted according to the first difference parameter to obtain a target song recommendation model. The model training using the data processed by the above steps can improve the model training effect, that is, the interest points of the user can be better trained, so that the target song recommendation model obtained can accurately recommend songs that the user is interested in.

[0101] In combination with the training process described above, please refer to Figure 5 , Figure 5 The flowchart of another model training method disclosed in the embodiments of the present application is introduced. The model training method mainly introduces the training process and prediction process of the target song recommendation model. The model training method is executed by the interaction of the server and the terminal device. As shown in Figure 5 , the model training method can include but is not limited to the following steps S201-S204:

[0102] S501: The server obtains the initial song sequence of each user in the user set.

[0103] The initial song sequence of each user in the user set is generated according to the song information of multiple songs. The multiple songs are the songs involved in the listening behavior of each user. Each song in the multiple songs corresponds to a song label. The song label is a positive example label or a negative example label. The song label is determined according to the corresponding playing feature of the song. The specific determination process can be referred to step S201.

[0104] S502: The server divides the initial song sequence of each user in the user set to obtain multiple groups of training data. For example, there are N users, and the initial song sequence of each user corresponds to M songs. Ten songs of one user can be extracted each time to form a group of training data, and 10*N groups of training data are obtained.

[0105] S503: The server trains the initial song recommendation model by using the multiple groups of training data to obtain a target song recommendation model. That is, for each user in each group of data in the multiple groups of training data, the related steps shown in the following are performed. Figure 2 The target difference parameter, i.e., the total loss, is calculated, and the network parameters of the initial song recommendation model are adjusted based on the total loss to obtain the target song recommendation model.

[0106] S504: The server deploys the target song recommendation model in a terminal device. The target song recommendation model can be deployed in any terminal device, or the target song recommendation model can be deployed in a blockchain network, and the target song recommendation model can be obtained from the blockchain network when needed.

[0107] S505: The terminal device obtains song information of a to-be-recommended song and song recommendation indication information of a to-be-recommended user.

[0108] The song information of the to-be-recommended song can be obtained from a song library (the song library includes all published songs, including locally stored songs), or can be pulled from various network platforms during the listening process of the user. In addition, the song information of the to-be-recommended song and the song recommendation indication information of the to-be-recommended user are obtained according to user information of the to-be-recommended user. The user information mainly refers to a user identifier, such as a user ID, a user nickname, a user avatar, and the like. The song recommendation indication information is a vector in a vector pool generated during the training process, and the song recommendation indication information is mainly used to represent the historical listening characteristics of the to-be-recommended user. The to-be-recommended song can indicate one song or a set of songs.

[0109] S506: The terminal device inputs the song recommendation indication information and the song information of the to-be-recommended song into the target song recommendation model for processing to obtain a recommendation score of the to-be-recommended song.

[0110] In a possible implementation, if the to-be-recommended song indicates one song, the terminal device inputs the song recommendation indication information of the to-be-recommended user and the song information of the to-be-recommended song into the target song recommendation model for processing to obtain a recommendation score of the to-be-recommended song.

[0111] In another possible implementation, if the to-be-recommended song indicates a song set, the song information of the songs in the song set and the song recommendation indication information of the to-be-recommended user can be input into the indicated input target song recommendation model for processing to obtain the recommendation scores of the songs in the song set.

[0112] S507: The terminal device performs song recommendation on the to-be-recommended song according to the recommendation score.

[0113] If the recommendation score of the to-be-recommended song reaches the score threshold, the terminal device recommends the to-be-recommended song to the to-be-recommended user.

[0114] According to step S507, when the recommendation scores of the songs in the song set are obtained, the songs with recommendation scores greater than the score threshold are first determined, and then the songs with recommendation scores greater than the score threshold are sorted according to the scores, the sorted songs are added to the to-be-played list, and the to-be-played list is displayed to the to-be-recommended user, so that the to-be-recommended user can select and play the songs in the list.

[0115] Steps S505-S507 can also be performed by the server, which is equivalent to that the terminal device sends a play request to the server, the server obtains the song information of the to-be-recommended song and the song recommendation indication information of the to-be-recommended user, inputs the song recommendation indication information and the song information of the to-be-recommended song into the target song recommendation model for processing to obtain the recommendation score of the to-be-recommended song, performs song recommendation on the to-be-recommended song according to the recommendation score, and returns the recommendation result to the terminal device for display.

[0116] Based on the above target song recommendation model, the developer performs online testing, and based on the target song recommendation model, the listening time of the user to the recommended song increases by 3.01% during the listening process of the user, and the collection behavior of the user to the recommended song increases by 5.21%. Therefore, the method provided in the embodiment of the application can more accurately recommend songs to users.

[0117] The embodiment of the application mainly describes the whole process of the model training method, including the training process and the prediction process. In the training process, the sample data is accurately divided to improve the model training effect. In the prediction process, through experiments, it is determined that the target song recommendation model provided in the application can more accurately recommend songs to users.

[0118] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of a model training device provided in the embodiment of the application. The model training device 600 can be arranged in the computer device provided in the embodiment of the application, and the computer device can be the server 101 mentioned in the method embodiment.Figure 6 The model training apparatus 600 shown can be a computer program (including program code) running in a computer device, which can be used to execute Figure 2 or Figure 5 part or all of the steps in the method embodiments shown. Please refer to Figure 6 The model training apparatus 600 can include the following units:

[0119] The acquisition unit 601 is configured to acquire an initial song sequence of a target user, the initial song sequence being generated according to song information of a plurality of songs involved in a song listening behavior of the target user, each song in the plurality of songs corresponding to a song tag, the song tag being a positive example tag or a negative example tag, the song tag being determined according to a playback feature corresponding to the song;

[0120] The determination unit 602 is configured to determine a song attribute of each song whose song tag is the positive example tag, and perform mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, the song attribute being a key song attribute or a non-key song attribute;

[0121] The processing unit 603 is configured to input the initial song sequence into an initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, input the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence, determine a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjust a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

[0122] In a possible implementation manner, when the determination unit 602 determines the song attribute of each song whose song tag is the positive example tag, the determination unit 602 is specifically configured to perform the following steps:

[0123] Acquire an operation behavior of the target user for a target song, the target song being any one of the songs in the plurality of songs whose song tag is the positive example tag;

[0124] If the target user's operation behavior for the target song exists a target behavior, determine that the song attribute of the target song is the key song attribute; the target behavior includes one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior;

[0125] If the target user's operation behavior for the target song does not exist the target behavior, determine that the song attribute of the target song is the non-key song attribute.

[0126] In a possible implementation, the determining unit 602 is configured to determine the song attribute of each song with the song label as the positive example label, and specifically configured to perform the following steps:

[0127] determine a song feature of a first song and a song feature of a second song, the first song being any song in a song set, the second song being any song in the song set except the first song, the song set being composed of songs in the plurality of songs with the song label as the positive example label;

[0128] determine a song similarity between the first song and the second song according to the song feature of the first song and the song feature of the second song;

[0129] determine a proportion of songs in the song set with a song similarity greater than or equal to a similarity threshold to the first song according to the song similarity;

[0130] if the proportion is greater than or equal to a proportion threshold, determine the song attribute of the first song as the key song attribute;

[0131] if the proportion is less than the proportion threshold, determine the song attribute of the first song as the non-key song attribute.

[0132] In a possible implementation, the processing unit 603 is configured to perform mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, and specifically configured to perform the following steps:

[0133] determine a first to-be-processed song from the songs with the key song attribute, perform mask processing on a sequence element corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;

[0134] determine a second to-be-processed song from the songs with the non-key song attribute, perform mask processing on a sequence element corresponding to the second to-be-processed song in the initial song sequence to obtain a second song sequence;

[0135] determine the first song sequence and the second song sequence as the comparison song sequence;

[0136] wherein the processing of the comparison song sequence in the initial song recommendation model to obtain a comparison feature sequence of the comparison song sequence includes:

[0137] processing the first song sequence in the initial song recommendation model to obtain a first comparison feature sequence;

[0138] input the second song sequence into the initial song recommendation model for processing to obtain a second contrast feature sequence;

[0139] determine the first contrast feature sequence and the second contrast feature sequence as a contrast feature sequence.

[0140] In a possible implementation, the determining unit 602 is configured to determine a first difference parameter according to the reference feature sequence and the contrast feature sequence, and specifically configured to perform the following steps:

[0141] determine a first similarity parameter between the reference feature sequence and the first contrast feature sequence,

[0142] determine a second similarity parameter between the reference feature sequence and the second contrast feature sequence,

[0143] determine a first difference parameter according to the first similarity parameter and the second similarity parameter.

[0144] In a possible implementation, the determining unit 602 is configured to determine a first difference parameter according to the reference feature sequence and the contrast feature sequence, and specifically configured to perform the following steps:

[0145] obtain an initial song sequence of a reference user, input the initial song sequence of the reference user into an initial song recommendation model for processing to obtain a feature sequence of the initial song sequence of the reference user; the reference user is any one user in a user set in which the target user is located except the target user;

[0146] determine a third similarity parameter between the reference feature sequence and the feature sequence of the initial song sequence of the reference user;

[0147] determine a first difference parameter according to the first similarity parameter, the second similarity parameter, and the third similarity parameter corresponding to each reference user.

[0148] In a possible implementation, the processing result of the initial song recommendation model on the initial song sequence further includes a prediction result set of the initial song sequence, the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate a recommendation degree of the each song;

[0149] The determining unit 602 is further configured to determine a second difference parameter according to the prediction result of each song in the plurality of songs and the song label.

[0150] The processing unit 603 adjusts the model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model, and specifically is configured to perform the following steps:

[0151] determining a target difference parameter according to the first difference parameter and the second difference parameter;

[0152] adjusting the model parameters of the initial song recommendation model according to the target difference parameter to obtain a target song recommendation model.

[0153] In a possible implementation, the obtaining unit 601 obtains song information of a song to be recommended and song recommendation indication information of a user to be recommended.

[0154] The processing unit 603 is configured to input the song recommendation indication information and the song information of the song to be recommended into the target song recommendation model for processing to obtain a recommendation score of the song to be recommended, and perform song recommendation on the song to be recommended according to the recommendation score.

[0155] It can be understood that the functions of each functional unit of the model training apparatus provided by the embodiments of the present application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can refer to the related description in the above method embodiments, which will not be described here.

[0156] In a possible implementation, the model training apparatus provided by the embodiments of the present application can be implemented in a software manner, and the model training apparatus can be stored in a memory, which can be software in the form of programs and plug-ins, and include a series of units, including an obtaining unit, a processing unit and a determining unit; wherein the obtaining unit, the determining unit and the processing unit are configured to implement the model training method provided by the embodiments of the present application.

[0157] In other possible embodiments, the model training apparatus provided by the embodiments of the present application can also be implemented in a combination of software and hardware. For example, the model training apparatus provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to perform the model training method provided by the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can use one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic elements.

[0158] In the embodiments of the present application, the acquisition unit 601 acquires an initial song sequence of a target user, the initial song sequence is generated according to song information (title, singer, style, language) of a plurality of songs, the plurality of songs are songs (historical listening songs) involved in a song listening behavior of the target user, each song in the plurality of songs corresponds to a song label, the song label is a positive example label or a negative example label, and the song label is determined according to a corresponding playing feature of the song; the determination unit 602 determines a song attribute of each song with the song label as the positive example label, and performs mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, the song attribute is a key song attribute or a non-key song attribute; the songs with the song label as the positive example label are divided according to attributes to obtain the comparison song sequence, and the comparison song sequence formed by introducing the attribute information can more accurately divide the initial song sequence of the user and can more accurately determine the interest point of the user. The processing unit 603 inputs the initial song sequence into an initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, inputs the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence, determines a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjusts a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model. The model training performed on the data processed by the above steps can improve the model training effect, that is, the interest point of the user can be more accurately trained, so that the target song recommendation model obtained can accurately recommend songs of interest to the user.

[0159] Based on the above method and apparatus embodiments, the embodiments of the present application provide a computer device, which can be the aforementioned server 101. Please refer to Figure 7 , Figure 7A structural schematic diagram of a computer device is provided in the embodiments of the present application. The computer device described in the embodiments of the present application comprises a processor 701, a communication interface 702 and a memory 703. The processor 701, the communication interface 702 and the memory 703 can be connected through a bus or other means. The embodiments of the present application take the connection through the bus as an example. The computer device can be Figure 1 Any one of the first terminal device 101, the second terminal device 103 and the server 102 in the color management system of the application interface shown.

[0160] The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. It can analyze various instructions in the computer device and process various data of the computer device. For example, the CPU can be used to analyze the power-on / off instruction sent by the user to the computer device and control the computer device to perform the power-on / off operation. For another example, the CPU can transmit various interactive data between the internal structures of the computer device, and the like. The communication interface 702 can optionally include a standard wired interface, a wireless interface (such as Wi-Fi, a mobile communication interface, etc.), and is controlled by the processor 701 to receive and send data. The memory 703 is a memory device in the computer device, used to store programs and data. It can be understood that the memory 703 here can include the built-in memory of the computer device, and of course can also include the expansion memory supported by the computer device. The memory 703 provides a storage space which stores the operating system of the computer device, and can include but is not limited to: an Android system, an iOS system, a Windows Phone system, etc. The present application does not make any limitation in this regard.

[0161] In the embodiments of the present application, the processor 701 executes the following operations by running the executable program code in the memory 703:

[0162] obtaining an initial song sequence of a target user, the initial song sequence being generated according to song information of a plurality of songs involved in a song listening behavior of the target user, each song in the plurality of songs corresponding to a song tag, the song tag being a positive example tag or a negative example tag, the song tag being determined according to a playing feature corresponding to the song;

[0163] determining a song attribute of each song whose song tag is the positive example tag, and performing mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, the song attribute being a key song attribute or a non-key song attribute;

[0164] inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference feature sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence;

[0165] determining a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjusting model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

[0166] In a possible implementation, when the processor 701 is configured to determine the song attribute of each song with the song label as the positive example label, the processor 701 is specifically configured to perform the following steps:

[0167] obtaining an operation behavior of a target user for a target song, the target song being any one of the songs with the song label as the positive example label;

[0168] if the target user has a target behavior for the target song, determining that the song attribute of the target song is the key song attribute, the target behavior including one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior;

[0169] if the target user does not have the target behavior for the target song, determining that the song attribute of the target song is the non-key song attribute.

[0170] In a possible implementation, when the processor 701 is configured to determine the song attribute of each song with the song label as the positive example label, the processor 701 is specifically configured to perform the following steps:

[0171] determining a song feature of a first song and a song feature of a second song, the first song being any one of the songs in a song set, the second song being any one of the songs in the song set except the first song, the song set being composed of the songs with the song label as the positive example label in the plurality of songs;

[0172] determining a song similarity between the first song and the second song according to the song feature of the first song and the song feature of the second song;

[0173] determining a proportion of the songs in the song set that have a song similarity greater than or equal to a similarity threshold with the first song according to the song similarity;

[0174] if the proportion is greater than or equal to a proportion threshold, determining that the song attribute of the first song is the key song attribute;

[0175] If the proportion is less than the proportion threshold, a song attribute of the first song is determined as the non-key song attribute.

[0176] In a possible implementation, the processor 701 is configured to perform mask processing on the initial song sequence according to the song attribute to obtain a contrast song sequence, and specifically configured to perform the following steps:

[0177] determining a first to-be-processed song from the songs with the key song attribute, and performing mask processing on a sequence element corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;

[0178] determining a second to-be-processed song from the songs with the non-key song attribute, and performing mask processing on a sequence element corresponding to the second to-be-processed song in the initial song sequence to obtain a second song sequence;

[0179] determining the first song sequence and the second song sequence as the contrast song sequence;

[0180] The processing of inputting the contrast song sequence into the initial song recommendation model to obtain a contrast feature sequence of the contrast song sequence includes the following steps.

[0181] inputting the first song sequence into the initial song recommendation model to obtain a first contrast feature sequence;

[0182] inputting the second song sequence into the initial song recommendation model to obtain a second contrast feature sequence;

[0183] determining the first contrast feature sequence and the second contrast feature sequence as the contrast feature sequence.

[0184] In a possible implementation, the processor 701 is configured to determine a first difference parameter according to the reference feature sequence and the contrast feature sequence, and specifically configured to perform the following steps:

[0185] determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,

[0186] determining a second similarity parameter between the reference feature sequence and the second contrast feature sequence,

[0187] determining a first difference parameter according to the first similarity parameter and the second similarity parameter.

[0188] In a possible implementation, when the processor 701 is configured to determine the first difference parameter according to the reference feature sequence and the comparison feature sequence, the processor 701 is specifically configured to perform the following steps:

[0189] obtain an initial song sequence of a reference user, input the initial song sequence of the reference user into an initial song recommendation model for processing, and obtain a feature sequence of the initial song sequence of the reference user; the reference user is any one user in a user set in which the target user is located, except the target user;

[0190] determine a third similarity parameter between the reference feature sequence and the feature sequence of the initial song sequence of the reference user;

[0191] determine a first difference parameter according to the first similarity parameter, the second similarity parameter, and the third similarity parameter corresponding to each reference user.

[0192] In a possible implementation, the processing result of the initial song recommendation model on the initial song sequence further includes a prediction result set of the initial song sequence, the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate a recommendation degree of the each song; the processor 701 is further configured to:

[0193] determine a second difference parameter according to the prediction result of each song in the plurality of songs and the song label;

[0194] When the processor 701 adjusts the model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model, the processor 701 is specifically configured to perform the following steps:

[0195] determine a target difference parameter according to the first difference parameter and the second difference parameter;

[0196] adjust the model parameter of the initial song recommendation model according to the target difference parameter to obtain the target song recommendation model.

[0197] In a possible implementation, the processor 701 is further configured to:

[0198] obtain song information of a to-be-recommended song and song recommendation indication information of a to-be-recommended user;

[0199] input the song recommendation indication information and the song information of the to-be-recommended song into the target song recommendation model for processing, and obtain a recommendation score of the to-be-recommended song; and perform song recommendation on the to-be-recommended song according to the recommendation score.

[0200] According to an aspect of the present application, the embodiments of the present application further provide a computer program product, which comprises a computer program stored in a computer readable storage medium. The processor 701 reads the computer program from the computer readable storage medium, and the processor 701 executes the computer program, so that the computer device executes the above-mentioned method embodiments. Figure 2 and Figure 5 the related method.

[0201] It should be noted that, for the above-mentioned method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0202] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented by other means. For example, the apparatus embodiments described above are only schematic, and for example, the division of the above-mentioned modules is only a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0203] The above describes only the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A model training method, characterized in that, The method comprises: obtaining an initial song sequence of a target user, the initial song sequence being generated according to song information of a plurality of songs involved in a song listening behavior of the target user, each of the plurality of songs corresponding to a song label, the song label being a positive example label or a negative example label, the song label being determined according to a playing feature corresponding to the song; determining a song attribute of each song with the song label being the positive example label, the song attribute being determined based on an operation behavior of the target user on the song with the song label being the positive example label or a similarity of the song with the song label being the positive example label, and the song attribute being a key song attribute or a non-key song attribute; performing mask processing on the initial song sequence according to the song attribute to obtain a comparison song sequence, wherein different mask processing is performed on a song with the key song attribute and a song with the non-key song attribute; inputting the initial song sequence into an initial song recommendation model to obtain a reference feature sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model to obtain a comparison feature sequence of the comparison song sequence; determining a first difference parameter according to the reference feature sequence and the comparison feature sequence, and adjusting a model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.

2. The method of claim 1, wherein, The method comprises: obtaining an operation behavior of a target user on a target song, the target song being any one of the plurality of songs with the song label being the positive example label; if the target behavior exists in the operation behavior of the target user on the target song, determining that the song attribute of the target song is the key song attribute; the target behavior comprises one or more of a download behavior, a collection behavior, a sharing behavior, and a comment behavior; if the target behavior does not exist in the operation behavior of the target user on the target song, determining that the song attribute of the target song is the non-key song attribute.

3. The method of claim 1, wherein, The method comprises: determining a song feature of a first song and a song feature of a second song, the first song being any one of a song set, the second song being any one of the song set except the first song, the song set being composed of songs with the song label being the positive example label in the plurality of songs; determining a song similarity of the first song and the second song according to the song feature of the first song and the song feature of the second song; determining a proportion of songs with a song similarity greater than or equal to a similarity threshold in the song set according to the song similarity of the first song; if the proportion is greater than or equal to a proportion threshold, determining that the song attribute of the first song is the key song attribute; if the proportion is less than the proportion threshold, determining that the song attribute of the first song is the non-key song attribute.

4. The method according to any one of claims 1 to 3, characterized in that, The initial song sequence is masked according to the song attribute to obtain a contrast song sequence, including: A first to-be-processed song is determined from the song whose attribute is the key song attribute, and a sequence element corresponding to the first to-be-processed song in the initial song sequence is masked to obtain a first song sequence; a second to-be-processed song is determined from the song whose attribute is the non-key song attribute, and a sequence element corresponding to the second to-be-processed song in the initial song sequence is masked to obtain a second song sequence; The first song sequence and the second song sequence are determined as the contrast song sequence; The initial song recommendation model is inputted with the contrast song sequence to obtain a contrast feature sequence of the contrast song sequence, including: The initial song recommendation model is inputted with the first song sequence to obtain a first contrast feature sequence; the initial song recommendation model is inputted with the second song sequence to obtain a second contrast feature sequence; The first contrast feature sequence and the second contrast feature sequence are determined as the contrast feature sequence.

5. The method of claim 4, wherein, The reference feature sequence and the contrast feature sequence are used to determine a first difference parameter, including: A first similarity parameter between the reference feature sequence and the first contrast feature sequence is determined, A second similarity parameter between the reference feature sequence and the second contrast feature sequence is determined, The first similarity parameter and the second similarity parameter are used to determine the first difference parameter.

6. The method of claim 5, wherein, The reference feature sequence and the contrast feature sequence are used to determine a first difference parameter, including: An initial song sequence of a reference user is obtained, and the initial song sequence of the reference user is inputted into the initial song recommendation model to obtain a feature sequence of the initial song sequence of the reference user; the reference user is any one user in a user set in which the target user is located except the target user; A third similarity parameter between the reference feature sequence and the feature sequence of the initial song sequence of the reference user is determined; The first similarity parameter, the second similarity parameter, and the third similarity parameter corresponding to each reference user are used to determine the first difference parameter.

7. The method of claim 1, wherein, The processing result of the initial song recommendation model on the initial song sequence further includes a prediction result set of the initial song sequence, the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate a recommendation degree of the each song; The method further includes: A second difference parameter is determined according to the prediction result of each song in the plurality of songs and the song label; The model parameter of the initial song recommendation model is adjusted according to the first difference parameter to obtain a target song recommendation model, including: A target difference parameter is determined according to the first difference parameter and the second difference parameter; The model parameter of the initial song recommendation model is adjusted according to the target difference parameter to obtain a target song recommendation model.

8. The method of claim 1, wherein, The method further includes: Obtaining song information of a to-be-recommended song and song recommendation indication information of a to-be-recommended user; Inputting the song recommendation indication information and the song information of the to-be-recommended song into the target song recommendation model for processing to obtain a recommendation score of the to-be-recommended song; Performing song recommendation on the to-be-recommended song according to the recommendation score.

9. A computer device, comprising: The computer device comprises: a processor adapted to implement one or more computer programs; and a computer storage medium storing one or more computer programs, the one or more computer programs being adapted to be loaded and executed by the processor to implement the model training method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores one or more computer programs, and the one or more computer programs are adapted to be loaded and executed by the processor to implement the model training method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Song recommending method and device and storage medium

    CN108197327A

  • Music characterization method, music task processing method, server and storage medium

    CN114420157A