[go: up one dir, main page]

CN116401400B - Model training methods and related equipment - Google Patents

Model training methods and related equipment

Info

Publication number
CN116401400B
CN116401400B CN202310442515.6A CN202310442515A CN116401400B CN 116401400 B CN116401400 B CN 116401400B CN 202310442515 A CN202310442515 A CN 202310442515A CN 116401400 B CN116401400 B CN 116401400B
Authority
CN
China
Prior art keywords
song
sequence
initial
determining
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310442515.6A
Other languages
Chinese (zh)
Other versions
CN116401400A (en
Inventor
黄昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Music Entertainment Technology Shenzhen Co Ltd
Original Assignee
Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Music Entertainment Technology Shenzhen Co Ltd filed Critical Tencent Music Entertainment Technology Shenzhen Co Ltd
Priority to CN202310442515.6A priority Critical patent/CN116401400B/en
Publication of CN116401400A publication Critical patent/CN116401400A/en
Application granted granted Critical
Publication of CN116401400B publication Critical patent/CN116401400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • G06F16/635Filtering based on additional data, e.g. user or group profiles
    • G06F16/637Administration of user profiles, e.g. generation, initialization, adaptation or distribution
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/686Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, title or artist information, time, location or usage information, user ratings
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种模型训练方法以及相关设备,方法包括:获取根据目标用户的多首歌曲的歌曲信息生成的初始歌曲序列,每首歌曲对应一个歌曲标签,歌曲标签为正例标签或者负例标签;根据歌曲标签为正例标签的每首歌曲的歌曲属性对初始歌曲序列进行掩码处理,得到对比歌曲序列;将初始歌曲序列和对比歌曲序列分别输入初始歌曲推荐模型中进行处理,得到初始歌曲序列的参考特征序列以及对比歌曲序列的对比特征序列;根据参考特征序列和对比特征序列确定第一差异参数,根据第一差异参数对初始歌曲推荐模型的模型参数进行调整,得到目标歌曲推荐模型。通过该方法,可以提升模型训练效果,使得到的目标歌曲推荐模型可以精准地推荐用户感兴趣的歌曲。

This application discloses a model training method and related equipment. The method includes: obtaining an initial song sequence generated based on song information from multiple songs of a target user, where each song corresponds to a song tag, which can be a positive or negative example tag; masking the initial song sequence according to the song attributes of each song with a positive example tag to obtain a comparison song sequence; inputting the initial song sequence and the comparison song sequence into an initial song recommendation model 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 based on the reference feature sequence and the comparison feature sequence; and adjusting the model parameters of the initial song recommendation model based on the first difference parameter to obtain a target song recommendation model. This method can improve the model training effect, enabling the obtained target song recommendation model to accurately recommend songs that the user is interested in.

Description

Model training method and related equipment
Technical Field
The present application relates to the field of computer technology, and in particular, to a model training method, a computer device, and a computer readable storage medium.
Background
The music recommendation system can conduct song recommendation according to the song listening interest points of the user, wherein the song listening interest points are determined according to historical song listening data of the user. However, when the user's listening to songs is particularly rich, and the historical number of listening to songs reaches a certain value (such as 2000), the problem of interest collapse is easy to generate. The "interest collapse" means that after the user's behavior is too rich, the recommendation system is difficult to accurately identify the core interest points of the user, and the core interest points are submerged by other accidental interest points.
Therefore, how to solve the problem of "interest collapse" and more accurately recommend songs to users is a technical problem to be solved.
Disclosure of Invention
The embodiment of the application provides a model training method and related equipment, which can improve the model training effect, so that the obtained target song recommendation model can accurately recommend songs interested by users.
In one aspect, the embodiment of the application discloses a model training method, which comprises the following steps:
Acquiring an initial song sequence of a target user, wherein the initial song sequence is generated according to song information of a plurality of songs related to 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 playing characteristics corresponding to the song;
determining the song label as the song attribute of each song of the positive example label, and masking 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;
Inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence;
And determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting the model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.
Correspondingly, the embodiment of the application discloses a model training device, which comprises:
The system comprises an acquisition unit, a selection unit and a display unit, wherein the acquisition unit is used for acquiring an initial song sequence of a target user, the initial song sequence is generated according to song information of a plurality of songs related to the song listening behavior of the target user, the plurality of songs are songs related to 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 playing characteristics corresponding to the song;
The determining unit is used for determining the song label as the song attribute of each song of the positive example label, masking 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;
The processing unit is used for inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence;
And the determining unit is also used for determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting the model parameter of the initial song recommendation model according to the first difference parameter so as to obtain a target song recommendation model.
In one possible implementation manner, the determining unit is configured to, when determining that the song label is a song attribute of each song of the positive example label, specifically perform the following steps:
Acquiring the operation behavior of a user aiming at a target song, wherein the target song is any song of which the song label is the positive label in the plurality of songs;
If the target behavior exists for the operation behavior of the target song, determining that the song attribute of the target song is the key song attribute, wherein the target behavior comprises one or more of downloading behavior, collecting behavior, sharing behavior and comment behavior;
and if the target behavior does not exist in the operation behavior of the user aiming at the target song, determining that the song attribute of the target song is the non-key song attribute.
In one possible implementation manner, the determining unit is configured to, when determining that the song label is a song attribute of each song of the positive example label, specifically perform the following steps:
Determining song characteristics of a first song and song characteristics of a second song, wherein the first song is any song in a song set, the second song is any song except the first song in the song set, and the song set is composed of songs, of which the song labels are the positive labels, in the plurality of songs;
determining song similarity of the first song and the second song according to the song characteristics of the first song and the song characteristics of the second song;
determining the duty ratio of songs, in the song collection, with which the song similarity to the first song is greater than or equal to a similarity threshold value according to the song similarity;
if the duty ratio is greater than or equal to a duty ratio threshold value, determining that the song attribute of the first song is the key song attribute;
And if the duty ratio is smaller than the duty ratio threshold value, determining that the song attribute of the first song is the non-key song attribute.
In a possible implementation manner, the processing unit is configured to mask the initial song sequence according to the song attribute, and when obtaining a comparison song sequence, specifically is configured to perform the following steps:
Determining a first to-be-processed song from songs with the song attribute being the key song attribute, and masking sequence elements corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;
Determining a second song to be processed from songs with the song attribute being the non-key song attribute, and masking sequence elements corresponding to the second song to be processed in the initial song sequence to obtain a second song sequence;
determining the first song sequence and the second song sequence as comparison song sequences;
The step of inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence comprises the following steps:
inputting the first song sequence into the initial song recommendation model for processing to obtain a first comparison characteristic sequence;
Inputting the second song sequence into the initial song recommendation model for processing to obtain a second comparison characteristic sequence;
And determining the first contrast characteristic sequence and the second contrast characteristic sequence as contrast characteristic sequences.
In a possible implementation manner, the determining unit is configured to determine the first difference parameter according to the reference feature sequence and the comparison feature sequence, and specifically is configured to perform the following steps:
determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,
Determining a second similar parameter between the reference feature sequence and the second contrast feature sequence,
And determining a first difference parameter according to the first similar parameter and the second similar parameter.
In a possible implementation manner, the target user is included in a user set, where the user set includes a plurality of users, and the determining unit is configured to, when determining the first difference parameter according to the reference feature sequence and the contrast feature sequence, specifically perform the following steps:
Acquiring an initial song sequence of a reference user, and inputting the initial song sequence of the reference user into an initial song recommendation model for processing to obtain a characteristic sequence of the initial song sequence of the reference user;
determining a third similarity parameter between the reference feature sequence and a feature sequence of the initial song sequence of the reference user;
and determining a first difference parameter according to the first similar parameter, the second similar parameter and the third similar parameter corresponding to each reference user.
In a possible implementation manner, 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, where the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate the recommendation degree of each song;
A determining unit for determining a second difference parameter according to the prediction result of each song in the plurality of songs and the song label;
the processing unit is specifically configured to perform the following steps when adjusting the model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model:
Determining a 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 parameters to obtain a target song recommendation model.
In one possible implementation manner, the obtaining unit obtains song information of a song to be recommended and song recommendation indication information of a user to be recommended;
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 the recommendation score of the song to be recommended, and performs song recommendation on the song to be recommended according to the recommendation score.
Accordingly, an embodiment of the application discloses a computer device comprising a processor adapted to implement one or more computer programs, and a computer storage medium storing one or more computer programs adapted to be loaded by the processor and to perform the model training method described above.
Accordingly, embodiments of the present application disclose a computer readable storage medium having stored thereon one or more computer programs adapted to be loaded by a processor and to perform the model training method described above.
Accordingly, embodiments of the present application disclose a computer program product comprising 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 so that the computer device performs the model training method described above.
In the embodiment of the application, an initial song sequence of a target user is obtained, the initial song sequence is generated according to song information (names, singers, songs and languages) of a plurality of songs, the songs are songs (historical song listening) related to song listening behaviors of the target user, each song in the plurality of songs corresponds to a song label, the song labels are positive labels or negative labels, the song labels are determined according to playing characteristics corresponding to the songs, song attributes of each song with the positive labels are determined, masking processing is carried out on the initial song sequence according to the song attributes to obtain a comparison song sequence, the song attributes are key song attributes or non-key song attributes, attribute division is carried out on the songs with the positive labels to obtain the comparison song sequence, and the comparison song sequence formed after attribute information is introduced can be more accurately divided into the initial song sequence of the user, so that interest points of the user can be more accurately determined. The method comprises the steps of inputting an initial song sequence into an initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, inputting a comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence, determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model. The data processed by the steps are used for model training, so that the model training effect can be improved, namely the interest points of the user can be trained, and the obtained target song recommendation model can accurately recommend songs interesting to the user.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a network architecture of a model training system according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a model training method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a construction of a comparison song sequence provided by an embodiment of the present application;
FIG. 4 is a block diagram of a model provided by the application embodiments;
FIG. 5 is a flow chart of another model training method according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a model training device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order to more accurately recommend songs to users, the embodiment of the application provides a model training method, which improves the original song recommendation model, in particular accurately divides training data, thereby improving the training effect of the model and enabling the obtained target song recommendation model to accurately recommend songs of interest to users.
The model training method provided by the embodiment of the application can be based on artificial intelligence (ARTIFICIAL INTELLIGENCE, AI), which is the intelligence of simulating, extending and expanding a person using a digital computer or a machine controlled by a digital computer, and sensing the environment, acquiring knowledge and using knowledge to obtain the best result, in other words, artificial intelligence is a comprehensive technology of computer science that attempts to understand the nature of intelligence and to produce a new intelligent machine that can react in a manner similar to human intelligence. The artificial intelligence technology is a comprehensive subject, and relates to the technology with a hardware level and a software level, wherein the artificial intelligence basic technology generally comprises technologies such as a sensor, a special artificial intelligence chip, cloud computing, distributed storage, a big data processing technology, an operation/interaction system, and electromechanical integration, and the artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, a machine learning/deep learning technology and the like.
The model training method provided by the embodiment of the application mainly relates to a machine learning (MACHINE LEARNING, ML) technology in an AI technology. Machine learning is a multi-domain interdisciplinary, involving multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and the like. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, confidence networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
In a possible embodiment, the model training method provided by the embodiment of the application can be further implemented based on Cloud Technology (Cloud Technology) and/or blockchain Technology. In particular, the method can relate to one or more of Cloud Storage (Cloud Storage), cloud Database (Cloud Database) and Big data (Big data) in Cloud technology. For example, data (e.g., initial song sequence of the target user, initial song recommendation model, etc.) needed to perform the model training method is obtained from a cloud database. For another example, the data required to perform the model training method may be stored in blocks on the blockchain, the data generated by performing the model training method (e.g., the target song recommendation model) may be stored in blocks on the blockchain, and the data processing device performing the model training method may be a node device in the blockchain network.
Specifically, the cloud technology refers to a hosting technology for unifying serial resources such as hardware, software, network and the like in a wide area network or a local area network to realize calculation, storage, processing and sharing of data. The cloud technology is a generic term of network technology, information technology, integration technology, management platform technology, application technology and the like based on cloud computing business model application, can form a resource pool, and is flexible and convenient as required. Cloud computing technology will become an important support. Cloud storage (cloud storage) is a new concept that extends and develops in the concept of cloud computing, and a distributed cloud storage system (hereinafter referred to as a storage system for short) refers to a storage system that integrates a large number of storage devices (storage devices are also referred to as storage nodes) of various types in a network to work cooperatively through application software or application interfaces through functions such as cluster application, grid technology, and a distributed storage file system, so as to provide data storage and service access functions for the outside. The database (Data base), which can be considered as an electronic filing cabinet, is a place for storing electronic files, and users can perform operations such as adding, inquiring, updating, deleting and the like on the Data in the files. A "database" is a collection of data stored together in a manner that can be shared with multiple users, with as little redundancy as possible, independent of the application.
The following describes a model training system and an application scenario of the model training method, which are suitable for implementing the model training method provided by the embodiment of the present application, with reference to fig. 1. Referring to fig. 1, fig. 1 is a schematic diagram of a network architecture of a model training system according to an embodiment of the present application, and as shown in fig. 1, the model training system may at least include a server 101 and a terminal device 102, where the number of terminal devices 102 may be one or more. The server 101 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), and basic cloud computing services such as big data and artificial intelligent platforms, which are not limited in this embodiment of the present application, the terminal device 102 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent voice interaction device, a smart watch, a vehicle-mounted terminal, an intelligent home appliance, an aircraft, etc., but is not limited in this regard, and the server 101 and the terminal device 102 may be directly connected in a wired communication manner or indirectly connected in a wireless communication manner.
Based on the model training system of fig. 1, the model training method provided by the embodiment of the application can be executed by the server 101, and the model training process comprises the steps of obtaining an initial song sequence of a target user by the server 101, wherein the initial song sequence is generated according to song information (name, singer, song wind and language) of a plurality of songs, the songs are songs (history song listening songs) related to song listening behaviors 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, the song label is determined according to playing characteristics corresponding to the songs, determining the song label is a song attribute of each song of the positive example label, masking 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 attribute, carrying out attribute division on the songs of the song label which is the positive example label to obtain the comparison song sequence, inputting the initial song sequence into a recommendation model to obtain a reference characteristic sequence of the initial song sequence, inputting the comparison song sequence into the initial song recommendation model to obtain the comparison song sequence, carrying out processing on the comparison song sequence, determining the characteristic sequence and the first recommendation model according to the characteristic sequence and the reference characteristic sequence of the positive example label, and carrying out adjustment on the comparison recommendation model to obtain the first recommendation characteristic parameter difference.
After training to obtain the target song recommendation model based on the training process, the application of the model may be specifically executed by the terminal device 102, and it may be understood that the target song recommendation model is deployed in the terminal device 102, and the music, that is, the music recommendation scene, is recommended to the user in various music recommendation systems. In the music recommendation scenario, songs are recommended to the user by using the target song recommendation model, after the user starts a music application program a, the terminal device 102 can call the target song recommendation model to acquire attribute information of the user (including identification, head portrait, gender of the user and song recommendation indication information of the user), then recommend songs liked by the user according to the attribute information of the user and interest points, the recommended songs can be a set, and then the set is stored in a music list, and can be displayed by the user such as a recommendation list, a daily recommendation and the like, and the user can play through the list.
Or the terminal device 102 recommends songs to the user in real time, when the user starts a music application program a, the terminal device 102 can call the target song recommendation model to acquire attribute information (including user identification, head portrait, gender and song recommendation indication information of the user), when the user clicks a real-time class play control such as 'radio station', 'live broadcast', and the like, the terminal device 102 recommends songs to the user in real time based on the attribute information of the user and interest points of the user, and recommends songs close to the style of the song A to the user in real time after the user listens to the song A.
Alternatively, the model training described above may be used to train any recommendation-related model, such as a commodity recommendation model that may recommend commodities of interest to a user to the user, a literature recommendation model that may recommend literary works of interest to the user, a video recommendation model that may recommend videos of interest to the user.
It can be understood that, the model training system described in the embodiment of the present application is for more clearly describing the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application, and those skilled in the art can know that, with the evolution of the system architecture and the appearance of the new service scenario, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.
It should be noted that, in the embodiments of the present application, related data such as song information of an acquisition object is involved, when the embodiments of the present application are applied to specific products or technologies, permission or consent of the object needs to be obtained, and collection, use and processing of the related data need to comply with related laws and regulations and standards of related countries and regions.
Referring to fig. 2, a flow chart of a model training method disclosed in an embodiment of the present application is shown, and the model training method mainly introduces a training process of a target song recommendation model. The model training method may be performed by a computer device, which may be the server 101 in the model training system described above. As shown in fig. 2, the model training method may include, but is not limited to, the following steps S201 to S204:
S201, acquiring an initial song sequence of a target user, wherein the initial song sequence is generated according to song information of a plurality of songs related to song listening behaviors 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 playing characteristics corresponding to the song.
In one possible implementation, the process of obtaining the initial song sequence of the target user may include obtaining a plurality of songs related to the song listening behavior of the target user, that is, the historical song listening of the target user, obtaining song information of the plurality of songs from a database (including local storage and online storage) at the same time, where the song information may include a song name, a song singer, a song wind, a song language, song time information, a song playing feature, and the like. And then, performing feature extraction processing on song information of a plurality of songs and user information of a target user by using a natural language processing technology to obtain an initial song sequence of the target user, wherein the feature extraction method is various and comprises a principal component analysis method, a model extraction method and the like. As can be seen from the foregoing, each song corresponds to a song label, and the determining process of the song label corresponding to each song may include obtaining a playing characteristic of the song included in the song information, determining the song label of the song that satisfies the preset playing characteristic as a positive example label, and determining the song label of the song that does not satisfy the preset playing characteristic as a negative example label. In the application, meeting the preset condition can include one or more of the playing feature being the completion of playing or the playing time reaching a time threshold. The fact that the preset condition is not met includes that the playing time length does not reach the time length threshold, the user is embodied in cutting songs, namely, the user can switch to the next song without hearing the song.
Before model training, related training data needs to be acquired, and in the embodiment of the application, the initial song sequence of the target user is the training data. The target user is merely exemplary, and in the actual training process, an initial song sequence of N users may be obtained, where N is a larger value.
S202, determining song attributes of each song with the song label being a positive example label, and masking an initial song sequence according to the song attributes to obtain a comparison song sequence, wherein the song attributes are key song attributes or non-key song attributes.
In order to train a target song recommendation model with higher recommendation hit rate, after determining that all songs with the target user's song label being positive example labels and all songs with the song label being negative example labels, distinguishing again for all songs with the song label being positive example labels so as to solve the problem of interest collapse. In the embodiment of the present application, the song attributes of all songs for which the song label is a positive example label may be determined by the following two schemes:
In the first scheme, the operation behavior of the user aiming at the target song is firstly obtained, the target song is any song with the song label of the positive example label in a plurality of songs, and it can be understood that the step is executed for each song with the song label of the positive example label. If the target behavior exists in the operation behavior of the user aiming at the target song, determining that the song attribute of the target song is a key song attribute; and if the target behavior does not exist in the operation behavior of the user aiming at the target song, determining that the song attribute of the target song is a non-key song attribute. Key song attributes refer to songs that are more interesting to the targeted user of the song to which such attributes correspond, and non-key song attributes refer to songs that such attributes correspond to that may not be interesting to the user.
According to the scheme II, song characteristics (such as vector expression form) of a first song and song characteristics (such as vector expression form) of a second song are determined, the first song is any song in a song set, the second song is any song except the first song in the song set, the song set is composed of songs with song labels of positive labels in a plurality of songs, song similarity of the first song and the second song is determined according to the song characteristics of the first song and the song characteristics of the second song, the ratio of songs, in the song set, with the song similarity of which is greater than or equal to a similarity threshold value is determined according to the song similarity, the song attribute of the first song is determined to be a key song attribute if the ratio is greater than or equal to the ratio threshold value, and the song attribute of the first song is determined to be a non-key song attribute if the ratio is smaller than the ratio threshold value. This process may be implemented using a self-attention (self-attention) mechanism, which is actually comparing similarities between songs, by which a more accurate partitioning may be obtained.
Or the combination of the scheme I and the scheme II determines the song attribute of all songs with the song label being the positive example label. For example, an intermediate branch may be determined based on scheme one, and then song attributes for each song may be determined based on scheme two. The method comprises the steps of firstly obtaining operation behaviors of a user aiming at a target song, wherein the target song is any song with a song label of a plurality of songs as a positive example label, determining that song attributes of the target song are reference key song attributes if the operation behaviors of the user aiming at the target song exist, determining that the song attributes of the target song are non-key song attributes if the operation behaviors of the user aiming at the target song do not exist, and determining that the song attributes of the target song are one or more of downloading behaviors, collecting behaviors, sharing behaviors and comment behaviors. And determining song characteristics (such as vector expression form) of a third song and song characteristics (such as vector expression form) of a fourth song by using the song attributes as reference key song attributes, wherein the third song is any song in a second song set, the fourth song is any song except the third song in the second song set, the second song set is composed of songs with song attributes as reference key attributes in positive example tags in a plurality of songs, song similarity of the third song and the fourth song is determined according to the song characteristics of the third song and the song characteristics of the fourth song, the ratio of the song similarity of the third song and the fourth song in the song set is greater than or equal to a similarity threshold is determined according to the song similarity, the song attribute of the third song is determined to be the key song attribute if the ratio is greater than or equal to the ratio threshold, and the song attribute of the third song is determined to be the non-key song attribute if the ratio is less than the ratio threshold.
Or determining song attributes of all songs with the song label being the positive example label by using the scheme I and then checking by using the scheme II, or determining song attributes of all songs with the song label being the positive example label by using the scheme II and then checking by using the scheme I. The two schemes are combined in any mode, and all songs with song labels being positive example labels are processed to determine attribute information of the songs.
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 be performed by the above method.
Further, after determining the song attribute of all songs with the song label being the positive example label, masking the initial song sequence according to the song attribute to obtain a comparison song sequence, which may include determining a first to-be-processed song from the songs with the song attribute being the key song attribute, wherein the first to-be-processed song is a part of the songs with the song attribute being the key song attribute or all the songs with the song attribute being the key song attribute, masking sequence elements corresponding to the first to-be-processed song in the initial song sequence according to a certain rule or randomly selected to obtain a first song sequence, determining a second to-be-processed song from the songs with the song attribute being the non-key song attribute, and masking sequence elements corresponding to the second to-be-processed song in the initial song sequence according to a certain rule or randomly selected to obtain a second song sequence. The first song sequence and the second song sequence are determined as comparison song sequences, i.e. the comparison song sequence comprises two song sequences, one being the first song sequence and the other being the second song sequence.
Or masking the initial song sequence according to the song attribute to obtain a comparison song sequence, and further comprises determining key songs from songs with key song attributes, performing first random masking processing on sequence elements corresponding to the key songs in the initial song sequence to obtain a first song sequence, determining non-key songs from songs with non-key song attributes, and performing second random masking processing on sequence elements corresponding to the non-key songs in the initial song sequence to obtain a second song sequence. The first song sequence and the second song sequence are determined as comparison song sequences. Wherein, the key songs refer to all songs with the song label being a positive example label and the song attribute being a key song attribute, and the non-key songs refer to all songs with the song label being a positive example label and the song attribute being a non-key song attribute. The first random masking process and the second random masking process may be the same or different, and the random masking process is to partially mask or completely mask sequence elements corresponding to the key song and the non-key song. The arrangement can be made according to different situations, and the application is not limited.
The construction of the comparison song sequence is an important point of the embodiment of the present application, and can be illustrated by way of example, please refer to fig. 3, which is a schematic diagram for constructing the comparison song sequence provided by the embodiment of the present application, and the identification of the key song sequence and the non-key song sequence is performed on the initial song sequence, so as to obtain the key song sequence and the non-key song sequence. And then, constructing a comparison song sequence, masking the initial song sequence based on the key song sequence to obtain a first song sequence, and masking the initial song sequence based on the non-key song sequence to obtain a second song sequence. The initial song sequence in fig. 3 is the song sequence processed in step S201, that is, the song label is the positive label.
S203, inputting the initial song sequence into the initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence.
Step S203 is mainly a processing procedure of data by using the model, and step S203 may be described with reference to fig. 4, and fig. 4 is a frame diagram of a model provided by an embodiment of the present application, which may include an embedding layer, a feature fusion layer, and a multitasking layer. The initial song sequence may be input into an embedding layer of the initial song recommendation model to be processed to obtain a reference feature sequence of the initial song sequence, as represented by 401 in fig. 4, the initial song sequence of the model includes basic information (such as identification, head portrait, gender, city, etc.), song identification, song features and user features of the user, the comparison song sequence includes a first song sequence and a second song sequence according to the step S202, so that the comparison song sequence is input into the embedding layer of the initial song recommendation model to be processed to obtain a comparison feature sequence of the comparison song sequence, and the method may include inputting the first song sequence into the initial song recommendation model to be processed to obtain a first comparison feature sequence, inputting the second song sequence into the initial song recommendation model to be processed 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, i.e., the comparison feature sequence includes the first comparison feature sequence and the second comparison feature sequence. As shown at 402 in fig. 4, the processing of the first and second contrast feature sequences is an intermediate step that serves to enhance the input of the sequence of positive songs.
It should be noted that the model structure shown in fig. 4 is only exemplary, and a simple DNN network may be directly used.
S204, determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting model parameters of the initial song recommendation model according to the first difference parameter to obtain the target song recommendation model.
Wherein the first discrepancy parameter refers to the loss of the portion shown at 402 in fig. 4. The determining of the first difference parameter based on the reference feature sequence and the comparison feature sequence may mainly comprise determining a first similarity parameter between the reference feature sequence and the first comparison feature sequence, determining a second similarity parameter between the reference feature sequence and the second comparison feature sequence, and determining the first difference parameter based on the first similarity parameter and the second similarity parameter.
Furthermore, because the embodiment of the application trains a general model, a large amount of data of other users are required to determine the target song recommendation model corresponding to the target user, and the data of various users are trained, so that the general target song recommendation model is trained and is suitable for all people. The target user is any one of a user set, the user set comprises a plurality of users, the initial song sequence of the reference user is acquired aiming at the reference user, the initial song sequence of the reference user is input into an initial song recommendation model to be processed, the characteristic sequence of the initial song sequence of the reference user is obtained, and the reference user is any one user except the target user in the user set. A third similarity parameter is then determined between the reference feature sequence and the feature sequence of the initial song sequence of the reference user. And finally, determining a first difference parameter according to the first similar parameter, the second similar parameter and the third similar parameter corresponding to each reference user.
The calculation formula of the first difference parameter L1 may be referred to as the following formula (1):
The loss of one training calculated by equation (1), where s () represents a function, for example, may be an inner product function, i.e., two data are subjected to an inner product operation, the closer the two vectors are, the larger the inner product value thereof. Refers to the user characterization of the ith user (i.e., the characteristic sequence of the initial song sequence of the ith user, if the ith user is the target user)I.e. a reference feature sequence),Refers to the first contrast feature sequence of the ith user,Refers to the second contrast feature sequence of the ith user.Refers to the user characterization of the jth user (i.e., the characteristic sequence of the jth user's initial song sequence). The goal of the formula is to bring the user characterization of user i closer to the first contrast feature sequence (positive example) vector and farther away from the second contrast feature sequence (negative example). This way, the point of interest of the user is extracted more accurately.
In addition to the above-mentioned auxiliary loss of the first difference parameter, the main output of the model has a loss, i.e. a loss calculated from the prediction result of each song and the label data (either positive or negative label) of each song. In an embodiment of the application, the loss is described by a second difference parameter, which may be a cross entropy loss function. According to the above description, 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, where the prediction result set includes a prediction result of each of the plurality of songs, and the prediction result may be a probability value, so that, in combination with the first difference parameter, a specific training process of the model may include determining a second difference parameter according to the prediction result and the song label of each of the plurality of songs, determining a target difference parameter according to the first difference parameter and the second difference parameter, and adjusting the model parameter of the initial song recommendation model according to the target difference parameter to obtain the target song recommendation model. And continuously adjusting model parameters of the initial song recommendation model according to the target difference parameters, stopping adjusting the parameters of the model when the target difference parameters of the model are smaller than a difference threshold or the iteration number reaches the set number, and taking the model obtained by current adjustment as the target song recommendation model. Through the training, the target song recommendation model is expected to be capable of predicting the song to be recommended, and the time of the user hearing and whether the user can play the song completely are accurately predicted.
The calculation formula of the target difference parameter Lall may be referred to as the following formula (2):
In the formula (2), L1 is a first difference parameter, L2 is a second difference parameter, l2_norm 2 represents a feature sequence obtained by feature normalization of the predicted data, l2_norm 1 represents a feature sequence obtained by feature normalization of the output data after the first difference parameter is calculated, and r represents a weight parameter. In the embodiment of the application, two difference parameters can be fused by adopting a meta-balance method, and serious optimization imbalance problems are usually encountered due to the use of multi-task learning in a recommended scene. On the one hand, one or more auxiliary tasks may have a greater impact than the target task, even leading to a dominant network weight, resulting in a reduced accuracy of recommendation of the target task. On the other hand, the impact of one or more auxiliary tasks may be too weak to assist the target task. This imbalance dynamically changes throughout the training process and changes in 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 maintains a part of own gradient while scaling, so that the problem that the gradient of the auxiliary task is too large and too small is solved. The r value is adjusted to make the gradient of different tasks similar.
In the embodiment of the application, mainly explaining how a target song recommendation model is obtained by training, firstly processing training sample data, namely obtaining an initial song sequence of a target user, wherein the initial song sequence is generated according to song information (names, singers, song wind and languages) of a plurality of songs, the plurality of songs are songs (historical song listening songs) related to 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, the song label is determined according to playing characteristics corresponding to the song, determining the song attribute of each song with the song label being the positive example label, and carrying out mask processing on the initial song sequence 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. And then inputting the processed training sample into an initial song recommendation model to train the model, namely inputting an initial song sequence into the initial song recommendation model to process to obtain a reference characteristic sequence of the initial song sequence, inputting a comparison song sequence into the initial song recommendation model to process to obtain a comparison characteristic sequence of the comparison song sequence, determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting model parameters of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model. The data processed by the steps are used for model training, so that the model training effect can be improved, namely the interest points of the user can be trained, and the obtained target song recommendation model can accurately recommend songs interesting to the user.
Referring to fig. 5, a schematic flow chart of another model training method disclosed in the embodiment of the present application in fig. 5 is shown, where the model training method mainly introduces a training process and a prediction process of a target song recommendation model, and the model training method is interactively executed by a server and a terminal device. As shown in fig. 5, the model training method may include, but is not limited to, the following steps S201 to S204:
s501, the server acquires an initial song sequence of each user in the user set.
The initial song sequence of each user in the user set is generated according to song information of a plurality of songs, the songs are songs related to the song listening behavior of each 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 playing characteristics corresponding to the songs. The specific determination process can be referred to as step S201.
S502, the server divides the initial song sequence of each user in the user set to obtain a plurality of groups of training data. For example, there are N users, and each user's initial song sequence corresponds to M songs, and 10 songs of one user can be extracted at a time, and a set of training numbers is formed by 10×n.
And S503, the server trains the initial song recommendation model by utilizing a plurality of groups of training data to obtain a target song recommendation model. I.e. the relevant steps as shown in fig. 2 are performed for each user in each of the sets of training data. And respectively calculating target difference parameters, namely total loss, and adjusting network parameters of the initial song recommendation model based on the total loss to obtain the target song recommendation model.
S504, the server deploys the target song recommendation model in the terminal equipment. The target song recommendation model can be deployed in any terminal equipment or in a blockchain network, and can be obtained from the blockchain network when in use.
S505, the terminal equipment acquires song information of the songs to be recommended and song recommendation indication information of the users to be recommended.
The song information of the songs to be recommended can be obtained from a song library (the song library comprises all the released songs, including the locally stored songs), or can be pulled from various network platforms during the process of listening to the songs of the user. Meanwhile, song information of the song to be recommended and song recommendation indication information of the user to be recommended need to be obtained according to user information of the user to be recommended, wherein the user information mainly can refer to user identification, such as user id, user nickname, user head portrait and the like. The song recommendation indication information is a vector of a vector pool generated in the training process and is mainly used for representing the historical song listening characteristics of users to be recommended. The song to be recommended may indicate a song, or may indicate a song set.
And S506, the terminal equipment inputs the song recommendation indication information and the song information of the song to be recommended into a target song recommendation model for processing, so as to obtain the recommendation score of the song to be recommended.
In one possible implementation manner, if the song to be recommended indicates a song, the terminal device inputs song recommendation indication information of the user to be recommended and song information of the song to be recommended into the target song recommendation model for processing, so as to obtain a recommendation score of the song to be recommended.
In another possible implementation manner, if the song to be recommended indicates a song set, the song information of the songs in the whole song set and the song recommendation indication information of the user to be recommended are input into the input target song recommendation model indicated by the input indication information to be recommended, so as to obtain the recommendation score of each song in the whole song set.
And S507, the terminal equipment carries out song recommendation on the songs to be recommended according to the recommendation score.
If the recommendation score of the song to be recommended reaches the score threshold, the terminal equipment recommends the song to be recommended to the user to be recommended.
According to step S507, when the recommendation score of each song in the whole song set is obtained, determining that the recommendation score is greater than the score threshold, then sorting the songs greater than the score threshold according to the score, adding the sorted songs to a to-be-played list, and displaying the to-be-played list to the to-be-recommended user, wherein the to-be-recommended user can select and play the songs in the list.
The steps S505-S507 may also be executed by the server, which is equivalent to that the terminal device sends the play request to the server, the server obtains the song information of the song to be recommended and the song recommendation indication information of the user to be recommended, the song recommendation indication information and the song information of the song to be recommended are input into the target song recommendation model for processing, the recommendation score of the song to be recommended is obtained, then song recommendation is performed for the song to be recommended according to the recommendation score, the recommendation result is returned to the terminal device, and the terminal device displays.
Based on the target song recommendation model, developers perform online tests on the target song recommendation model, and based on the target song recommendation model, the song listening time of a user for recommending songs is increased by 3.01% in the song listening process of the user, and the collection behavior of the recommended songs is improved by 5.21%. Therefore, the method provided by the embodiment of the application can more accurately recommend songs to the user.
The embodiment of the application mainly describes the whole process of the model training method, comprising a training process and a prediction process, wherein in the training process, sample data are accurately divided so as to improve the model training effect. In the prediction process, the target song recommendation model provided by the application can be determined through experiments to more accurately recommend songs to users.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a model training apparatus provided in an embodiment of the present application, and the model training apparatus 600 may be provided in a computer device provided in an embodiment of the present application, where the computer device may be the server 101 mentioned in the embodiment of the method. The model training apparatus 600 shown in fig. 6 may be a computer program (comprising program code) running in a computer device, which model training apparatus 600 may be used to perform some or all of the steps of the method embodiments shown in fig. 2 or fig. 5. Referring to fig. 6, the model training apparatus 600 may include the following units:
An obtaining unit 601, configured to obtain an initial song sequence of a target user, where the initial song sequence is generated according to song information of a plurality of songs related to 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 playing feature corresponding to the song;
a determining unit 602, configured to determine that the song label is a song attribute of each song of the positive example label, and mask the initial song sequence according to the song attribute to obtain a comparison song sequence, where the song attribute is a key song attribute or a non-key song attribute;
The processing unit 603 is configured to input the initial song sequence into an initial song recommendation model for processing, obtain a reference feature sequence of the initial song sequence, input the comparison song sequence into the initial song recommendation model for processing, 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 model parameters of the initial song recommendation model according to the first difference parameter, so as to obtain a target song recommendation model.
In one possible implementation manner, the determining unit 602 is configured to, when determining that the song label is the song attribute of each song of the positive label, specifically perform the following steps:
acquiring the operation behavior of a target user aiming at a target song, wherein the target song is any song of which the song label is the positive label in the plurality of songs;
If the target user has target behaviors aiming at the operation behaviors of the target songs, determining the song attributes of the target songs as the key song attributes, wherein the target behaviors comprise one or more of downloading behaviors, collecting behaviors, sharing behaviors and comment behaviors;
And if the target behavior of the target user aiming at the target song does not exist, determining that the song attribute of the target song is the non-key song attribute.
In one possible implementation manner, the determining unit 602 is configured to, when determining that the song label is the song attribute of each song of the positive label, specifically perform the following steps:
Determining song characteristics of a first song and song characteristics of a second song, wherein the first song is any song in a song set, the second song is any song except the first song in the song set, and the song set is composed of songs, of which the song labels are the positive labels, in the plurality of songs;
determining song similarity of the first song and the second song according to the song characteristics of the first song and the song characteristics of the second song;
determining the duty ratio of songs, in the song collection, with which the song similarity to the first song is greater than or equal to a similarity threshold value according to the song similarity;
if the duty ratio is greater than or equal to a duty ratio threshold value, determining that the song attribute of the first song is the key song attribute;
And if the duty ratio is smaller than the duty ratio threshold value, determining that the song attribute of the first song is the non-key song attribute.
In a possible implementation manner, the processing unit 603 is configured to mask the initial song sequence according to the song attribute, and when obtaining a comparison song sequence, specifically is configured to perform the following steps:
Determining a first to-be-processed song from songs with the song attribute being the key song attribute, and masking sequence elements corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;
Determining a second song to be processed from songs with the song attribute being the non-key song attribute, and masking sequence elements corresponding to the second song to be processed in the initial song sequence to obtain a second song sequence;
determining the first song sequence and the second song sequence as comparison song sequences;
The step of inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence comprises the following steps:
inputting the first song sequence into the initial song recommendation model for processing to obtain a first comparison characteristic sequence;
Inputting the second song sequence into the initial song recommendation model for processing to obtain a second comparison characteristic sequence;
And determining the first contrast characteristic sequence and the second contrast characteristic sequence as contrast characteristic sequences.
In a possible implementation manner, the determining unit 602 is configured to determine the first difference parameter according to the reference feature sequence and the comparison feature sequence, and specifically is configured to perform the following steps:
determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,
Determining a second similar parameter between the reference feature sequence and the second contrast feature sequence,
And determining a first difference parameter according to the first similar parameter and the second similar parameter.
In a possible implementation manner, the determining unit 602 is configured to determine the first difference parameter according to the reference feature sequence and the comparison feature sequence, and specifically is configured to perform the following steps:
Acquiring an initial song sequence of a reference user, and inputting the initial song sequence of the reference user into an initial song recommendation model for processing to acquire a characteristic sequence of the initial song sequence of the reference user, wherein the reference user is any user except the target user in a user set where the target user is located;
determining a third similarity parameter between the reference feature sequence and a feature sequence of the initial song sequence of the reference user;
and determining a first difference parameter according to the first similar parameter, the second similar parameter and the third similar parameter corresponding to each reference user.
In a possible implementation manner, 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, where the prediction result set includes a prediction result of each song in the plurality of songs, and the prediction result is used to indicate the recommendation degree of each song;
The determining unit 602 is further configured to determine a second difference parameter according to the prediction result and the song label of each song in the plurality of songs;
the processing unit 603 is configured to adjust the model parameters of the initial song recommendation model according to the first difference parameters to obtain a target song recommendation model, and specifically configured to perform the following steps:
Determining a 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 parameters to obtain a target song recommendation model.
In one possible implementation manner, the obtaining unit 601 obtains song information of a song to be recommended and song recommendation indication information of a user to be recommended;
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, obtain a recommendation score of the song to be recommended, and recommend a song to the song to be recommended according to the recommendation score.
It may be understood that the functions of each functional unit of the model training apparatus provided in the embodiment of the present application may be specifically implemented according to the method in the embodiment of the method, and the specific implementation process may refer to the related description in the embodiment of the method, which is not repeated herein.
In a possible embodiment, the model training device provided by the embodiment of the application can be implemented in a software manner, and the model training device can be stored in a memory, can be software in the form of a program, a plug-in unit and the like, and comprises a series of units including an acquisition unit, a processing unit and a determining unit, wherein the acquisition unit, the determining unit and the processing unit are used for implementing the model training method provided by the embodiment of the application.
In other possible embodiments, the model training apparatus provided in the embodiments of the present application may also be implemented in a combination of software and hardware, and by way of example, the model training apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the model training method provided in the embodiments of the present application, for example, the processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, programmable logic devices (PLDs, programmable Logic Device), complex Programmable logic devices (CPLDs, complex Programmable Logic Device), field Programmable Gate Arrays (FPGAs), field-Programmable GATE ARRAY), or other electronic components.
According to the embodiment of the application, the acquisition unit 601 acquires an initial song sequence of a target user, wherein the initial song sequence is generated according to song information (names, singers, song wind and languages) of a plurality of songs, the songs are songs (historical song listening) related to song listening behaviors 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, the song label is determined according to playing characteristics corresponding to the song, the determination unit 602 determines song attributes of each song, the song label is a positive example label, masking processing is carried out on the initial song sequence according to the song attributes to obtain a comparison song sequence, the song attributes are key song attributes or non-key song attributes, attribute division is carried out on the songs, the song label is the positive example label, the comparison song sequence is obtained, and the comparison song sequence formed after attribute information is introduced can be more accurately divided, and interest points of the user can be more accurately determined. The processing unit 603 inputs the initial song sequence into the 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 model parameters of the initial song recommendation model according to the first difference parameter to obtain the target song recommendation model. The data processed by the steps are used for model training, so that the model training effect can be improved, namely the interest points of the user can be trained, and the obtained target song recommendation model can accurately recommend songs interesting to the user.
Based on the above method and apparatus embodiments, the present embodiment of the present application provides a computer device, which may be the aforementioned server 101. Referring to fig. 7, fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device described in the embodiments of the present application includes a processor 701, a communication interface 702, and a memory 703. The processor 701, the communication interface 702, and the memory 703 may be connected by a bus or other manners, and in this embodiment of the present application, the computer device may be 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 in fig. 1 by using a bus connection as an example.
The processor 701 (or CPU (Central Processing Unit, central processing unit)) is a computing core and a control core of the computer device, and can analyze various instructions in the computer device and process various data of the computer device, for example, the CPU can be used for analyzing a power-on instruction sent by a user to the computer device and controlling the computer device to perform power-on operation, for example, the CPU can transmit various interactive data between internal structures of the computer device, and the like. Communication interface 702 may optionally comprise a standard wired interface, a wireless interface (e.g., wi-Fi, mobile communication interface, etc.), controlled by processor 701 for transceiving data. Memory 703 (Memory) is a Memory device in a computer device for storing programs and data. It will be appreciated that the memory 703 herein may comprise either a built-in memory of the computer device or an extended memory supported by the computer device. The memory 703 provides a storage space that stores the operating system of the computer device, which may include, but is not limited to, an Android system, iOS system, windows Phone system, etc., as the present application is not limited in this regard.
In an embodiment of the present application, the processor 701 performs the following operations by executing executable program code in the memory 703:
Acquiring an initial song sequence of a target user, wherein the initial song sequence is generated according to song information of a plurality of songs related to the song listening behavior of the target user, the plurality of songs are songs related to 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 playing characteristics corresponding to the song;
determining the song label as the song attribute of each song of the positive example label, and masking 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;
Inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence;
And determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting the model parameter of the initial song recommendation model according to the first difference parameter to obtain a target song recommendation model.
In one possible implementation, the processor 701 is configured to, when determining that the song label is the song attribute of each song of the positive label, specifically perform the following steps:
acquiring the operation behavior of a target user aiming at a target song, wherein the target song is any song of which the song label is the positive label in the plurality of songs;
If the target user has target behaviors aiming at the operation behaviors of the target songs, determining the song attributes of the target songs as the key song attributes, wherein the target behaviors comprise one or more of downloading behaviors, collecting behaviors, sharing behaviors and comment behaviors;
And if the target behavior of the target user aiming at the target song does not exist, determining that the song attribute of the target song is the non-key song attribute.
In one possible implementation, the processor 701 is configured to, when determining that the song label is the song attribute of each song of the positive label, specifically perform the following steps:
Determining song characteristics of a first song and song characteristics of a second song, wherein the first song is any song in a song set, the second song is any song except the first song in the song set, and the song set is composed of songs, of which the song labels are the positive labels, in the plurality of songs;
determining song similarity of the first song and the second song according to the song characteristics of the first song and the song characteristics of the second song;
determining the duty ratio of songs, in the song collection, with which the song similarity to the first song is greater than or equal to a similarity threshold value according to the song similarity;
if the duty ratio is greater than or equal to a duty ratio threshold value, determining that the song attribute of the first song is the key song attribute;
And if the duty ratio is smaller than the duty ratio threshold value, determining that the song attribute of the first song is the non-key song attribute.
In a possible implementation manner, the processor 701 is configured to mask the initial song sequence according to the song attribute, so as to obtain a comparison song sequence, and specifically is configured to perform the following steps:
Determining a first to-be-processed song from songs with the song attribute being the key song attribute, and masking sequence elements corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence;
Determining a second song to be processed from songs with the song attribute being the non-key song attribute, and masking sequence elements corresponding to the second song to be processed in the initial song sequence to obtain a second song sequence;
determining the first song sequence and the second song sequence as comparison song sequences;
The step of inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence comprises the following steps:
inputting the first song sequence into the initial song recommendation model for processing to obtain a first comparison characteristic sequence;
Inputting the second song sequence into the initial song recommendation model for processing to obtain a second comparison characteristic sequence;
And determining the first contrast characteristic sequence and the second contrast characteristic sequence as contrast characteristic sequences.
In a possible implementation manner, the processor 701 is configured to determine a first difference parameter according to the reference feature sequence and the comparison feature sequence, specifically configured to perform the following steps:
determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,
Determining a second similar parameter between the reference feature sequence and the second contrast feature sequence,
And determining a first difference parameter according to the first similar parameter and the second similar parameter.
In a possible implementation manner, the processor 701 is configured to determine a first difference parameter according to the reference feature sequence and the comparison feature sequence, specifically configured to perform the following steps:
Acquiring an initial song sequence of a reference user, and inputting the initial song sequence of the reference user into an initial song recommendation model for processing to acquire a characteristic sequence of the initial song sequence of the reference user, wherein the reference user is any user except the target user in a user set where the target user is located;
determining a third similarity parameter between the reference feature sequence and a feature sequence of the initial song sequence of the reference user;
and determining a first difference parameter according to the first similar parameter, the second similar parameter and the third similar parameter corresponding to each reference user.
In one 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, where 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 each song, and the processor 701 is further configured to:
determining a second difference parameter according to the prediction result and the song label of each song in the plurality of songs;
The processor 701 is specifically configured to perform the following steps when adjusting the model parameters of the initial song recommendation model according to the first difference parameters to obtain a target song recommendation model:
Determining a 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 parameters to obtain a target song recommendation model.
In one possible implementation, the processor 701 is further configured to:
acquiring song information of a song to be recommended and song recommendation indication information of a user to be recommended;
Inputting 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 the recommendation score of the song to be recommended, and recommending the song to be recommended according to the recommendation score.
According to one aspect of the present application, the present embodiment also provides a computer program product comprising a computer program stored in a computer readable storage medium. The processor 701 reads the computer program from a computer-readable storage medium, and the processor 701 executes the computer program to cause a computer device to execute the related methods shown in fig. 2 and 5.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, such as the division of the modules described above, are merely a logical function division, and may be implemented in other manners, such as multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. The scope of the application should therefore be determined by the following claims.

