Recommendation method, device and computer equipment based on user's multiple interests
By using the SE module and the recommendation module in the song recommendation system, the user interest vector is determined and the similarity matched with the song list to be recommended is solved, and the problem of poor song recommendation accuracy in the prior art is achieved, and more efficient user interest capture and recommendation effects are achieved.
Patent Information
- Application Number
- CN202210713326.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-06-22
AI Technical Summary
The prior art is difficult to balance accuracy and diversity in song recommendations, and due to the 'cluster' problem of interest in which user behavior is not obvious, the existing clustering method cannot be applied to all scenarios, resulting in poor accuracy of recommendations.
By obtaining the song vector in the target user's song playlist, inputting it into the song recommendation model, using the SE module to determine the weight vector of the song vector for user interests, and calculating the user interest vector, combining the recommendation module to match the song list to be recommended to generate the target recommended song list.
It effectively improves the accuracy of song recommendations, can better capture users' interests in various aspects, and balances the accuracy and diversity of recommendation results.
Smart Images

Figure CN115048544B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and specifically to a recommendation method based on multiple interests of a user, a recommendation device based on multiple interests of a user, a computer device, and a computer-readable storage medium. Background Art
[0002] At present, the recommendation system plays a vital role in music apps. An excellent recommendation system can increase user stickiness and bring more benefits to the app. In recent years, recommendation technology has made great progress. In terms of recall algorithms, it has developed from the initial collaborative filtering algorithm to the dual-tower model based on vector retrieval, and then to the sequence recommendation method in recent years. It has always been troubled by a problem, that is, how to strike a balance between the accuracy and diversity of recommendation results.
[0003] However, the inventors discovered during the implementation of the embodiments of the present invention that, since not every user's behavior can present an obvious interest "cluster", the prior art method of determining user interests through clustering is usually not applicable to all scenarios, and since the distances between the interest vectors of multiple users obtained are relatively close, the differences in songs are small, and the user's various interests cannot be well captured, resulting in poor recommendation accuracy. Summary of the invention
[0004] In view of the above problems, embodiments of the present invention provide a recommendation method based on user's multiple interests, a recommendation device based on user's multiple interests, a computer device and a computer-readable storage medium, which are used to solve the technical problem of poor accuracy of song recommendations existing in the prior art.
[0005] According to one aspect of an embodiment of the present invention, a recommendation method based on multiple interests of a user is provided, the method comprising:
[0006] Get the song vectors of each played song in the target user's song playlist;
[0007] The song vectors of each of the played songs are input into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used to determine the weight vector of each of the song vectors for user interest, and calculate the user interest vector based on the weight vector and the song vector of each of the played songs; the recommendation module is used to perform similarity matching between the user interest vectors output by each of the SE modules and the song list to be recommended, to obtain the target recommended song list.
[0008] In an optional manner, the weight vector of each song vector for user interest is determined, and the user interest vector is calculated based on the weight vector and the song vectors of each played song, including: connecting each song vector end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each song vector.
[0009] In an optional manner, before inputting the song vectors of each played song into the song recommendation model to obtain a target recommended song list, the method includes: training the initial model according to training samples to obtain training results; the training samples include multiple sample played song vectors and multiple sample recommended song vectors corresponding to sample users; iteratively adjusting the initial model according to the training results and a target loss function to obtain the song recommendation model; the target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
[0010] In an optional manner, the initial model is iteratively adjusted according to the training results and the target loss function to obtain the song recommendation model, including: calculating the maximum cosine value between each sample user interest vector of the sample user; adding the maximum cosine value between each sample user interest vector to obtain the distance loss between different sample user interest vectors of the sample user.
[0011] In an optional manner, each sample recommended song vector corresponds to a sample user interest vector; each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module.
[0012] In an optional manner, the user interest vectors output by each SE module are respectively matched with the list of songs to be recommended to obtain the target recommended song list, including: calculating the similarity between each user interest vector and the vector of the song to be recommended in the list of songs to be recommended, and obtaining the target recommended songs that are most similar to each user interest vector and the corresponding similarity values; and sorting the target recommended songs according to the similarity values to obtain the target recommended song list.
[0013] According to another aspect of an embodiment of the present invention, a recommendation device based on multiple interests of a user is provided, comprising:
[0014] An acquisition module, used to acquire song vectors of each played song in a target user's song playlist;
[0015] A recommendation module, used for inputting the song vectors of each of the played songs into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used for determining a weight vector of each of the song vectors for user interest, and calculating a user interest vector based on the weight vector and the song vectors of each of the played songs; the recommendation module is used for performing similarity matching between the user interest vectors output by each of the SE modules and the song list to be recommended to obtain the target recommended song list.
[0016] In an optional manner, the weight vector of each song vector for user interest is determined, and the user interest vector is obtained based on the weight vector and the calculation, including: connecting each song vector end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each song vector.
[0017] According to another aspect of an embodiment of the present invention, there is provided a computer device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0018] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute the operation of the recommendation method based on multiple interests of the user.
[0019] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and when the executable instruction is executed on a computer device, the computer device executes the operation of the recommendation method based on multiple interests of the user.
[0020] The embodiment of the present invention obtains the song vectors of each played song in the target user's song playlist, and inputs the song vectors of each played song into the song recommendation model to obtain a target recommended song list. The song recommendation model includes a recommendation module and at least one SE module; the SE module is used to determine the weight vector of each song vector for user interest, and calculate the user interest vector based on the weight vector and the song vector of each played song; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list. In this way, the accuracy of song recommendation can be effectively improved.
[0021] The above description is only an overview of the technical solution of the embodiment of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0023] Figure 1 A schematic diagram of a flow chart of a recommendation method based on user's multiple interests provided by an embodiment of the present invention is shown;
[0024] Figure 2 A schematic diagram showing the structure of the SE module in the recommendation method based on user multiple interests provided by an embodiment of the present invention;
[0025] Figure 3 A structural schematic diagram of song recommendation model training in a recommendation method based on user's multiple interests provided by an embodiment of the present invention is shown;
[0026] Figure 4 A schematic diagram showing the structure of a recommendation device based on user's multiple interests provided by an embodiment of the present invention;
[0027] Figure 5 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0028] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0029] Figure 1The flowchart of the recommendation method based on user's multiple interests provided by the embodiment of the present invention is shown, and the method is executed by a computer device. The computer device can be a personal computer, a desktop computer, a tablet computer, a smart terminal, a multimedia player, etc., and the embodiment of the present invention does not make specific restrictions. Figure 1 As shown, the method comprises the following steps:
[0030] Step 110: Obtain the song vector of each played song in the target user's song playlist.
[0031] Among them, in the embodiment of the present invention, the song play list of the target user is first obtained, and the song play list is converted into a vector list, and the vector list includes the song vectors of each played song.
[0032] Step 120: Input the song vectors of each played song into a song recommendation model to obtain a target recommended song list.
[0033] Among them, the embodiment of the present invention pre-extracts song features of multiple songs to be recommended, and obtains song vectors to be recommended of multiple songs to be recommended. The song vectors of the played songs are matched with the song vectors to be recommended through the song recommendation model, so as to obtain a target recommended song list. Specifically, each of the user interest vectors is respectively calculated for similarity with the vectors of the songs to be recommended in the song list to be recommended, and the target recommended songs most similar to each of the user interest vectors and the corresponding similarity values are respectively obtained; according to the similarity values, the target recommended songs are sorted to obtain the target recommended song list.
[0034] In an embodiment of the present invention, the song recommendation model includes a recommendation module and at least one SE module, and also includes a shared user tower and an item tower. Among them, the double tower model composed of the shared user tower and the item tower respectively embeds the "user features" and "song features" using a complex network. Before the last cross layer, there is no interaction between the user features and the song features, which forms two independent "towers", so it is called a double tower model. After the training of the double tower model is completed, the final user embedding and song embedding can be stored in the memory database. The model structure on the song side is called an "item tower". Then, the role of the "item tower" is essentially to receive the feature vector related to the item, and finally generate a multi-dimensional dense vector through the multi-layer neural network structure in the "item tower". The user tower receives the feature vector related to the user and finally generates a multi-dimensional dense vector. After the song vector of the played song is processed by the SE module, multiple user interest vectors are obtained, and the multiple user interest vectors are input into the shared user tower to obtain multiple user vectors, which are matched with the song vectors to be recommended in the item tower to obtain a target song recommendation list.
[0035] like Figure 2 As shown, in an embodiment of the present invention, the SE module includes a feature cross model and a softmax function. Among them, the SE module determines the weight vector of each song vector for user interest, and calculates the user interest vector based on the weight vector and the song vector of each played song. Specifically, each song vector is connected end to end to obtain a first multidimensional vector, the first multidimensional vector is input into the feature cross model to obtain a second multidimensional vector, the second multidimensional vector is normalized to obtain a weight vector; based on the weight vector and each song vector, the user interest vector is calculated.
[0036] Specifically: the d-dimensional song vector {v i |1≤i≤n} are connected end to end to obtain a first multidimensional vector v of n*d dimensions. The d dimensions can respectively represent the features of the d dimensions of the played song, such as the style, song type, singer, lyricist, etc., which are not specifically limited in the embodiment of the present invention. The first multidimensional vector v is input into the feature cross model to output a second multidimensional vector s=[s1,s2…s n ] T The feature crossover model is used to cross the features of different played songs, so that the features of each played song can be associated and combined. The feature crossover model can be a DNN neural network. The second multidimensional vector s is transformed by the softmax function to obtain a weight vector w = [w1, w2…w n ] T , where w1+w2+…+w n = 1, the weight vector w can be regarded as a set of n weight values, that is, {w i |1≤i≤n}. That is, in this way, the contribution of each played song to a certain interest of the target user can be determined. i |1≤i≤n} is regarded as the song vector {v i |1≤i≤n}, and perform weighted sum calculation on the song vector to obtain the user interest vector u, that is:
[0037]
[0038] Among them, the initial parameters of each SE model are different, so through training, SE models for extracting different interests can be obtained respectively. Different SE modules are used to extract different user interests. When it is necessary to extract k interests of a user, k SE models need to be set. Each SE module is responsible for extracting a certain aspect of the user's interest. If you want to extract k aspects of the user's interest, you can use k different SE modules at the same time, acting on the same user playback sequence respectively. The working principle of the SE module is actually to first calculate the contribution of each playback behavior in the user sequence to a certain aspect of the user's interest; sharpen the contribution degree through the softmax function, that is, make the large larger and the small smaller; then use these contribution degrees as weights to multiply the original playback behavior vector and sum them to obtain the final user interest vector, which plays a role in amplifying important behaviors and filtering invalid behaviors; for different interests of the same user, the importance of the same playback behavior may vary greatly; the essence of the SE module is a filter, and its function is to filter out low-value playback behaviors in the user's playback sequence for different interests of the same user, and only retain behaviors with high value in this aspect of interest. For different interests of users, different behaviors are filtered out, and the extraction of different user interests comes from different playback subsequences.
[0039] In the embodiment of the present invention, before inputting the song vectors of each played song into the song recommendation model to obtain the target recommended song list, the song recommendation model is also pre-trained. The training process includes: training the initial model according to the training samples to obtain the training results; the training samples include a plurality of sample played song vectors and a plurality of sample recommended song vectors corresponding to the sample users; iteratively adjusting the initial model according to the training results and the target loss function to obtain the song recommendation model. Figure 3 As shown, during training, the song vectors of n played songs are respectively passed through k SE modules to obtain k user interest vectors, and the multiple user interest vectors are input into the shared user tower to obtain k user vectors. In the embodiment of the present invention, for training in the song recommendation model, the target loss function is calculated through the "selection gate" structure to determine the parameters of each SE module and the parameters of the recommendation module. The target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
[0040] Among them, the target loss function of the song recommendation model is defined as follows:
[0041] Loss total =Loss main +α*Loss dis
[0042] The loss between the sample user interest vector and the sample recommended song vector is calculated in the form of cross entropy. The maximum value of the cosine value between the user vector and the sample recommended song vector is calculated by the following formula. i |1≤i≤k}, select a vector with the highest similarity score (cosine value) with the song vector IE as the final user vector UE:
[0043] UE=G({UE i |1≤i≤k})=UE j |j=argmax{cos(UE i ,IE)|1≤i≤k}
[0044] Each sample recommended song vector corresponds to a sample user interest vector; each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module. According to the above formula, the user vector corresponding to each SE module can be determined, thereby determining the parameters of the SE module and the recommendation module.
[0045] In order to make different interests of the same user sufficiently different, it is hoped that the distance between different interest vectors of the same user can be as large as possible while minimizing the original model loss; therefore, the embodiment of the present invention introduces an auxiliary distance loss to calculate the distance loss between multiple sample user interest vectors of the sample user, including: calculating the maximum cosine value between each sample user interest vector of the sample user; adding the maximum cosine value between each sample user interest vector to obtain the distance loss between different sample user interest vectors of the sample user. The specific formula is:
[0046]
[0047] The meaning of this distance loss is: the different interest vectors of each user (u) contained in the batch (B) samples The sum of the maximum cosine values (minimum distances) between the interest vectors of each user in the model is made as large as possible. The distance loss optimization goal introduced is to maximize the minimum distance between user interest vectors rather than the average distance, in order to prevent the situation where some interests of the same user are very close, while some are very far apart; maximizing the minimum distance can make the distances between different interest vectors more balanced.
[0048] The embodiment of the present invention obtains the song vectors of each played song in the target user's song playlist, and inputs the song vectors of each played song into the song recommendation model to obtain a target recommended song list. The song recommendation model includes at least one SE module and a recommendation module; the SE module is used to determine the weight vector of each song vector for user interest, and calculate the user interest vector based on the weight vector and the song vector of each played song; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list. In this way, the accuracy of song recommendation can be effectively improved.
[0049] Figure 4 FIG. 1 shows a schematic diagram of a structure of a recommendation device based on user's multiple interests provided by an embodiment of the present invention. Figure 4 As shown, the device 300 includes:
[0050] An acquisition module 310 is used to acquire a song vector of each played song in a song playlist of a target user;
[0051] The recommendation module 320 is used to input the song vectors of each played song into the song recommendation model to obtain a target recommended song list; the song recommendation model includes at least one SE module and a recommendation module; the SE module is used to determine the weight vector of each song vector for user interest, and obtain the user interest vector based on the weight vector and the calculation; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list.
[0052] In an optional manner, the weight vector of each song vector for user interest is determined, and the user interest vector is obtained based on the weight vector and the calculation, including: connecting each song vector end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each song vector.
[0053] In an optional manner, before inputting the song vectors of each played song into the song recommendation model to obtain a target recommended song list, the method includes: training the initial model according to training samples to obtain training results; the training samples include multiple sample played song vectors and multiple sample recommended song vectors corresponding to sample users; iteratively adjusting the initial model according to the training results and a target loss function to obtain the song recommendation model; the target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
[0054] In an optional manner, the initial model is iteratively adjusted according to the training results and the target loss function to obtain the song recommendation model, including: calculating the maximum cosine value between each sample user interest vector of the sample user; adding the maximum cosine value between each sample user interest vector to obtain the distance loss between different sample user interest vectors of the sample user.
[0055] In an optional manner, each sample recommended song vector corresponds to a sample user interest vector; each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module.
[0056] In an optional manner, the user interest vectors output by each SE module are respectively matched with the list of songs to be recommended to obtain the target recommended song list, including: calculating the similarity between each user interest vector and the vector of the song to be recommended in the list of songs to be recommended, and obtaining the target recommended songs that are most similar to each user interest vector and the corresponding similarity values; and sorting the target recommended songs according to the similarity values to obtain the target recommended song list.
[0057] The specific working process of the recommendation device based on user's multiple interests in the embodiment of the present invention is generally consistent with the specific method steps of the above method embodiment, and will not be repeated here.
[0058] The embodiment of the present invention obtains the song vectors of each played song in the target user's song playlist, and inputs the song vectors of each played song into the song recommendation model to obtain a target recommended song list. The song recommendation model includes at least one SE module and a recommendation module; the SE module is used to determine the weight vector of each song vector for user interest, and obtain the user interest vector based on the weight vector and the calculation; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list. In this way, the accuracy of song recommendation can be effectively improved.
[0059] Figure 5 The schematic diagram of the structure of the computer device provided by the embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.
[0060] like Figure 5 As shown, the computer device may include: a processor (processor) 402 , a communication interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0061] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned method for recommending based on multiple user interests.
[0062] Specifically, the program 410 may include program code including computer executable instructions.
[0063] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0064] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0065] The program 410 may be specifically called by the processor 402 to enable the computer device to perform the following operations:
[0066] Get the song vectors of each played song in the target user's song playlist;
[0067] The song vectors of each of the played songs are input into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used to determine the weight vector of each of the song vectors for user interest, and calculate the user interest vector based on the weight vector and the song vectors of each of the played songs; the recommendation module is used to perform similarity matching between the user interest vectors output by each of the SE modules and the song list to be recommended, to obtain the target recommended song list.
[0068] In an optional manner, the weight vector of each song vector for user interest is determined, and the user interest vector is calculated based on the weight vector and the song vectors of each played song, including: connecting each song vector end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each song vector.
[0069] In an optional manner, before inputting the song vectors of each played song into the song recommendation model to obtain a target recommended song list, the method includes: training the initial model according to training samples to obtain training results; the training samples include multiple sample played song vectors and multiple sample recommended song vectors corresponding to sample users; iteratively adjusting the initial model according to the training results and a target loss function to obtain the song recommendation model; the target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
[0070] In an optional manner, the initial model is iteratively adjusted according to the training results and the target loss function to obtain the song recommendation model, including: calculating the maximum cosine value between each sample user interest vector of the sample user; adding the maximum cosine value between each sample user interest vector to obtain the distance loss between different sample user interest vectors of the sample user.
[0071] In an optional manner, each sample recommended song vector corresponds to a sample user interest vector; each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module.
[0072] In an optional manner, the user interest vectors output by each SE module are respectively matched with the list of songs to be recommended to obtain the target recommended song list, including: calculating the similarity between each user interest vector and the vector of the song to be recommended in the list of songs to be recommended, and obtaining the target recommended songs that are most similar to each user interest vector and the corresponding similarity values; and sorting the target recommended songs according to the similarity values to obtain the target recommended song list.
[0073] The embodiment of the present invention obtains the song vectors of each played song in the target user's song playlist, and inputs the song vectors of each played song into the song recommendation model to obtain a target recommended song list. The song recommendation model includes at least one SE module and a recommendation module; the SE module is used to determine the weight vector of each song vector for user interest, and obtain the user interest vector based on the weight vector and the calculation; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list. In this way, the accuracy of song recommendation can be effectively improved.
[0074] An embodiment of the present invention provides a computer-readable storage medium storing at least one executable instruction. When the executable instruction is executed on a computer device, the computer device executes the recommendation method based on user multiple interests in any of the above method embodiments.
[0075] The executable instructions can be specifically used to cause the computer device to perform the following operations:
[0076] Get the song vectors of each played song in the target user's song playlist;
[0077] The song vectors of each of the played songs are input into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used to determine the weight vector of each of the song vectors for user interest, and calculate the user interest vector based on the weight vector and the song vectors of each of the played songs; the recommendation module is used to perform similarity matching between the user interest vectors output by each of the SE modules and the song list to be recommended, to obtain the target recommended song list.
[0078] In an optional manner, the weight vector of each song vector for user interest is determined, and the user interest vector is calculated based on the weight vector and the song vectors of each played song, including: connecting each song vector end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each song vector.
[0079] In an optional manner, before inputting the song vectors of each played song into the song recommendation model to obtain a target recommended song list, the method includes: training the initial model according to training samples to obtain training results; the training samples include multiple sample played song vectors and multiple sample recommended song vectors corresponding to sample users; iteratively adjusting the initial model according to the training results and a target loss function to obtain the song recommendation model; the target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
[0080] In an optional manner, the initial model is iteratively adjusted according to the training results and the target loss function to obtain the song recommendation model, including: calculating the maximum cosine value between each sample user interest vector of the sample user; adding the maximum cosine value between each sample user interest vector to obtain the distance loss between different sample user interest vectors of the sample user.
[0081] In an optional manner, each sample recommended song vector corresponds to a sample user interest vector; each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module.
[0082] In an optional manner, the user interest vectors output by each SE module are respectively matched with the list of songs to be recommended to obtain the target recommended song list, including: calculating the similarity between each user interest vector and the vector of the song to be recommended in the list of songs to be recommended, and obtaining the target recommended songs that are most similar to each user interest vector and the corresponding similarity values; and sorting the target recommended songs according to the similarity values to obtain the target recommended song list.
[0083] The embodiment of the present invention obtains the song vectors of each played song in the target user's song playlist, and inputs the song vectors of each played song into the song recommendation model to obtain a target recommended song list. The song recommendation model includes at least one SE module and a recommendation module; the SE module is used to determine the weight vector of each song vector for user interest, and obtain the user interest vector based on the weight vector and the calculation; the recommendation module is used to perform similarity matching between the user interest vectors output by each SE module and the song list to be recommended, to obtain the target recommended song list. In this way, the accuracy of song recommendation can be effectively improved.
[0084] An embodiment of the present invention provides a recommendation device based on multiple interests of a user, which is used to execute the above-mentioned recommendation method based on multiple interests of a user.
[0085] An embodiment of the present invention provides a computer program, which can be called by a processor to enable a computer device to execute the recommendation method based on multiple interests of a user in any of the above method embodiments.
[0086] An embodiment of the present invention provides a computer program product, which includes a computer program stored on a computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed on a computer, the computer executes the recommendation method based on user multiple interests in any of the above method embodiments.
[0087] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0088] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0089] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be interpreted as reflecting an intention that the claimed invention requires more features than those expressly recited in each claim.
[0090] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0091] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A recommendation method based on user's multiple interests, characterized in that: The method comprises: Get the song vectors of each played song in the target user's song playlist; The song vectors of each of the played songs are input into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used to determine the weight vector of each of the song vectors for user interest, and calculate the user interest vector based on the weight vector and the song vectors of each of the played songs; the recommendation module is used to perform similarity matching on the user interest vectors output by each of the SE modules with the song list to be recommended, to obtain the target recommended song list; wherein, determining the weight vector of each of the song vectors for user interest, and calculating the user interest vector based on the weight vector and the song vectors of each of the played songs, includes: connecting each of the song vectors end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each of the song vectors.
2. The method according to claim 1, characterized in that Before inputting the song vectors of each of the played songs into the song recommendation model to obtain a target recommended song list, the method includes: The initial model is trained according to the training samples to obtain training results; the training samples include a plurality of sample played song vectors and a plurality of sample recommended song vectors corresponding to the sample users; The initial model is iteratively adjusted according to the training results and the target loss function to obtain the song recommendation model; the target loss function includes the loss between the sample user interest vector and the sample recommended song vector and the distance loss between multiple sample user interest vectors of the sample user.
3. The method according to claim 2, characterized in that The iterative adjustment of the initial model according to the training result and the target loss function to obtain the song recommendation model includes: Calculating the maximum cosine value between the sample user interest vectors of the sample users; The maximum cosine values between the interest vectors of each sample user are added together to obtain the distance loss between different sample user interest vectors of the sample user.
4. The method according to claim 2, characterized in that: Each sample recommended song vector corresponds to a sample user interest vector; Each SE module is iteratively trained according to the sample recommended song vector and the corresponding sample user interest vector to obtain the trained SE module.
5. The method according to claim 1, characterized in that: The user interest vectors output by each SE module are matched with the list of songs to be recommended respectively to obtain the target recommended song list, including: Calculate the similarity between each user interest vector and the vectors of the songs to be recommended in the list of songs to be recommended, and obtain the target recommended songs most similar to each user interest vector and the corresponding similarity values; According to the similarity value, each target recommended song is sorted to obtain the target recommended song list.
6. A recommendation device based on user's multiple interests, characterized in that: The device comprises: An acquisition module, used to acquire song vectors of each played song in a target user's song playlist; A recommendation module, used for inputting the song vectors of each of the played songs into a song recommendation model to obtain a target recommended song list; the song recommendation model includes a recommendation module and at least one SE module; the SE module is used for determining the weight vector of each of the song vectors for user interest, and calculating the user interest vector based on the weight vector and the song vectors of each of the played songs; the recommendation module is used for performing similarity matching between the user interest vectors output by each of the SE modules and the song list to be recommended, to obtain the target recommended song list; wherein, determining the weight vector of each of the song vectors for user interest, and calculating the user interest vector based on the weight vector and the song vectors of each of the played songs, includes: connecting each of the song vectors end to end to obtain a first multidimensional vector; inputting the first multidimensional vector into a feature cross model to obtain a second multidimensional vector; normalizing the second multidimensional vector to obtain a weight vector; and calculating the user interest vector based on the weight vector and each of the song vectors.
7. A computer device, characterized in that: include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform the operation of the recommendation method based on user multiple interests as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction, and when the executable instruction is executed on a computer device, the computer device executes the operation of the recommendation method based on user multiple interests as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Song list recommendation method and device and storage medium
CN108984731A
Music recommendation method, apparatus and computer device
CN109299316A