Song recommendation method, device, electronic device and readable storage medium

By calculating the orchestration encoding similarity of historical songs and candidate songs, the recommended songs with high orchestration similarity are solved, and the recommendation inaccuracy caused by coarse label size and incomplete coverage in the prior art is improved, and the accuracy of song recommendations is improved.

CN112667845BActive Publication Date: 2024-11-15TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202011539915.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-23
Publication Date
2024-11-15
Estimated Expiration
2040-12-23

AI Technical Summary

Technical Problem

The existing song recommendation algorithm has low recommendation accuracy due to the coarse label size and incomplete coverage, and cannot accurately recommend the music users want.

Method used

By obtaining the orchestration encoding of historical songs and calculating the similarity with the encoding in the candidate song library, we recommend songs whose orchestration similarity is greater than the preset value, expanding the recommendation range and avoiding dependence on labels.

Benefits of technology

It improves the accuracy of song recommendations, includes the recommendation range of unlabeled songs, and solves the problems of coarse label size and incomplete coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112667845B_ABST
    Figure CN112667845B_ABST
Patent Text Reader

Abstract

The present application discloses a song recommendation method, apparatus, device and computer-readable storage medium, the method comprising: obtaining historical songs, and inputting the historical songs into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical songs; inputting the first instrumentation coding and multiple second instrumentation codings in a candidate song library into a similarity calculation model to obtain instrumentation similarity, wherein each second instrumentation coding corresponds to a candidate song; recommending candidate songs whose instrumentation similarity is greater than a preset similarity to a user; the method does not require specific labels as a basis for judging whether to make a recommendation, thereby expanding the scope of song recommendation, i.e., incorporating candidate songs without corresponding labels into the scope of recommendation screening, and at the same time, making recommendation judgments based on the similarity of the instrumentation coding can improve the accuracy of song recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio processing technology, and in particular to a song recommendation method, an electronic device, and a computer-readable storage medium. Background Art

[0002] The song recommendation algorithm is used to analyze the user's preferences and recommend music that meets the algorithm to improve the user's experience. Related technologies usually use tags such as the genre of each music in the user's play history to analyze the user's preferences, and recommend songs with the same tags to the user based on the user's preferences. However, due to the coarse granularity of the tags, they are not accurate enough; and the tags are not fully covered, not all music has tags, so the accuracy of the recommendation method based on tags based on related technologies is low. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a song recommendation method, an electronic device and a computer-readable storage medium to improve the accuracy of song recommendations.

[0004] In order to solve the above technical problems, in the first aspect, the present application provides a song recommendation method, comprising:

[0005] Acquire a historical song, and input the historical song into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical song;

[0006] Inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity, wherein each of the second instrumentation codes corresponds to a candidate song;

[0007] The candidate songs whose instrumentation similarity is greater than a preset similarity are recommended to the user.

[0008] In one embodiment, the generation process of the instrument encoding model includes:

[0009] Acquire training spectrum features, and perform feature compression encoding on the training spectrum features using an initial encoding model to obtain a first training code;

[0010] Using an initial restoration model to restore the first training code to obtain a second training code;

[0011] Calculating a loss value between the training spectrum feature and the second training code, and adjusting the initial encoding model and the initial restoration model according to the loss value to obtain an encoding model and a restoration model;

[0012] The encoding model is determined as the orchestration encoding model.

[0013] In one embodiment, the generation process of the instrument encoding model includes:

[0014] Acquire a plurality of initial training song segments of different genres, and segment each of the initial training song segments to obtain a plurality of training song segments;

[0015] Obtain any two training song segments of the same genre to form positive training data;

[0016] Obtain the training song segments corresponding to any two different genres to form reverse training data;

[0017] The forward training data and the reverse training data are used to form the training set, and the initial coding model is trained using the training set to obtain the instrument coding model.

[0018] In one implementation, the generation process of the similarity calculation model includes:

[0019] Acquire a plurality of first training instrument codes and a plurality of second training instrument codes; the first training instrument code corresponds to a first user, the second training instrument code corresponds to a second user, and the instrument codes of historical songs corresponding to the first user and the second user are different;

[0020] Using any two first training instrument codes and any two second training instrument codes to form forward similarity training data;

[0021] Using any first training instrument code and any second training instrument code to form reverse similarity training data;

[0022] The initial calculation model is trained using the forward similarity training data and the reverse similarity training data to obtain the similarity calculation model.

[0023] In one implementation, the step of inputting the historical song into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical song includes:

[0024] Segmenting the historical song to obtain a plurality of historical song segments;

[0025] Input each of the historical song segments into the instrumentation coding model to obtain a corresponding plurality of first instrumentation codes;

[0026] Correspondingly, the step of inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity includes:

[0027] Inputting all the first instrument codes and a plurality of the second instrument codes into the similarity calculation model to obtain instrument sub-similarity between each of the first instrument codes and each of the second instrument codes;

[0028] The instrument sub-similarity between each of the first instrument codes and the target instrument code is averaged to obtain the instrument similarity between the first instrument code and the target instrument code; the target instrument code is any one of the plurality of the second instrument codes.

[0029] In one embodiment, the averaging operation is performed using the instrument sub-similarity between each of the first instrument codes and the target instrument code to obtain the instrument similarity between the first instrument code and the target instrument code, including:

[0030] Obtain the historical play counts corresponding to each of the historical song segments, and perform a division operation using the historical play counts and the total play counts corresponding to the historical songs to obtain a weight value corresponding to each of the historical song segments;

[0031] The weight value and the instrument sub-similarity are used to perform a weighted average operation to obtain the instrument similarity.

[0032] In one embodiment, the segmenting of the historical songs to obtain multiple historical song segments includes:

[0033] Obtaining lyrics timestamp information corresponding to the historical songs;

[0034] The historical song is segmented based on the lyrics timestamp information to obtain a plurality of historical song segments.

[0035] In one embodiment, the segmenting of the historical songs to obtain multiple historical song segments includes:

[0036] Using the instrument recognition model to perform segmented instrument recognition on the historical songs to obtain multiple instrument recognition results;