Claims (10)

1. A method of model training, the method comprising:
Acquiring an initial song sequence of a target user, wherein the initial song sequence is generated according to song information of a plurality of songs related to 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 playing characteristics corresponding to the song;
Determining the song label as the song attribute of each song of the positive example label, wherein the song attribute is determined based on the operation behavior of the target user on the song in the positive example label or the similarity of the song in the positive example label and is a key song attribute or a non-key song attribute;
Inputting the initial song sequence into an initial song recommendation model for processing to obtain a reference characteristic sequence of the initial song sequence, and inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison characteristic sequence of the comparison song sequence;
And determining a first difference parameter according to the reference characteristic sequence and the comparison characteristic sequence, and adjusting the 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 determining that the song label is a song attribute of each song of the positive label comprises:
acquiring the operation behavior of a target user aiming at a target song, wherein the target song is any song of which the song label is the positive label in the plurality of songs;
If the target user has target behaviors aiming at the operation behaviors of the target songs, determining the song attributes of the target songs as the key song attributes, wherein the target behaviors comprise one or more of downloading behaviors, collecting behaviors, sharing behaviors and comment behaviors;
And if the target behavior of the target user aiming at the target song does not exist, determining that the song attribute of the target song is the non-key song attribute.
3. The method of claim 1, wherein the determining that the song label is a song attribute of each song of the positive label comprises:
Determining song characteristics of a first song and song characteristics of a second song, wherein the first song is any song in a song set, the second song is any song except the first song in the song set, and the song set is composed of songs, of which the song labels are the positive labels, in the plurality of songs;
determining song similarity of the first song and the second song according to the song characteristics of the first song and the song characteristics of the second song;
determining the duty ratio of songs, in the song collection, with which the song similarity to the first song is greater than or equal to a similarity threshold value according to the song similarity;
if the duty ratio is greater than or equal to a duty ratio threshold value, determining that the song attribute of the first song is the key song attribute;
And if the duty ratio is smaller than the duty ratio threshold value, determining that the song attribute of the first song is the non-key song attribute.
4. A method according to any one of claims 1-3, wherein masking the initial song sequence according to the song attribute to obtain a comparison song sequence comprises:
Determining a first to-be-processed song from songs with the song attribute being the key song attribute, and masking sequence elements corresponding to the first to-be-processed song in the initial song sequence to obtain a first song sequence; determining a second song to be processed from songs with the song attribute being the non-key song attribute, and masking sequence elements corresponding to the second song to be processed in the initial song sequence to obtain a second song sequence;
determining the first song sequence and the second song sequence as comparison song sequences;
The step of inputting the comparison song sequence into the initial song recommendation model for processing to obtain a comparison feature sequence of the comparison song sequence comprises the following steps:
Inputting the first song sequence into the initial song recommendation model for processing to obtain a first comparison characteristic sequence; inputting the second song sequence into the initial song recommendation model for processing to obtain a second comparison characteristic sequence;
And determining the first contrast characteristic sequence and the second contrast characteristic sequence as contrast characteristic sequences.
5. The method of claim 4, wherein said determining a first variance parameter from said reference signature sequence and said comparison signature sequence comprises:
determining a first similarity parameter between the reference feature sequence and the first contrast feature sequence,
Determining a second similar parameter between the reference feature sequence and the second contrast feature sequence,
And determining a first difference parameter according to the first similar parameter and the second similar parameter.
6. The method of claim 5, wherein said determining a first variance parameter from said reference signature sequence and said comparison signature sequence comprises:
Acquiring an initial song sequence of a reference user, and inputting the initial song sequence of the reference user into an initial song recommendation model for processing to acquire a characteristic sequence of the initial song sequence of the reference user, wherein the reference user is any user except the target user in a user set where the target user is located;
determining a third similarity parameter between the reference feature sequence and a feature sequence of the initial song sequence of the reference user;
and determining a first difference parameter according to the first similar parameter, the second similar parameter and the third similar parameter corresponding to each reference user.
7. The method of claim 1, wherein the processing of the initial song sequence by the initial song recommendation model further comprises a set of predictors for the initial song sequence, the set of predictors comprising a predictor for each of the plurality of songs, the predictor being indicative of a degree of recommendation for each of the plurality of songs, the method further comprising:
determining a second difference parameter according to the prediction result and the song label of each song in the plurality of songs;
The adjusting the model parameters of the initial song recommendation model according to the first difference parameters to obtain a target song recommendation model includes:
Determining a 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 parameters to obtain a target song recommendation model.
8. The method according to claim 1, wherein the method further comprises:
acquiring song information of a song to be recommended and song recommendation indication information of a user to be recommended;
Inputting 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 the recommendation score of the song to be recommended;
And recommending the songs to be recommended according to the recommendation score.
9. A computer device, the computer device comprising:
a processor adapted to implement one or more computer programs, and
Computer storage medium storing one or more computer programs adapted to be loaded by the processor and to perform the model training method according to any of claims 1-8.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more computer programs adapted to be loaded by a processor and to perform the model training method according to any of the claims 1-8.
CN202310442515.6A 2023-04-14 2023-04-14 Model training methods and related equipment Active CN116401400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310442515.6A CN116401400B (en) 2023-04-14 2023-04-14 Model training methods and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310442515.6A CN116401400B (en) 2023-04-14 2023-04-14 Model training methods and related equipment

Publications (2)

Publication Number Publication Date
CN116401400A CN116401400A (en) 2023-07-07
CN116401400B true CN116401400B (en) 2026-01-09

Family

ID=87010416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310442515.6A Active CN116401400B (en) 2023-04-14 2023-04-14 Model training methods and related equipment

Country Status (1)

Country Link
CN (1) CN116401400B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117112901A (en) * 2023-08-28 2023-11-24 杭州网易云音乐科技有限公司 Recommended model training methods, playlist recommendation methods, devices, media and equipment
CN117290540B (en) * 2023-10-09 2026-02-03 腾讯音乐娱乐科技(深圳)有限公司 Song recommendation model training method, song recommendation method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197327A (en) * 2018-02-07 2018-06-22 腾讯音乐娱乐(深圳)有限公司 Song recommendations method, apparatus and storage medium
CN114420157A (en) * 2021-12-30 2022-04-29 阿里云计算有限公司 Music representation method, music task processing method, server and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101715070B1 (en) * 2015-12-21 2017-03-13 미디어스코프 주식회사 System and method for providong digital sound transmission based music radio service
WO2022016522A1 (en) * 2020-07-24 2022-01-27 华为技术有限公司 Recommendation model training method and apparatus, recommendation method and apparatus, and computer-readable medium
CN115630153B (en) * 2022-11-11 2025-09-09 华南理工大学 Research literature resource recommendation method based on big data technology

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197327A (en) * 2018-02-07 2018-06-22 腾讯音乐娱乐(深圳)有限公司 Song recommendations method, apparatus and storage medium
CN114420157A (en) * 2021-12-30 2022-04-29 阿里云计算有限公司 Music representation method, music task processing method, server and storage medium