[0037] If two adjacent musical instrument recognition results are different, the position where the musical instrument recognition result changes is determined as the segmentation position;

[0038] The historical song is segmented based on the segment positions to obtain the historical song segments.

[0039] In a second aspect, the present application further provides an electronic device, including a memory and a processor, wherein:

[0040] The memory is used to store the computer program;

[0041] The processor is used to execute the computer program to implement the above-mentioned song recommendation method.

[0042] In a third aspect, the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the above-mentioned song recommendation method when executed by a processor.

[0043] The song recommendation method provided by the present application obtains historical songs, and inputs the historical songs into an instrumentation coding model to obtain a first instrumentation code corresponding to the historical songs; the first instrumentation code and multiple second instrumentation codes in a candidate song library are input into a similarity calculation model to obtain instrumentation similarity, wherein each second instrumentation code corresponds to a candidate song; and candidate songs whose instrumentation similarity is greater than a preset similarity are recommended to users.

[0044] It can be seen that the method obtains the first instrumentation code of the historical song. The historical song is a song that the user has already listened to and can be used as a benchmark for song recommendation. The first instrumentation code can reflect the music situation of the historical song. Different instruments have different characteristics. Each type of instrument has its own unique characteristics, which makes it play a basically fixed role in the performance of the style. Therefore, music with different instruments usually belongs to different categories. When recommending songs, the second instrumentation code corresponding to multiple candidate songs can be obtained, and the first instrumentation code and the second instrumentation code are input into the similarity calculation model to obtain the instrumentation similarity between the historical song and each candidate song. The instrumentation similarity is used to indicate the similarity of the use and coordination of instruments between the candidate song and the historical song, and can characterize the similarity between the candidate song and the historical song. When the instrumentation similarity is greater than the preset similarity, it can be determined that the candidate song and the historical song are of the same category, so the candidate song with the instrumentation similarity greater than the preset similarity is recommended to the user. This method does not require specific labels as a basis for judging whether to make recommendations, which expands the scope of song recommendations, that is, candidate songs without corresponding labels are included in the scope of recommendation screening. At the same time, recommendation judgments are made based on the similarity of instrumentation encoding, which can improve the accuracy of song recommendations and solve the problem of inaccurate song recommendations caused by coarse label granularity and incomplete label coverage.

[0045] In addition, the present application also provides an electronic device and a computer-readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0047] Figure 1 A schematic diagram of a hardware composition framework applicable to a song recommendation method provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of a hardware composition framework applicable to another song recommendation method provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of a flow chart of a song recommendation method provided in an embodiment of the present application;

[0050] Figure 4 A flowchart of a specific song recommendation method provided in an embodiment of the present application;

[0051] Figure 5 A schematic diagram of a training process of an instrument encoder provided in an embodiment of the present application;

[0052] Figure 6 A structural schematic diagram of a song recommendation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] Song recommendation algorithms usually determine the user's music preferences based on the user's historical playback records. The user's music preferences are usually reflected by music tags, such as pop, folk songs, etc. This results in only songs with music tags being able to participate in song recommendations, and a large number of new or old songs do not have corresponding music tags, and need to add tags. This part of the work requires more professional knowledge and a huge workload. There may be errors in the addition of tags, and the notes themselves are a coarse-grained classification method. Even if refined tags are used, such as dividing folk songs into independent folk songs and campus folk songs, a large amount of music is still included, resulting in insufficient classification. The above-mentioned multiple reasons lead to poor recommendation accuracy in the related art, that is, it is impossible to accurately recommend the music that the user wants. In order to solve the above problems, the song recommendation algorithm provided in this application uses the first orchestration code and the second orchestration code to calculate the orchestration similarity, and uses the orchestration similarity to characterize the similarity between historical songs and candidate songs. The orchestration code can also be called an instrument feature, which is used to represent the instrument matching of music. It is understandable that users' music preferences are usually concentrated on certain styles, and different musical instruments have different characteristics. Each type of musical instrument has its own unique characteristics, which makes it play a basically fixed role in the performance of the style, such as piano music, heavy metal music, etc. By recommending candidate songs that are similar enough, that is, by recommending candidate songs whose instrumentation similarity is greater than a preset similarity, songs can be accurately recommended without setting music tags, which expands the scope of application and improves the accuracy of song recommendations.

[0055] For ease of understanding, the hardware composition framework used in the solution corresponding to the song recommendation method provided in the embodiment of the present application is first introduced. Figure 1 , Figure 1 A schematic diagram of a hardware composition framework applicable to a song recommendation method provided in an embodiment of the present application. The electronic device 100 may include a processor 101 and a memory 102, and may further include one or more of a multimedia component 103, an information input / information output (I / O) interface 104, and a communication component 105.

[0056] The processor 101 is used to control the overall operation of the electronic device 100 to complete all or part of the steps in the song recommendation method; the memory 102 is used to store various types of data to support the operation of the electronic device 100, and these data may include, for example, instructions for any application or method used to operate on the electronic device 100, and application-related data. The memory 102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. In this embodiment, the memory 102 stores at least programs and / or data for implementing the following functions:

[0057] Obtaining historical songs, and inputting the historical songs into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical songs;

[0058] Inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity, wherein each second instrumentation code corresponds to a candidate song;

[0059] Candidate songs whose instrumentation similarity is greater than a preset similarity are recommended to the user.

[0060] The multimedia component 103 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 102 or sent through the communication component 105. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 104 provides an interface between the processor 101 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 105 is used for wired or wireless communication between the electronic device 100 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 105 may include: Wi-Fi components, Bluetooth components, NFC components.

[0061] The electronic device 100 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the song recommendation method.

[0062] certainly, Figure 1 The structure of the electronic device 100 shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device 100 may include Figure 1 More or fewer components than shown, or combinations of certain components.

[0063] in, Figure 1The electronic device 100 may be a terminal (such as a mobile terminal such as a mobile phone, a tablet computer, or a fixed terminal such as a PC) or a server. In a specific implementation, the electronic device 100 may use the communication component 105 to receive historical songs sent by other devices or terminals through the network; in another specific implementation, the electronic device 100 may use the multimedia component 103 to obtain input historical songs; in another specific implementation, the electronic device 100 may obtain input historical songs from the memory 102.

[0064] It is understandable that the number of electronic devices is not limited in the embodiments of the present application, and multiple electronic devices may work together to complete the song recommendation method. Figure 2 , Figure 2 A schematic diagram of a hardware composition framework applicable to another song recommendation method provided in an embodiment of the present application. Figure 2 It can be known that the hardware composition framework may include: a first electronic device 11 and a second electronic device 12 , which are connected via a network 13 .

[0065] In the embodiment of the present application, the hardware structure of the first electronic device 11 and the second electronic device 12 can refer to Figure 1 In the electronic device 100. That is, it can be understood that there are two electronic devices 100 in this embodiment, and the two exchange data to realize the function of song recommendation. Further, the form of the network 13 is not limited in the embodiment of the present application, that is, the network 13 can be a wireless network (such as WIFI, Bluetooth, etc.) or a wired network.

[0066] Among them, the first electronic device 11 and the second electronic device 12 can be the same electronic device, such as the first electronic device 11 and the second electronic device 12 are both servers; or they can be different types of electronic devices, for example, the first electronic device 11 can be a terminal or an intelligent electronic device, and the second electronic device 12 can be a server. In a possible implementation, a server with strong computing power can be used as the second electronic device 12 to improve data processing efficiency and reliability, thereby improving the processing efficiency of song recommendation. At the same time, a terminal or an intelligent electronic device with low cost and wide application range is used as the first electronic device 11 to realize the interaction between the second electronic device 12 and the user. The interaction process can be: the terminal is used to determine the historical songs, and send the historical songs or the information corresponding to the historical songs to the server, the server obtains the first instrument code based on the historical songs or the information corresponding to the historical songs, and further screens the candidate songs waiting to be recommended, and sends the candidate songs or the information corresponding to the candidate songs to the terminal, and completes the recommendation of the candidate songs through the terminal.

[0067] Based on the above description, please refer to Figure 3, Figure 3 A flowchart of a song recommendation method provided in an embodiment of the present application. The method in this embodiment includes:

[0068] S101: Acquire historical songs, and input the historical songs into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical songs.

[0069] The historical songs are the reference music, that is, the music that can represent the user's preference. The number of historical songs can be one or more, but it should be noted that each historical song has a corresponding first instrumentation code, and the first instrumentation codes of each historical song are different. This embodiment does not limit the specific way of obtaining historical songs. For example, in a specific implementation, historical song designation information can be obtained, and the historical songs can be determined based on it. The historical song designation information can be set in advance, for example, it can be preset and stored by the user, for example, the latest played song is designated as the historical song, and the historical song designation information corresponds to the user identity information one by one. When it is necessary to obtain the historical song designation information, the user identity information can be obtained, and the historical song designation information is obtained according to the user identity information. The specific content of the user identity information is not limited, for example, it can be a user ID, or it can be a user name, or it can be a user portrait. The historical song designation information can also be generated in real time, for example, the instruction input by the user can be detected, and the corresponding historical song designation information is generated according to the instruction. The instruction can be in the form of text, voice, gesture, etc., for example, the song with the largest number of historical plays can be designated as the historical song, or the ten most recently played songs can be designated as the historical songs.

[0070] This embodiment does not limit the specific form of historical songs. It can be a complete piece of music, or it can be a song fragment, such as a fragment corresponding to the climax of a song, or a fragment corresponding to the beginning of a song. The triggering condition for the operation of obtaining historical songs is not limited. For example, it is determined that historical songs need to be obtained when a personalized recommendation instruction is detected, or it can be determined that historical songs need to be obtained when a song list generation instruction is detected, or it can be determined that historical songs need to be obtained when a search instruction is detected. The above three instructions (i.e., personalized recommendation instructions, song list generation instructions, and search instructions) can be sent by other devices or terminals, or can be generated locally. For example, the user's gesture operation can be detected, and corresponding instructions can be generated according to the gesture operation, or when the electronic device is a server, the instructions sent by the terminal can be obtained.

[0071] The first instrumentation code corresponds to the historical song, and is generated using the instrumentation code model. The instrumentation code model is used to encode the instrumentation of the historical song. The specific type of the model can be selected as needed. In one embodiment, the historical song can be processed using an existing instrument recognition model, and the input features of the classification layer are determined as the instrumentation code. The instrument recognition model is an existing model and can be directly adopted, but it has a strong recognition ability for a single instrument and a weak recognition ability for a combination of multiple instruments. Therefore, in order to improve the accuracy of the instrumentation code, in another embodiment, whether the training data has the same instrumentation code can be used as a label to form a training set, and the training set is used for training to obtain a corresponding classification model, and the input features of the classification layer in the classification model are used as the instrumentation code. The specific type of the first instrumentation code is not limited. For example, it can be generated based on spectral features, so the type is a spectral feature type, and its format can also be set as needed, for example, it can be a fixed-length vector.

[0072] S102: Input the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity.

[0073] It should be noted that each of the second instrumentation codes corresponds to a candidate song. The candidate song is a non-historical song, which can be any music participating in the song recommendation, and the specific number is usually multiple, that is, it is possible to detect whether multiple candidate songs can be recommended at the same time. It is understandable that a candidate song can be a complete song or a partial fragment of a song. In one embodiment, the candidate song can be any non-historical song. In another embodiment, a candidate tag can be set, and the candidate song can be any non-historical song with a candidate tag. The candidate tag can be used to indicate whether to participate in the song recommendation. For example, at the beginning, all music has a candidate tag. When a piece of music is collected by a user, the candidate tag corresponding to the music is removed; or when a piece of music has been played by a user, the candidate tag corresponding to the music is removed. Each candidate music has a corresponding second instrumentation code, and the second instrumentation code is also obtained using the instrumentation coding model. The second instrumentation code is stored in the candidate song library and can be directly called when making song recommendations. It should be noted that the format and actual meaning of the second instrumentation code are the same as the first instrumentation code, that is, the same instrumentation coding model must be used to extract the first instrumentation code and the second instrumentation code.

[0074] After obtaining the first instrument code and the second instrument code, they can be used as a similarity calculation model to obtain the instrument similarity between the first instrument feature and each second instrument feature. Since the first instrument code and the second instrument code respectively characterize the instrumentation of the historical song and the candidate song, the instrument similarity is also the degree of similarity between the historical song and the candidate song in terms of instrumentation. The specific calculation method of the instrument similarity is not limited. For example, in one embodiment, the similarity calculation model can be constructed using an existing algorithm. For example, it can calculate the vector distance between the first instrument code and the second instrument code, and use the vector distance to obtain the instrument similarity. The vector distance can be processed to obtain the instrument similarity or directly determined as the instrument similarity. Or in another embodiment, the first instrument code and the second instrument code can be processed using a trained similarity calculation model to obtain the corresponding instrument similarity, that is, the input of the model is two instrument codes, and the output is the corresponding instrument similarity.

[0075] S103: Recommend candidate songs whose instrumentation similarity is greater than a preset similarity to the user.

[0076] After the instrumentation similarity is obtained, it is compared with the preset similarity, and based on the size relationship between the two, it is determined whether to recommend the candidate song. If the instrumentation similarity is greater than the preset similarity, it means that the candidate song and the historical song are very similar in instrumentation. The instrumentation can express the music style, and the user's preferred music style is generally fixed. Therefore, the candidate song is in the style preferred by the user, and the candidate song can be recommended. This embodiment does not limit the specific recommendation method for recommending candidate songs. For example, the audio of the candidate song can be directly output, or the candidate song information corresponding to the candidate song can be output, which may include the music name, author, etc. The specific output method can be a visual output, or it can be an audio playback output.

[0077] The song recommendation method provided by the embodiment of the present application is applied to obtain the first instrumentation code of the historical song. The historical song is a song that the user has already listened to and can be used as a benchmark for song recommendation. The first instrumentation code can reflect the music arrangement of the historical song. Different instruments have different characteristics. Each type of instrument has its own unique characteristics, which makes it play a basically fixed role in the performance of the style. Therefore, music with different instruments usually belongs to different categories. When recommending songs, the second instrumentation code corresponding to multiple candidate songs can be obtained, and the first instrumentation code and the second instrumentation code are input into the similarity calculation model to obtain the instrumentation similarity between the historical song and each candidate song. The instrumentation similarity is used to indicate the similarity of the use and coordination of instruments between the candidate song and the historical song, and can characterize the similarity between the candidate song and the historical song. When the instrumentation similarity is greater than the preset similarity, it can be determined that the candidate song and the historical song are of the same category, so the candidate song with the instrumentation similarity greater than the preset similarity is recommended to the user. This method does not require specific labels as a basis for judging whether to make recommendations, which expands the scope of song recommendations, that is, candidate songs without corresponding labels are included in the scope of recommendation screening. At the same time, recommendation judgments are made based on the similarity of instrumentation encoding, which can improve the accuracy of song recommendations and solve the problem of inaccurate song recommendations caused by coarse label granularity and incomplete label coverage.

[0078] In a specific implementation, the present application embodiment provides a specific song recommendation process. Figure 4 , Figure 4 A specific song recommendation method flow chart provided for an embodiment of the present application, in this embodiment, the candidate song is the song to be determined. Considering that the corresponding instruments or instrument combinations and the matching methods of the instruments at different times in the same song may change, the user's historical songs (i.e., historical songs) and the songs to be determined can be segmented by a segment segmenter to obtain the first song segment corresponding to the user's historical songs and the second song segment corresponding to the songs to be determined, and the first and second orchestration codes are generated by a trained instrument encoder (i.e., an instrument encoding model). It should be noted that the generation timing of the first instrument encoding and the second instrument encoding can be different, that is, the second instrument encoding corresponding to each candidate music can be generated in advance and stored in the candidate song library. After obtaining the first instrument encoding, the second instrument encoding is extracted from the candidate song library, and the similarity, i.e., the instrument similarity, is calculated using a metric model, and it is determined whether to recommend the song to be determined based on the instrument similarity. The metric model is used to measure the similarity between the two instrument encodings, and the output is the similarity of the two instrument encodings. The specific architecture of the metric model is not limited, for example, a basic three-layer neural network structure can be used.

[0079] Specifically, in one implementation, the generation process of the instrument encoding model may include:

[0080] Step 11: Acquire training spectrum features, and use the initial coding model to perform feature compression coding on the training spectrum features to obtain a first training code.

[0081] Since the arrangement of a song can be reflected in the spectrum features, different arrangement situations correspond to different spectrum features. Therefore, in this embodiment, the training spectrum features can be used as training data, and feature compression coding is performed on them using the initial coding model to obtain the corresponding first training code. The process of feature compression coding is the process of extracting the instrumentation code. This embodiment does not limit the specific process of feature compression coding. For example, when the training spectrum features have 10,000 data, the first training code obtained after feature compression coding can have 100 data.

[0082] Step 12: Use the initial restoration model to restore the first training code to obtain a second training code.

[0083] The initial restoration model is used to restore the first training code to obtain the second training code, so as to determine whether more information loss is caused in the feature compression coding process. The process of code restoration corresponds to the feature compression coding, and the specific method is not limited. The second training code can be in the same form as the training spectrum feature. For example, when the training spectrum feature has 10,000 data, the second training code can also have 10,000 data.

[0084] Step 13: Calculate the loss value between the training spectrum feature and the second training code, and adjust the initial coding model and the initial restoration model according to the loss value to obtain the coding model and the restoration model.

[0085] By calculating the loss value between the training spectrum feature and the second training code, it is possible to determine how much information loss is caused in the feature compression coding process and the coding restoration process. Based on the loss value, the parameters of the initial coding model and the initial restoration model can be adjusted. After multiple iterative trainings, when the loss value is small, for example, less than the loss value threshold, the coding model and the restoration model can be obtained.

[0086] Step 14: Determine the encoding model as the instrument encoding model.

[0087] After training, it can be determined that the encoding model will not cause significant information loss when performing feature compression encoding, and can encode accurate instrumentation codes. Therefore, it can be determined as an instrumentation encoding model and used to generate the first instrumentation code and the second instrumentation code.

[0088] The training method of the instrument coding model does not need to construct a training set with forward data and reverse data, thereby improving the generation speed of the instrument coding model.

[0089] In another embodiment, the generation process of the instrument encoding model may include:

[0090] Step 21: Acquire multiple initial training song segments of different genres, and segment each initial training song segment to obtain multiple training song segments.

[0091] It should be noted that the genre in this embodiment refers to the song genre, and different song genres have different styles. Different styles usually need to be characterized by different instrumentation conditions. Therefore, it can be considered that the instrumentation codes between the initial training song segments of different genres are different. The initial training song segment is a shorter song fragment, rather than a longer whole song, so the probability of the instrumentation changing in the same initial training song segment is very low. Further segmentation is performed within the initial training song segment to divide it into multiple training song segments, and then it can be considered that the instrumentation conditions between these multiple training song segments are the same. This embodiment does not limit the specific lengths of the initial training song segment and the training song segment, for example, they can be 10 seconds and 5 seconds, respectively, or can be 15 seconds and 3 seconds, respectively.

[0092] Step 22: Obtain any two training song segments in the same genre to form positive training data.

[0093] Since the training song segments in the same genre are all part of the initial training song segments, it can be considered that their instrumentation is the same. Therefore, by arbitrarily selecting two training song segments and setting positive labels for them, a set of positive training data can be formed.

[0094] Step 23: Obtain training song segments corresponding to any two different genres to form reverse training data.

[0095] Correspondingly, a training song segment can be taken from each of any two genres, and a reverse label can be set for it to obtain reverse training data.

[0096] Step 24: Use the forward training data and the reverse training data to form a training set, and use the training set to train the initial coding model to obtain the instrument coding model.

[0097] After obtaining the forward training data and the reverse training data, they can be used to form a training set, and the training set is used to train to obtain an instrument encoding model.

[0098] The training method of the instrument coding model can obtain an accurate and effective training set, and the instrument coding model obtained by using the training set has high coding accuracy.

[0099] Furthermore, the forward training data and the reverse training data can be used to form an initial training set, and the initial training set can be cleaned using existing models such as instrument recognition models to eliminate erroneous data and obtain a training set to further improve the encoding accuracy of the orchestration encoder.

[0100] Please refer to Figure 5 , Figure 5 A schematic diagram of the training process of an instrument encoder provided in an embodiment of the present application. During training, a set of training data is obtained from the training set, including a first segment and a second segment, which are input into the instrument encoder (i.e., an instrument encoding model). The instrument encoder extracts the corresponding first spectral features and second spectral features, and uses them to obtain the corresponding first code and second code. After obtaining the first code and the second code, they are input into a classifier to determine whether the two are similar. And according to the classification result, that is, whether it is the same segment or a different segment, the instrument encoder is adjusted to complete this training, and the training of the entire instrument encoder is completed through multiple iterations.

[0101] It is understandable that, in addition to the above-mentioned training methods, other training methods can also be used to generate the instrument coding model. In another embodiment, the training data in the training set has a musical instrument label. When the classification layer and the initial instrument coding model are used for training, the training data is encoded using the initial instrument coding model, and the obtained training code is input into the classification layer for classification, and the parameters of the initial instrument coding model are adjusted according to the classification result, and the corresponding instrument coding model is obtained after the training is completed. In this case, the combination of the instrument coding model and the classifier is the instrument recognition model. In another embodiment, it is also possible to synthesize multiple music clips using a synthesizer (Synthesizer) for various instrument combinations based on MIDI (Musical Instrument Digital Interface) data, and construct a training set using the music clips, and then train the instrument coding model using the training set, and the label in the training set can be a specific instrument combination, or can be the number of the instrument combination, etc. In this case, the combination of the instrument coding model and the classifier is the instrument combination recognition model.

[0102] Based on the above embodiment, before calculating the instrument similarity, it is necessary to train the similarity calculation model. The generation process of the similarity calculation model may include:

[0103] Step 31: Obtain a plurality of first training instrument codes and a plurality of second training instrument codes.

[0104] The first training instrumentation code corresponds to the first user, and the second training instrumentation code corresponds to the second user. In this embodiment, the first user and the second user prefer different song instrumentations, which is reflected in the different historical song instrumentation codes corresponding to the first user and the second user. The first training instrumentation code may include some or all of the historical song instrumentation codes of the first user, and correspondingly, the second training instrumentation code may include some or all of the historical song instrumentation codes of the second user, so the first training instrumentation code and the second training instrumentation code are different.

[0105] Step 32: Use any two first training adapter codes or any two second training adapter codes to form forward similarity training data.

[0106] Since the listening habits of each user are usually fixed, it can be considered that the first training instrumentation codes and the second training instrumentation codes are similar. Therefore, any two first training instrumentation codes can be selected to form a set of positive similarity training data, or any two second training instrumentation codes can be selected to form a set of positive similarity training data.

[0107] Step 33: Use any first training instrument code and any second training instrument code to form reverse similarity training data.

[0108] Since the first user and the second user prefer different song arrangements, it can be determined that the first training arrangement code and the second training arrangement code are not similar. Therefore, any one of the first training arrangement codes and any one of the second training arrangement codes can be used to form a set of reverse similarity training data.

[0109] Step 34: Train the initial calculation model using the forward similarity training data and the reverse similarity training data to obtain a similarity calculation model.

[0110] After obtaining the positive similarity training data and the feedback similarity training data, the initial calculation model is trained using them, and after multiple iterations of training, a similarity calculation model can be obtained. The training data is constructed based on the first training instrument code and the second training instrument code, and the initial calculation model is trained using the training data to obtain a similarity calculation model, so that the similarity calculation model can accurately calculate the instrument similarity.

[0111] Furthermore, based on the above embodiment, in order to further improve the accuracy of recommendation, the step of inputting the historical songs into the instrumentation coding model to obtain the first instrumentation coding corresponding to the historical songs may include:

[0112] Step 41: Segment the historical songs to obtain multiple historical song segments.

[0113] In this embodiment, the historical song can be a whole piece of music, or can be a longer song segment, such as a song segment with a duration greater than a preset duration. This embodiment does not limit the specific method of segmentation processing, for example, it can be segmented according to a preset time interval.

[0114] Step 42: Input each historical song segment into the instrumentation coding model to obtain corresponding multiple first instrumentation codes.

[0115] In this embodiment, the historical song can be a whole piece of music, or it can be a longer song segment. Since the length of the historical song is long, the orchestration coding will inevitably cause information loss. The longer the historical song, the more information is lost, and the worse the accuracy of the first orchestration coding is. Therefore, in order to ensure the accuracy of the recommendation, the historical song can be segmented to obtain multiple historical song segments, and the first orchestration feature corresponding to each historical song segment can be obtained. The first orchestration feature only performs orchestration coding on the shorter historical song segments, and the information loss is less, so an accurate first orchestration coding can be obtained, so as to accurately determine whether to recommend the candidate song in the subsequent step.

[0116] Accordingly, the step of inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into the similarity calculation model to obtain the instrumentation similarity may include:

[0117] Step 43: inputting all first instrument codes and multiple second instrument codes into a similarity calculation model to obtain instrument sub-similarity between each first instrument code and each second instrument code;

[0118] In this embodiment, the number of first instrumentation codes is multiple, the number of candidate songs is multiple, and therefore the number of second instrumentation codes is also multiple. After all first instrumentation codes and multiple second instrumentation codes are input into the similarity calculation model, the similarity calculation model will calculate the instrumentation sub-similarity between each first instrumentation code and each second instrumentation code. For example, when the first instrumentation features are three, namely A1, A2, and A3, and the second instrumentation features are two, namely B1 and B2, then the number of instrumentation sub-similarity is 3*2=6, namely the sub-similarity between A1 and B1, A2 and B1, A3 and B1, A1 and B2, A2 and B2, and A3 and B2.

[0119] Step 44: Perform an average operation using the instrument sub-similarity between each first instrument code and the target instrument code to obtain the instrument similarity between the first instrument code and the target instrument code.

[0120] It should be noted that the target instrumentation code is any one of a plurality of second instrumentation codes, that is, any second instrumentation code can be used as the target instrumentation code. After obtaining the instrumentation sub-similarity, the instrumentation sub-similarity between each first instrumentation code and a specified second instrumentation code (i.e., the target instrumentation code) is averaged to obtain the instrumentation similarity between the historical song and the candidate song corresponding to the target instrumentation code. It should be noted that the average operation in this embodiment is not an average value calculation, but only serves to average the values ​​of each instrumentation sub-similarity, for example, it can be a weighted average operation.

[0121] Specifically, in a specific implementation, the user may have a greater preference for the instrumentation of certain segments in the historical songs. Therefore, in order to further improve the recommendation accuracy, the instrumentation sub-similarity between each first instrumentation code and the target instrumentation code is averaged, and the process of obtaining the instrumentation similarity between the first instrumentation code and the target instrumentation code may include:

[0122] Step 51: Obtain the historical play counts corresponding to each historical song segment, and perform a division operation between the historical play counts and the total play counts corresponding to the historical songs to obtain the weight value corresponding to each historical song segment.

[0123] It is understandable that if the user prefers the instrumentation of certain segments in the historical songs, the number of times these segments are played must be greater than the number of times other segments are played. In this embodiment, after the historical songs are divided into multiple historical song segments, the number of historical plays corresponding to the historical song segments can be counted, and accordingly, the total number of plays corresponding to the historical songs can also be obtained. By dividing the two, the proportion of each historical song segment in the number of times the historical songs are played can be determined. The larger the weight value obtained, the more the user prefers the instrumentation in the historical song segment corresponding to the weight value.

[0124] Step 52: Perform a weighted average operation using the weight value and the instrument sub-similarity to obtain the instrument similarity.

[0125] After the weight value is obtained, it is used as the weight of each instrumentation sub-similarity to perform a weighted average operation to obtain the corresponding instrumentation similarity. The instrumentation similarity obtained in this way is more accurate, and more accurate song recommendations can be made.

[0126] Furthermore, in one embodiment, in order to reduce the possibility of changes in the instrumentation in each historical song segment, make the first instrumentation feature more accurate, and avoid the problem of the accuracy of the first instrumentation feature decreasing due to changes in the instrumentation, the historical songs can be segmented based on the lyrics timestamp information. The step of segmenting the historical songs to obtain multiple historical song segments may include:

[0127] Step 61: Obtain lyrics timestamp information corresponding to historical songs.

[0128] The lyrics timestamp information is used to record the start and end time of the lyrics, which can be the start and end time of each line of lyrics, or the start and end time of each word in the lyrics. The specific content of the lyrics timestamp information is not limited, for example, it can be LRC lyrics, which is the abbreviation of English lyrics and is used as the extension of the lyrics file.

[0129] Step 62: Segment the historical songs based on the lyrics timestamp information to obtain multiple historical song segments.

[0130] When music has lyrics, the instrumentation of the corresponding part in a line of lyrics is basically unlikely to change. Therefore, segmenting historical songs based on the lyrics timestamp information can further reduce the possibility of changes in the instrumentation in the historical song segments, further ensuring the accuracy of recommendations. Specifically, historical songs can be segmented according to the start and end time of each line or each two adjacent lines of lyrics, and all the music segments obtained by segmentation are used as historical song segments, or the music segments corresponding to the lyrics after segmentation can be determined as historical song segments, and the parts without lyrics can be discarded.

[0131] Furthermore, in another embodiment, the step of segmenting the historical songs to obtain a plurality of historical song segments may include:

[0132] The historical songs are segmented according to preset lengths to obtain a plurality of historical song segments.

[0133] If the music is an instrumental music without lyrics, or a vocal music without lyrics timestamp information, the historical songs can be segmented according to the preset length to obtain multiple historical song segments. The preset length is the time length, and its specific size can be set as needed, which must ensure that the time length is sufficient to fully and effectively reflect the instrumentation coding, and reduce the possibility of instrumentation changes. For example, it can be set to 10 seconds. In one embodiment, the specific size of the preset length can be determined based on the rhythm of the music. Regularly segmenting historical songs based on the preset length can avoid instrumentation changes in historical song segments as much as possible without lyrics timestamp information, thereby ensuring recommendation accuracy.

[0134] Furthermore, in another embodiment, the step of segmenting the historical songs to obtain a plurality of historical song segments may include:

[0135] Step 71: Use the instrument recognition model to perform segmented instrument recognition on historical songs to obtain multiple instrument recognition results.

[0136] The instrument recognition model can identify the instruments used in the music. When the arrangement changes, the instruments used are likely to change, such as when new instruments are added or instruments are withdrawn from the performance. Therefore, the instrument recognition model can be used to segment historical songs. It should be noted that the segmentation method when performing instrument recognition is regular and fine-grained. Therefore, when identifying, historical songs can be divided into multiple regular segments, and instrument recognition is performed on each regular segment to obtain the corresponding instrument recognition results.

[0137] Step 72: If two adjacent musical instrument recognition results are different, the position where the musical instrument recognition result changes is determined as the segmentation position.

[0138] The position where the instrument recognition result changes is the middle position of two adjacent regular segments. The obtained instrument recognition results are sorted according to the time sequence of their corresponding regular segments in the historical songs, and it is determined whether the two adjacent instrument recognition results are the same. If they are the same, it can be determined that the instrument has not changed, that is, the instrumentation has not changed. If they are not the same, it can be determined that the instrument has changed, and the instrumentation in the two regular segments is different, and the time point of the change is the connection point of the two regular segments. Therefore, the position where the instrument recognition result changes can be determined as the segmentation position for segmentation here, that is, the middle position between the two regular segments with different instrumentation situations is determined as the segmentation position, so that the two regular segments belong to two different historical song segments respectively.

[0139] Step 73: Segment the historical songs based on the segmentation positions to obtain historical song segments.

[0140] After all the segment positions are determined, the historical songs are segmented based on them to obtain historical song segments. This method can also be used to segment historical songs more accurately without relying on lyrics timestamp information.

[0141] The following is an introduction to a music recommendation device provided in an embodiment of the present application. The music recommendation device described below and the music recommendation method described above can be referenced to each other.

[0142] Please refer to Figure 6 , Figure 6 A structural diagram of a song recommendation device provided in an embodiment of the present application includes:

[0143] An acquisition module 110 is used to acquire a historical song and input the historical song into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical song;

[0144] An input module 120, for inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity, wherein each of the second instrumentation codes corresponds to a candidate song;

[0145] The recommendation module 130 is used to recommend candidate songs whose instrumentation similarity is greater than a preset similarity to the user.

[0146] Optionally include:

[0147] The encoding module is used to obtain the training spectrum features and perform feature compression encoding on the training spectrum features using the initial encoding model to obtain a first training code;

[0148] A restoration module, used for performing code restoration on the first training code by using an initial restoration model to obtain a second training code;

[0149] a loss value calculation module, used to calculate the loss value between the training spectrum feature and the second training code, and adjust the initial coding model and the initial restoration model according to the loss value to obtain a coding model and a restoration model;

[0150] A determination module is used to determine the encoding model as the instrument encoding model.

[0151] Optionally include:

[0152] A segmentation processing module, used to obtain a plurality of initial training song segments of different genres, and perform segmentation processing on each of the initial training song segments to obtain a plurality of training song segments;

[0153] A first training data building module is used to obtain any two training song segments in the same genre to form positive training data;

[0154] The second training data building module is used to obtain the training song segments corresponding to any two different genres to form reverse training data;

[0155] The training module is used to use the forward training data and the reverse training data to form the training set, and use the training set to train the initial coding model to obtain the instrument coding model.

[0156] Optionally include:

[0157] A training instrumentation code acquisition module, used to acquire a plurality of first training instrumentation codes and a plurality of second training instrumentation codes; the first training instrumentation code corresponds to a first user, the second training instrumentation code corresponds to a second user, and the historical song instrumentation codes corresponding to the first user and the second user are different;

[0158] A third training data construction module is used to form positive similarity training data using any two first training instrument codes or any two second training instrument codes;

[0159] A fourth training data construction module, used to form reverse similarity training data using any one of the first training instrument codes and any one of the second training instrument codes;

[0160] The similarity calculation model generation module is used to train the initial calculation model using the forward similarity training data and the reverse similarity training data to obtain the similarity calculation model.

[0161] Optionally, the acquisition module 110 includes:

[0162] A segmentation unit, used for segmenting the historical song to obtain a plurality of historical song segments;

[0163] An encoding unit, used for inputting each of the historical song segments into the instrumentation encoding model to obtain a corresponding plurality of first instrumentation codes;

[0164] Accordingly, the input module 120 includes:

[0165] an instrument sub-similarity calculation unit, configured to input all of the first instrument codes and a plurality of the second instrument codes into the similarity calculation model to obtain instrument sub-similarity between each of the first instrument codes and each of the second instrument codes;

[0166] An averaging operation unit is used to perform an averaging operation using the instrument sub-similarity between each of the first instrument codes and the target instrument code to obtain the instrument similarity between the first instrument code and the target instrument code; the target instrument code is any one of the multiple second instrument codes.

[0167] Optionally, the averaging operation unit includes:

[0168] A weight acquisition unit, used to acquire the historical play times corresponding to each of the historical song segments, and to divide the historical play times by the total play times corresponding to the historical songs to obtain the weight value corresponding to each of the historical song segments;

[0169] The weighted averaging unit is used to perform a weighted averaging operation using the weight value and the instrument sub-similarity to obtain the instrument similarity.

[0170] Optionally, the segmentation unit comprises:

[0171] A lyrics timestamp information acquisition subunit, used to acquire lyrics timestamp information corresponding to the historical songs;

[0172] The first segmentation subunit is used to segment the historical song based on the lyrics timestamp information to obtain a plurality of historical song segments.

[0173] Optionally, the segmentation unit comprises:

[0174] The instrument recognition subunit is used to perform segmented instrument recognition on the historical songs using the instrument recognition model to obtain multiple instrument recognition results;

[0175] A segment position determination subunit, for determining the position where the musical instrument recognition results change as the segment position if two adjacent musical instrument recognition results are different;

[0176] The second segmentation subunit is used to segment the historical song based on the segmentation position to obtain the historical song segment.

[0177] The computer-readable storage medium provided in the embodiment of the present application is introduced below. The computer-readable storage medium described below and the song recommendation method described above can be referenced to each other.

[0178] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned song recommendation method are implemented.

[0179] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0180] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0181] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0182] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0183] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms include, include or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0184] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A song recommendation method, It is characterized in that include: Acquire a historical song, and input the historical song into an instrumentation coding model to obtain a first instrumentation coding corresponding to the historical song; The first instrumentation code reflects the musical arrangement of historical songs. Different instruments have different characteristics, and music with different instruments belongs to different categories. Input the first instrumentation code and multiple second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity, wherein each second instrumentation code corresponds to a candidate song; the instrumentation similarity is used to indicate the similarity between the use and coordination of musical instruments in the candidate song and the historical song; Recommending candidate songs whose instrumentation similarity is greater than a preset similarity to the user; The step of inputting the historical song into the instrumentation coding model to obtain the first instrumentation coding corresponding to the historical song includes: segmenting the historical song to obtain a plurality of historical song segments; inputting each of the historical song segments into the instrumentation coding model to obtain a plurality of corresponding first instrumentation codings; The segmenting of the historical songs to obtain a plurality of historical song segments includes: obtaining lyrics timestamp information corresponding to the historical songs; segmenting the historical songs based on the lyrics timestamp information to obtain a plurality of historical song segments; the lyrics timestamp information is used to record the start and end time of the lyrics; segmenting the historical songs according to the start and end time of each sentence or each two adjacent sentences of the lyrics, determining the music segment corresponding to the lyrics part after segmentation as the historical song segment, and discarding the part without lyrics; Alternatively, the historical songs are segmented to obtain a plurality of historical song segments, including: performing segmented instrument recognition on the historical songs using a musical instrument recognition model to obtain a plurality of musical instrument recognition results; if two adjacent musical instrument recognition results are different, determining the position where the musical instrument recognition result changes as the segmentation position; and segmenting the historical songs based on the segmentation positions to obtain the historical song segments.

2. The song recommendation method according to claim 1, It is characterized in that The generation process of the instrument encoding model includes: Acquire training spectrum features, and perform feature compression encoding on the training spectrum features using an initial encoding model to obtain a first training code; Using an initial restoration model to restore the first training code to obtain a second training code; Calculating a loss value between the training spectrum feature and the second training code, and adjusting the initial encoding model and the initial restoration model according to the loss value to obtain an encoding model and a restoration model; The encoding model is determined as the orchestration encoding model.

3. The song recommendation method according to claim 1, It is characterized in that The generation process of the instrument encoding model includes: Acquire a plurality of initial training song segments of different genres, and segment each of the initial training song segments to obtain a plurality of training song segments; Obtain any two training song segments of the same genre to form positive training data; Obtain the training song segments corresponding to any two different genres to form reverse training data; The forward training data and the reverse training data are used to form a training set, and the training set is used to train an initial coding model to obtain the instrument coding model.

4. The song recommendation method according to claim 1, It is characterized in that The generation process of the similarity calculation model includes: Acquire a plurality of first training instrument codes and a plurality of second training instrument codes; the first training instrument code corresponds to a first user, the second training instrument code corresponds to a second user, and the instrument codes of historical songs corresponding to the first user and the second user are different; Using any two first training instrument codes and any two second training instrument codes to form forward similarity training data; Using any first training instrument code and any second training instrument code to form reverse similarity training data; The initial calculation model is trained using the forward similarity training data and the reverse similarity training data to obtain the similarity calculation model.

5. The song recommendation method according to claim 1, It is characterized in that The step of inputting the first instrumentation code and a plurality of second instrumentation codes in the candidate song library into a similarity calculation model to obtain instrumentation similarity includes: Inputting all the first instrument codes and a plurality of the second instrument codes into the similarity calculation model to obtain instrument sub-similarity between each of the first instrument codes and each of the second instrument codes; The instrument sub-similarity between each of the first instrument codes and the target instrument code is averaged to obtain the instrument similarity between the first instrument code and the target instrument code; the target instrument code is any one of the plurality of the second instrument codes.

6. The song recommendation method according to claim 5, It is characterized in that The using the instrument sub-similarity between each of the first instrument codes and the target instrument code to perform an average operation to obtain the instrument similarity between the first instrument code and the target instrument code includes: Obtain the historical play counts corresponding to each of the historical song segments, and perform a division operation using the historical play counts and the total play counts corresponding to the historical songs to obtain a weight value corresponding to each of the historical song segments; The weight value and the instrument sub-similarity are used to perform a weighted average operation to obtain the instrument similarity.

7. An electronic device, It is characterized in that comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the song recommendation method as described in any one of claims 1 to 6.

8. A computer-readable storage medium, It is characterized in that Used to store a computer program, wherein when the computer program is executed by a processor, the song recommendation method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Song audio frequency cutting apparatus and method thereof

    CN102467939A

  • Song recommendation method and system

    CN108255840A

  • Song recommending method and device and storage medium

    CN108875090A

  • Efficient method for detecting vocal starting position in song

    CN109410968A

  • Song identification method and device, storage medium and electronic equipment

    CN110675893A