Also Published As

Publication number Publication date
CN116401400A (en) 2023-07-07

Similar Documents

Publication Publication Date Title
US12039447B2 (en) Information processing method and terminal, and computer storage medium
CN111090756B (en) Artificial intelligence-based multi-target recommendation model training method and device
CN110597962B (en) Search result display method and device, medium and electronic equipment
CN111914569A (en) Prediction method and device based on fusion map, electronic equipment and storage medium
CN112989174B (en) Information recommendation method, device, medium and equipment
CN113569129B (en) Click-through rate prediction model processing method, content recommendation method, device and equipment
CN111738010B (en) Method and device for generating semantic matching model
CN110234018A (en) Multimedia content description generation method, training method, device, equipment and medium
CN116401400B (en) Model training methods and related equipment
CN112182281B (en) Audio recommendation method, device and storage medium
CN117787290A (en) Drawing prompting method and device based on knowledge graph
WO2024051146A1 (en) Methods, systems, and computer-readable media for recommending downstream operator
CN116956183A (en) Multimedia resource recommendation method, model training method, device and storage medium
CN114420075B (en) Audio processing method, device, equipment, and computer-readable storage medium
CN114357242B (en) Training evaluation method, device, equipment and storage medium based on recall model
CN111414538A (en) Artificial intelligence-based text recommendation method, device and electronic device
CN112801053B (en) Video data processing method and device
CN114511085A (en) Entity attribute value identification method, apparatus, device, medium, and program product
CN114580533A (en) Method, apparatus, device, medium, and program product for training feature extraction model
CN114330353B (en) Entity identification method, device, equipment, medium and program product of virtual scene
CN117435999A (en) Risk assessment method, apparatus, device and medium
CN117216540A (en) Model training method, device, computer equipment, storage medium and product
CN118626705A (en) Information processing method, device, equipment, storage medium and program product
CN116680400B (en) Text classification method, text classification device, computer equipment and storage medium
CN118133883B (en) Graph sampling method, graph prediction method and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant