Song recommendation method, electronic device, storage medium and computer program product

By using controlled randomization and multi-tower coding network training, combined with interactive behavior and scene data, the recommendation bias problem of multiple adapted versions of the same song was solved, and accurate recommendations were achieved in different scenarios.

CN121765113APending Publication Date: 2026-03-31TENCENT MUSIC ENTERTAINMENT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies struggle to dynamically adjust recommendations for multiple adapted versions of the same song based on real-time preferences of different users in different contexts such as time, location, and device.

Method used

A controlled randomization display strategy is adopted to display multiple adapted versions of a song. Training samples and their labels are constructed by combining interactive behavior data and contextual scene data of a single display event. A ranking model is trained using song feature encoding, scene feature encoding and style feature encoding networks, and the recommendation algorithm is optimized to eliminate position bias.

Benefits of technology

It achieves scene-based adaptive and accurate sorting of multiple adapted versions of the same song while eliminating positional bias, thus improving the accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765113A_ABST
    Figure CN121765113A_ABST
Patent Text Reader

Abstract

The invention discloses a song recommendation method and device, a storage medium and a computer program product. The method comprises the following steps: displaying a plurality of modified versions of a target song based on a controlled randomized display strategy; by taking the single display event as a unit, constructing a training sample and a corresponding sample tag based on the interactive behavior data for the multiple recompiled versions in the single display event and the context scene data when the single display event occurs; the audio representation of the target song, the context scene data and the reorganization style information of the reorganization version serve as input, the sample label serves as a supervision signal to train and optimize the sequencing model in the same song group to obtain a trained sequencing model in the same song group, and the trained sequencing model in the same song group is used for recommending the reorganization version of the target song. According to the method and the device, the scene data-based self-adaptive accurate recommendation is carried out on a plurality of recompiled versions of the same song.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of music information processing technology, and more specifically, to a song recommendation method, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] On music platforms, the same song often has multiple different arrangements, such as a piano version and a drum version. Music platforms need to recommend the most suitable arrangement to users in the current context. However, related technologies typically employ strategies such as displaying a fixed version or sorting based on global popularity, which makes it difficult to dynamically adjust according to the real-time preferences of different users in different contexts such as time, location, and device.

[0003] Therefore, how to accurately recommend multiple adapted versions of the same song is a technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] The purpose of this application is to provide a song recommendation method, an electronic device, a computer-readable storage medium, and a computer program product that enables adaptive and accurate recommendation based on scene data for multiple adapted versions of the same song.

[0005] To achieve the above objectives, the first aspect of this application provides a song recommendation method, comprising:

[0006] Multiple adapted versions of the target song are displayed based on a controlled randomization display strategy;

[0007] Using a single display event as a unit, training samples are constructed based on the interaction behavior data for multiple adapted versions within the single display event and the contextual scene data at the time of the single display event, and sample labels are constructed based on the interaction behavior data for the training samples; wherein, the sample labels are used to describe the relative preference information between different adapted versions of the target song;

[0008] When the number of training samples reaches a preset threshold, the audio representation of the target song, the contextual scene data, and the adaptation style information of the adapted version are input into the same song group ranking model; wherein, the same song group ranking model includes a song feature encoding network, a scene feature encoding network, and a style feature encoding network;

[0009] The song semantic representation is obtained by encoding the audio representation of the target song using the song feature encoding network, the scene semantic representation is obtained by encoding the context scene data using the scene feature encoding network, and the style semantic representation is obtained by encoding the adaptation style information using the style feature encoding network.

[0010] The semantic representations of the song, the scene, and the style are fused to obtain a fused feature, and the preference score of the adapted version is determined based on the fused feature.

[0011] A loss function is constructed based on the difference between the preference score and the sample label, and the ranking model within the same song group is trained and optimized based on the loss function to obtain a trained ranking model within the same song group. The trained ranking model within the same song group is used to recommend adapted versions of the target song.

[0012] To achieve the above objectives, a second aspect of this application provides an electronic device, comprising:

[0013] Memory, used to store computer programs;

[0014] A processor is configured to implement the steps of the song recommendation method described above when executing the computer program.

[0015] To achieve the above objectives, a third aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the song recommendation method described above.

[0016] To achieve the above objectives, a fourth aspect of this application provides a computer program product, including a computer program that, when executed, implements the steps of the song recommendation method described above.

[0017] The song recommendation method provided in this application employs a controlled randomization display strategy. In the early stages of data accumulation, multiple adapted versions of the same song are displayed randomly or in a controlled random manner, effectively breaking the inherent bias caused by default display positions. This allows for the collection of unbiased interaction data that more closely reflects users' true preferences. Based on this, training samples and their labels are constructed using single display events as units, combining interaction behavior data and contextual scene data. This enables the samples to simultaneously capture user preferences and scene adaptability. Once the training samples have accumulated to a certain scale, an in-song ranking model is trained using the target song's audio representation, contextual scene data, and adaptation style information, with sample labels as supervision signals. This allows the model to learn the relative adaptability of different adapted versions in different scenes. Finally, upon receiving a playback request for the target song, the in-song ranking model can predict the preference probability of each adapted version based on the current contextual scene data and recommend the most suitable version accordingly. Therefore, this application achieves scene-based adaptive and accurate ranking of multiple adapted versions of the same song while eliminating positional bias, thereby improving the accuracy of song version recommendations. This application also discloses an electronic device, a computer-readable storage medium, and a computer program product, which can achieve the same technical effects.

[0018] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings are used to provide a further understanding of this disclosure and constitute a part of the specification. They are used together with the following detailed description to explain this disclosure, but do not constitute a limitation of this disclosure. In the drawings:

[0020] Figure 1 A flowchart of a song recommendation method provided in an embodiment of this application;

[0021] Figure 2 A flowchart illustrating a method for constructing sample tags as provided in an embodiment of this application;

[0022] Figure 3 A flowchart illustrating a training method for a ranking model within a song group, provided in an embodiment of this application;

[0023] Figure 4 A flowchart illustrating an application method for a song group ranking model provided in this application embodiment;

[0024] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0026] This application discloses a song recommendation method that enables adaptive and accurate recommendation of multiple adapted versions of the same song based on scene data.

[0027] See Figure 1 The flowchart of a song recommendation method provided in this application embodiment is as follows: Figure 1 As shown, it includes:

[0028] S11: Display multiple adapted versions of the target song based on a controlled randomization display strategy;

[0029] In this step, a controlled randomization strategy is employed to display multiple adapted versions of the target song. That is, when showing users multiple adapted versions of the same target song, they are not arranged in a fixed order or according to static rules, but rather randomness is introduced. The randomization process parameters are recorded and controlled to ensure that the collected user interaction data can be corrected subsequently, eliminating bias caused by fixed display positions. The core purpose of this strategy is to maximize the acquisition of unbiased data that reflects users' true preferences in the early stages of data collection.

[0030] As can be seen, this step, by actively breaking the fixed display order, avoids the contamination of initial user behavior data by positional bias (i.e., users tend to click on items that are ranked higher, regardless of whether they actually prefer the content). This lays the data foundation for training a ranking model that can accurately capture the true preferences of users and scenarios.

[0031] As a feasible implementation method, multiple adapted versions of a target song are displayed based on a controlled randomization display strategy, including: displaying all adapted versions of the target song in full, or rotating different adapted versions of the target song in a uniform or controlled random manner within multiple preset front display positions.

[0032] This implementation provides two specific display modes to implement the controlled randomization strategy. The first mode is full display, which presents all available adaptations of the target song to the user at once in a single display event. For example, five different adaptations of song A are displayed side-by-side in a sliding panel on the playback page. This ensures that users see all options in a single exposure, avoiding the natural underexposure of some versions due to folding or pagination, and helps to quickly collect user feedback on each version under equal conditions. The second mode is limited rotation display, which rotates the adaptations only within a limited number of the most prominent display positions (e.g., Top-k, where k is usually 3 or 4). From all versions, k versions are selected to fill these top positions using a uniform or controlled random method. For example, if the preset top display positions are 3, for the 5 versions of song A, the system randomly selects 3 versions each time and fills these 3 positions in a random order. Unselected versions are temporarily not displayed. This method is more suitable for scenarios with limited interface space where it is impossible to display all versions at once. By rotating the top positions, different versions can be guaranteed a high exposure position, thereby collecting user interaction data under high-quality exposure positions.

[0033] It should be noted that, regardless of whether a full display or a limited rotation display is used, it is necessary to accurately record the specific position of each version being displayed, whether it is actually rendered (exposed), and the randomization strategy identifier and parameters used in this display. These records are used for subsequent propensity calculations and data correction.

[0034] As can be seen, this implementation provides a display scheme that adapts to different product interface designs, ensuring that controlled randomization can be effectively implemented in various practical application scenarios, thereby collecting effective data that can be used for bias-reduction training.

[0035] The process of rotating different adapted versions of the target song in a controlled random manner includes: swapping adapted versions in adjacent display positions with a preset probability, and / or determining the display positions of different adapted versions using sequence probability sampling or sorting sampling based on extreme value distribution according to a preset base score.

[0036] In this embodiment, two more specific technical implementations are provided for the controlled randomization method. The first technical approach is adjacent position swapping, also known as the FairPairs strategy. This strategy, given a candidate list with an initial order (which can be randomly generated or an order generated by simple rules), swaps the modified versions of two adjacent display positions with a certain preset probability (e.g., 50%). For example, if the initial order is [V1, V2, V3], the system decides with a 50% probability whether to swap the versions of positions 1 and 2. If the swap is performed, the final display order becomes [V2, V1, V3]; otherwise, [V1, V2, V3] is maintained. This method is simple to implement, has clear randomness, and is easy to record and reproduce. It can effectively break fixed orders, and the intensity of randomization can be adjusted by controlling the swap probability.

[0037] The second technique is based on probability sampling for ranking generation. This method requires pre-setting a baseline score for each candidate adaptation, which can be derived from a cold start strategy, historical average performance, or other prior knowledge. Then, based on these baseline scores, a specific random sampling algorithm is used to generate the final display order.

[0038] Random sampling algorithms can employ sequential probability sampling, such as the Plackett-Luce model. This model samples sequentially from the remaining candidate set: the probability of selecting the first position is proportional to the base score of each version; after selection, it is removed, and the second position is determined by proportional sampling based on the base scores of the remaining versions, and so on. This process introduces randomness, but the higher the base score of a version, the greater its probability of appearing in a higher position. Random sampling algorithms can also employ ranking sampling based on extreme value distributions, such as Gumbel-Top-k sampling. This method adds random noise following a Gumbel distribution to the base score of each version, then selects the k versions with the highest scores after adding noise as the display results, and sorts them according to their noise scores. It is important to note that when using these controlled randomization methods, it is necessary to fully record the original base scores before randomization, the randomization method used (rand_method), and the randomization parameters (such as the exchange probability, sampling temperature parameter tau, etc.). This information is used to subsequently calculate the probability of each version appearing in each specific position.

[0039] S12: Taking a single display event as the unit, construct training samples based on the interaction behavior data for multiple adapted versions in a single display event and the contextual scene data when the single display event occurs, and construct sample labels corresponding to the training samples based on the interaction behavior data; wherein, the sample labels are used to describe the relative preference information between different adapted versions of the target song;

[0040] A single display event (Slate) refers to a complete interactive scenario in which the system simultaneously displays multiple adapted versions of the same target song to a user within a single user request response. For example, if a user opens the playback page for song A and the system displays three versions [V1, V2, V3], this constitutes a display event. Organizing data by this event unit can fully preserve the competitive relationship between versions and the user's choice context during this exposure. Interaction behavior data records the specific actions the user took towards each adapted version during this display event, such as: whether a particular version was clicked to play (preferred version), the duration of playback on that version, whether the user switched from the current version to another version of the same song, whether the user directly switched to another song, and strong preference signals such as adding to favorites or playlists. These behaviors directly reflect user preferences. Contextual scenario data describes the environmental information at the time the display event occurred, such as: the time of occurrence (hour, day of the week), the user's approximate geographical location (e.g., home, office, commuting), the type of device used (e.g., car stereo, headphones, external speakers), and network conditions. This information reflects the user's listening scenario and potential needs at that time.

[0041] In this step, the interactive behavior data and contextual scene data collected during a single demonstration event are encapsulated into a structured data record to construct a training sample. Based on the interactive behavior data, and through certain calculation rules, the relative preference of users for different adapted versions of the song during this event is quantified, thereby constructing the sample label corresponding to the training sample. This sample label is a soft label that can express the preference ranking or preference probability between versions.

[0042] As a feasible implementation method, sample labels corresponding to training samples are constructed based on interaction behavior data, including: calculating the in-group benefit value of multiple modified versions in a single display event based on interaction behavior data; wherein, the in-group benefit value of the modified version is used to describe the user's preference for the modified version in a single display event; and generating sample labels based on the in-group benefit value.

[0043] The group-specific benefit score is a comprehensive numerical rating. Its core idea is to weight and integrate different types of user behavior (such as clicks, dwell times, and switching) according to their contribution to preference expression. When calculating this benefit score, it considers bonuses for positive behaviors (such as selecting to play, prolonged dwell time, and switching from other versions to this version) and deductions for negative behaviors (such as switching away from this version). Preset weighting coefficients are used to balance the importance of various behaviors. In this way, each adapted version receives a benefit score, which directly reflects the user's relative preference for that version within the specific context of the display event and user interaction. A higher benefit score indicates a higher level of user acceptance or fit for that version in the given scenario.

[0044] In practice, based on interaction behavior data, the within-group benefit values ​​of multiple adapted versions in a single display event are calculated. These within-group benefit values ​​are then transformed into supervision signals, i.e., sample labels, suitable for the ranking model to learn. The transformation can employ a relative ranking method, where the benefit value is directly used as the ranking criterion, with versions having higher benefit values ​​ranking higher. Alternatively, a probability distribution method can be used, where the benefit values ​​are normalized using a transformation function (such as the Softmax function) to obtain a probability value for each version. This probability distribution represents the estimated likelihood that each version will become the user's optimal choice based on this interaction.

[0045] S13: When the number of training samples reaches a preset threshold, the audio representation of the target song, contextual scene data, and adaptation style information of the adapted version are input into the ranking model within the same song group; wherein, the ranking model within the same song group includes a song feature encoding network, a scene feature encoding network, and a style feature encoding network;

[0046] S14: Encode the audio representation of the target song using a song feature coding network to obtain the song semantic representation; encode the context scene data using a scene feature coding network to obtain the scene semantic representation; and encode the adaptation style information using a style feature coding network to obtain the style semantic representation.

[0047] The preset threshold is a condition set based on practical experience to determine whether enough unbiased training samples have been accumulated and have sufficient coverage. This threshold can be set from multiple dimensions, such as: the cumulative total number of display events reaching the event threshold N0, or the effective exposure count of each major adaptation of each song in various typical scenarios not being less than the exposure count threshold m_min.

[0048] In practice, when the number of training samples reaches a preset threshold, a ranking model within the same song group is trained. The input to the ranking model includes the audio representation of the target song, contextual scene data, and adaptation style information of the adapted version. The audio representation of the target song is a high-dimensional vector extracted from the original audio signal of the song that can summarize its musical characteristics. For example, it can be a song-level embedding vector extracted by a pre-trained audio model such as MERT (Music Audio Representation Transformer) or MuQ (Music Query). The audio representation represents the inherent attributes of the song itself, such as melody, rhythm, and harmony. The contextual scene data refers to the environmental feature vectors recorded in the training samples when the display event occurs. The adaptation style information of the adapted version refers to the style category identifier of the adapted version or its corresponding style description text.

[0049] It should be noted that the ranking model within the same song group is a multi-tower fusion network, which includes a song feature encoding network (Song Tower), a context feature encoding network (Context Tower), and a style feature encoding network (Style Tower). The song feature encoding network can be a multilayer perceptron (MLP), and its input is a general audio representation of the target song. It maps the semantics of the song to a higher-level semantic space through several non-linear layers, and outputs a song semantic vector with a fixed dimension. This vector encapsulates the musical characteristics of the song. The scene feature encoding network can also be an MLP, whose input is an encoded feature vector of the context scene data. Output a scene semantic vector This vector represents an abstract representation of the current user's listening environment. The input to the style feature encoding network is the style identifier (ID) or descriptive text. The style ID can be obtained by looking up its vector representation in a predefined style embedding table. After fine-tuning by an MLP, the descriptive text can be encoded using a text encoder (such as the text encoding part of the CLAP model). The final output is a style semantic vector. This vector represents the characteristics of the adaptation style itself.

[0050] S15: The semantic representations of the song, scene, and style are fused to obtain the fused features, and the preference score of the adapted version is determined based on the fused features;

[0051] S16: Construct a loss function based on the difference between preference scores and sample labels, and train and optimize the intra-song ranking model based on the loss function to obtain the trained intra-song ranking model. The trained intra-song ranking model is used to recommend adapted versions of the target song.

[0052] In practice, the training process of the multi-tower fusion network is as follows: First, semantic vectors are obtained through three towers (song feature encoding network, scene feature encoding network, and style feature encoding network). Then, these three vectors are fused, with common fusion methods including concatenation or weighted summation. For example, the three vectors can be directly concatenated into a longer fused feature vector. Next, this fused feature vector is fed into a scoring function. Output a preference score, representing the preference score for the adaptation style v given the song and scene ctx. A loss function is constructed based on the difference between preference scores and sample labels. The gradient of the loss function with respect to all parameters of the model (including the parameters of the three encoding networks and the scoring network) is calculated using the backpropagation algorithm. An optimizer (such as Adam) is then used to update the parameters, gradually reducing the loss and making the model's predictions more and more accurate.

[0053] As can be seen, this embodiment designs a proprietary encoding network to process input information of different modalities, and then makes a comprehensive decision through fusion and scoring. This enables the model to fully explore and utilize the complex relationships between song content features, scene context and adaptation style information, thereby enabling it to accurately and contextually rank different adaptations of the same song.

[0054] The song recommendation method provided in this application employs a controlled randomization display strategy. In the early stages of data accumulation, multiple adapted versions of the same song are displayed randomly or in a controlled random manner, effectively breaking the inherent bias caused by the default display position. This allows for the collection of unbiased interaction data that more closely reflects users' true preferences. Based on this, training samples and their labels are constructed using single display events as units, combining interaction behavior data and contextual scene data. This enables the samples to simultaneously capture user preferences and scene adaptability. Once the training samples have accumulated to a certain scale, an in-song ranking model is trained using the target song's audio representation, contextual scene data, and adaptation style information, with sample labels as supervisory signals. This allows the model to learn the relative adaptability of different adapted versions in different scenes. Finally, upon receiving a playback request for the target song, the in-song ranking model can predict the preference probability of each adapted version based on the current contextual scene data and recommend the most suitable version accordingly. Therefore, this application embodiment achieves scene-based adaptive and accurate ranking of multiple adapted versions of the same song while eliminating positional bias, thereby improving the accuracy of song version recommendations.

[0055] This embodiment describes the process of constructing sample labels, that is, the specific implementation of step S12 above. Specifically:

[0056] See Figure 2 The flowchart of a method for constructing sample tags provided in this application embodiment is as follows: Figure 2 As shown, it includes:

[0057] S121: Based on interactive behavior data, obtain target behavior information for multiple adapted versions in a single display event; wherein, the target behavior information includes any one or a combination of any of the following: whether it is selected as the premiere version, playback duration, number of times the behavior switches from other adapted versions to the current adapted version, and number of times the behavior switches from the current adapted version to other adapted versions;

[0058] Targeted behavioral information refers to the key behavioral signals selected from all user interactions during a single presentation, those that most directly or indirectly reflect the user's preference for the adapted version. These signals are divided into two categories: one is explicit positive feedback or initial selection signals, i.e., whether the user clicked to play for the first time (whether it was selected as the premiere version). The other is implicit relative preference comparison signals, specifically including: the user's playback dwell time on the current adapted version (playback dwell time), which reflects the user's willingness to continue listening to this version; the number of times the user switched from other adapted versions to the current adapted version, which directly indicates that the current version is more attractive than the version that was switched to; and the number of times the user switched from the current adapted version to other adapted versions, which suggests that the current version may not be as good as the version that was switched to, or that the user wants to try other options.

[0059] In this step, target behavior information for each adapted version is extracted from the interaction behavior data, and a behavior vector containing one or more of the above indicators is constructed for each adapted version, thereby providing raw materials for constructing quantitative preference labels.

[0060] S122: Weight the different target behavior information of each adapted version according to the weights corresponding to different target behavior information to obtain the in-group benefit value of each adapted version;

[0061] In this step, a preset weight coefficient is assigned to each type of target behavioral information. These weight coefficients reflect the relative importance of different behaviors in representing user preferences and are typically determined based on business judgment, data analysis, or experimentation. (Adapted version) Intragroup return value It can be calculated using a weighted formula: .

[0062] in, This indicates whether it was selected as the premiere version (value is 0 or 1). Used to describe the duration of playback; it is a normalized value of the original number of seconds. Used to describe the number of times the action is switched from other adapted versions to the current adapted version. Used to describe the number of times an action is switched from the current adapted version to another adapted version. , , , These are preset weighting coefficients, which can be set to 1, 0.5, 1, and 0.5 respectively.

[0063] S123: Normalize the in-group payout values ​​of multiple adapted versions to obtain the preference probability distribution of multiple adapted versions as the first sample label;

[0064] In this step, the absolute within-group benefit value of each version is converted into a relative preference measure relative to other versions in the same presentation event, i.e., a preference probability distribution, which forms the first sample label.

[0065] In practice, the first sample label The calculation method is as follows: ,in, This is a collection of all adapted versions.

[0066] S124: Based on the behavior of switching from the first modified version to the second modified version in a single display event, generate pairwise comparison labels as second sample labels; wherein, the pairwise comparison labels are used to characterize that the second modified version is superior to the first modified version.

[0067] In this step, pairwise comparison labels are constructed as the second sample labels using the direct comparison behavior of users switching versions. When a user actively switches from the currently playing first adapted version (A) to the second adapted version (B) in a single display event, and usually meets certain conditions (such as the dwell time on B exceeding a threshold), this behavior is considered a valid direct preference comparison between A and B, implicitly indicating that in the context at that time, the user considers version B to be superior to version A. The system captures such behavior and generates a pairwise comparison label of the form (B, A), where B is called the positive example (winner) and A is called the negative example (loser). It should be noted that, to ensure signal quality, switches caused by accidental touches or extremely short dwell times may be filtered out. These pairwise labels do not care about the overall ranking of all versions, but focus on the relative preference relationship between pairs of versions, providing the model with more direct and sometimes less noisy local comparison information.

[0068] Therefore, this embodiment provides a specific scheme for constructing multi-dimensional, fine-grained sample labels. By filtering key target behavioral information and performing weighted aggregation, complex user interactions can be transformed into quantified intra-group benefit values, comprehensively reflecting version preferences. Furthermore, by generating a first label in the form of a probability distribution through normalization, the model is provided with a clear objective for learning the global relative fit between versions. Simultaneously, pairwise comparison labels are constructed using direct version switching behaviors, supplementing the model with local, strongly contrasting supervision signals. This dual-label construction method, combining global probability distribution and local preference comparison, enables model training to grasp both the overall ranking trend and accurately learn subtle preference differences between versions, thereby significantly improving the intra-group ranking model's ability to characterize users' true intentions and scenario adaptability, and enhancing recommendation accuracy.

[0069] This embodiment describes the training process of the ranking model within the same song group, that is, the specific implementation of step S13 above. Specifically:

[0070] See Figure 3 The flowchart of a training method for a ranking model within a song group provided in this application embodiment is as follows: Figure 3 As shown, it includes:

[0071] S131: Input the audio representation of the target song into the song feature encoding network in the same song group ranking model to obtain the song semantic vector; input the context scene data into the scene feature encoding network in the same song group ranking model to obtain the scene semantic vector; input the adaptation style information of the adapted version into the style feature encoding network in the same song group ranking model to obtain the style semantic vector.

[0072] In this step, the ranking model within the same song group adopts a multi-tower coding architecture. The song feature coding network is used to extract the song semantic vector, the scene feature coding network is used to extract the scene semantic vector, and the style feature coding network is used to extract the style semantic vector.

[0073] S132: The semantic vectors of the song, scene, and style are fused to obtain a fused feature vector, and the preference score of the adapted version is determined based on the fused feature vector;

[0074] In this step, the song semantic vector, scene semantic vector, and style semantic vector are fused to obtain a fused feature vector. This fused feature vector is then fed into a scoring network. This network, through learned non-linear transformations, maps the high-dimensional fused features into a scalar output, namely the preference score for this adapted version. This score is an unnormalized real value, and its level directly reflects the model's initial judgment tendency regarding the proposition "whether this adapted style is appropriate for the song in the current scene." A higher score indicates a higher degree of suitability, according to the model.

[0075] S133: Obtain the position assignment probability and display position visibility parameter corresponding to the training sample, and calculate the inverse tendency weight based on the position assignment probability and display position visibility parameter; wherein, the position assignment probability is used to describe the probability that the target modified version is assigned the target display position under the controlled randomization display strategy, and the display position visibility parameter is used to describe the probability that the target display position is noticed.

[0076] Wherein, the probability of position allocation is denoted as , is a probability value that represents the probability that, under the controlled randomization strategy used to generate the current training sample for that particular display event, the adapted version v will be assigned to a specific display position k. This value can be calculated or retrieved directly from the logs recording the randomization process and parameters. The display position visibility parameter is denoted as . is a value between 0 and 1, used to describe the probability that a user notices the k-th display position on the interface (generally, the earlier the position, the higher the probability). The larger the value, the better. This can be obtained by fitting a location deviation model (such as PBM) with small-volume randomized data from the early stage.

[0077] In practice, for an adapted version v observed at position k in a training sample, its inverse bias weight can be: The inverse bias weight reflects the rarity or degree of bias of the observed sample, due to the modified version displayed by default in the high-order position. Increasing the product results in a smaller inverse bias weight, thus reducing the influence of such common but potentially biased samples during training. Conversely, increasing the product amplifies the importance of samples that are randomly displayed in low positions but are still favored by users, thereby offsetting the positional bias.

[0078] S134: Normalize the preference score, construct a first loss term based on the difference between the first sample label and the normalized preference score, and weight the first loss term using the inverse preference weight.

[0079] In this step, the principal loss term for optimizing the model is constructed. For all candidate versions in a single presentation event, the raw preference scores calculated by the model for each version are normalized to obtain the predicted probability distribution for each version. The specific calculation method is as follows:

[0080] , where exp is an exponential function.

[0081] The first sample label is the true preference probability distribution constructed in the previous embodiment based on user behavior. Then, the difference between these two probability distributions is calculated, typically using cross-entropy as a metric, forming the basic first loss term. To correct for the selection bias introduced by controlled randomization, inverse bias weights are applied to the basic first loss term. That is, for each adapted version v in this display event, its contribution to the loss is weighted by its corresponding inverse bias weight, resulting in a weighted first loss term: ;in, The inverse tendency weights are normalized.

[0082] As a preferred implementation, before normalizing the preference score, the method further includes: calculating a prior score of style compatibility between the song semantic vector and the style semantic vector, and obtaining a comprehensive score based on the preference score and the prior score of style compatibility; correspondingly, normalizing the preference score and constructing a first loss term based on the difference between the first sample label and the normalized preference score includes: normalizing the comprehensive score and constructing a first loss term based on the difference between the first sample label and the normalized comprehensive score.

[0083] This implementation introduces domain prior knowledge to assist model training, particularly improving stability and interpretability in cold-start scenarios with sparse data. The core idea of ​​style compatibility prior scores is that certain adaptation styles and specific songs may have inherent compatibility or conflicting relationships in terms of musical characteristics; this relationship can exist independently of the specific user scenario. The calculation is typically achieved through a learnable affine transformation or bilinear interaction. For example, calculating style compatibility prior scores... , where W is a learnable weight matrix. The style compatibility prior score measures the intrinsic compatibility between the song content and the adaptation style in the abstract feature space. Then, the original preference scores learned by the model based on complex factors such as scene are combined with the style compatibility prior score. Combine them, for example, by using a weighted sum to obtain a comprehensive score. ,in This is an adjustable coefficient. In subsequent steps, this comprehensive score s is softmax normalized to obtain the predicted probability, which is then used to construct a loss term that compares with the first sample label. In this way, the model's final prediction considers both the dynamic adaptation to the real-time scene and the relatively static music compatibility prior between songs and styles, making the recommendation results not only personalized and contextualized but also more in line with common musical sense.

[0084] S135: Construct a second loss term based on the second sample label and the difference between the preference scores corresponding to the first and second adapted versions;

[0085] In this step, an auxiliary loss term is constructed using pairwise comparison labels (second sample labels) to enhance the model's ability to learn subtle differences in preferences between versions. The second sample labels are in the form of... This indicates that during a demonstration event, user behavior hinted at the version. Better than version Let the model be version 1. and The calculated original preference scores are as follows: and The second loss term can be a pairwise ranking loss, such as using a logarithmic loss based on the logistic function: ,in The second loss term is the sigmoid function. Its significance lies in encouraging the model to work with the positive examples. The score for the positive version is higher than that for the negative version. The scoring is calculated based on the scores of the two versions, and the larger the difference between the scores, the smaller the loss. Unlike the first loss term, which focuses on matching the probability distribution of the entire list, the second loss term directly optimizes for specific, local preference comparisons. It can more directly utilize the strong contrast signals provided by user switching behavior, helping the model to more accurately characterize the relative superiority or inferiority between versions.

[0086] S136: Construct a loss function based on the weighted first and second loss terms, and train and optimize the ranking model within the same song group based on the loss function.

[0087] In this step, the two aforementioned loss terms are integrated to construct a complete loss function, which can be achieved using a weighted summation method. Then, the ranking model within the same song group is trained and optimized based on the loss function.

[0088] Therefore, this embodiment, through multi-tower encoding and feature fusion, enables the model to deeply integrate multimodal information such as song content, user scenarios, and adaptation styles, providing a powerful feature representation foundation for accurate scenario-based ranking. Furthermore, by introducing a loss correction mechanism based on inverse bias weighting, the model effectively offsets data selection bias caused by controlled randomization display strategies and positional biases, allowing it to learn unbiased user preferences from biased observation data, greatly improving its generalization ability and recommendation fairness. Moreover, by combining a multi-task learning framework of list-based loss and pairwise comparison loss, the model simultaneously optimizes global ranking probability and local preference comparison, enhancing learning robustness and outputting more stable recommendation results that align with common sense about music.

[0089] This embodiment describes the application process of the ranking model within the same song group, specifically:

[0090] See Figure 4 The flowchart of an application method for a ranking model within a song group provided in this application embodiment is as follows: Figure 4 As shown, it includes:

[0091] S21: In response to the playback request of the target song, obtain the current context scene data;

[0092] In this step, the system responds to user actions in real time. When a user triggers a playback request for a target song through the client, the system collects and encodes the current contextual data, which may include time information, geographical location classification (e.g., at home, at work, on the way to work, in public places), playback device and output status (e.g., connected Bluetooth headphones, car audio speakers, mobile phone speakers), network status, and the user's movement status.

[0093] S22: Input the audio representation of the target song, the current context scene data, and the adaptation style information of multiple adapted versions of the target song into the trained intra-song group ranking model;

[0094] In this step, firstly, based on the unique identifier (song_id) of the target song, the pre-extracted general audio representation of the song is read from a pre-built feature library or cache. Secondly, the current context scene data obtained in the previous step is used as the scene input. Finally, a list of all available adaptation versions of the target song on the current platform is obtained, and the adaptation style information corresponding to each version is extracted. Then, for each adaptation version in the list, the audio representation, the current context scene data, and the adaptation style information of the adaptation version are used as a complete input instance and input into the pre-trained song-group ranking model. The model will perform an independent forward computation for each adaptation version to evaluate its suitability in the current scene.

[0095] S23: Obtain the preference scores corresponding to multiple adapted versions output by the ranking model within the same song group;

[0096] In this step, the batch forward propagation calculation of the ranking model within the same song group is performed, and the preference score corresponding to the adapted version output by the ranking model within the same song group is obtained.

[0097] S24: Normalize the preference scores corresponding to multiple adapted versions to obtain the preference probabilities corresponding to multiple adapted versions.

[0098] In this step, the preference probability corresponding to each adapted version is calculated. The specific calculation method is similar to that used during model training, and will not be repeated here.

[0099] S25: Determine the adapted version of the target song to be recommended based on the preference probability.

[0100] In this step, all versions are sorted in descending order based on the calculated preference probabilities, and the version with the highest probability (Top-1) is usually taken as the default recommended adaptation.

[0101] As can be seen, this embodiment achieves intelligent provision of the most suitable song adaptation version for the current scene by training the same song group ranking model, which significantly improves the personalization and context fit of the listening experience and realizes the intelligent playback effect of the same song according to different scenes.

[0102] The following describes an application embodiment provided by this application. This embodiment is applied to an online music platform and aims to solve the technical problem of how to dynamically recommend the most suitable version based on the user's current specific scenario when there are multiple adapted versions of the same song.

[0103] During the data accumulation phase, a controlled randomized full-scale display strategy is employed for data collection. Specifically, for all available adapted versions of the target song, the system displays all versions simultaneously on the same screen or within the same session, or rotates them in a uniform or controlled random manner within a limited Top-k (e.g., top 3) display slot. This phase does not rely on any audio feature model; the core objective is to maximize the collection of nearly unbiased user interaction data to overcome the inherent bias caused by the default display position (i.e., users tend to click on higher-ranked versions).

[0104] To ensure that the collected biased observation data can be corrected subsequently, the system performs strict controlled randomization on a small portion of the traffic (e.g., 2%-5%) and records a complete log. The main strategies include: Adjacent swapping: randomly swapping adjacent versions such as Top1 and Top2, or Top2 and Top3, with a preset probability (e.g., 50%); Sequence probability sampling: using the Plackett-Luce model, sampling the entire display sequence according to the initial base score of each version (which can be set to uniform or cold start score); Extreme value distribution sampling: using Gumbel-Top-k sampling, adding Gumbel distribution noise to the base score of each version before sorting, and generating the display sequence.

[0105] The system generates a structured log record for each exposure event. The `slate_id` is a string, such as "2025-09-13-0001", uniquely identifying an exposure event within the same song adaptation group. It serves as the basic unit for subsequent Group-NDCG calculations, sample aggregation, and pairwise win / loss pair construction. The `song_id` can be a string or an int, such as "S123", identifying the original song and facilitating association with its general audio representation (such as MuQ or MERT embeddings), licensing status, and cost information. `items` is an array of objects recording all candidate adaptation versions and their display details in this exposure. Each element contains `version_id` (string or int, such as "A"), `position` (int, such as 1 indicating the first position), and `exposed` (bool or int, such as 1 indicating the version actually rendered on the screen), used to estimate position visibility, support listwise training, and calculate the coverage of each version.

[0106] Contextual data is recorded as an object in the `context` field, including time slots (e.g., "Fri_18"), coarse geographic location classes (e.g., "commute"), device types (e.g., "car"), network status (e.g., "4G"), and headphone wearing status (e.g., `headset=1`). This data serves as input features for the Context Tower and supports binning model performance evaluation by scenario. The `score_before_rand` field records the original scores or log odds for each version before randomization. It can be in dictionary or list format (e.g., `{"A":2.0,"B":1.0,"C":0.0}`), used to restore the sampling distribution, calculate parameters in the Plackett-Luce model, and also for policy auditing. `rand_method` is an enumeration type with values ​​including "fairpairs", "plackett_luce", "gumbel_topk", or "uniform", used to describe the controlled randomization strategy used in this exposure, allowing selection of the corresponding propensity probability calculation method and filtering of identifiable traffic during training.

[0107] `rand_params` is an object type that records the specific parameters of the randomization display. For example, `{"swap":[1,2],"p":0.5}` indicates that Top1 and Top2 are swapped with a 50% probability; or `{"tau":1.0}` represents the temperature parameter in Plackett-Luce sampling, used to accurately recalculate the allocation probability and ensure experimental reproducibility. `propensity_marginal` is a dictionary that stores the marginal allocation probability of each adapted version appearing at each position (e.g., `{"A@2":0.5107,"B@1":0.2447,"C@3":0.7019}`), which is the probability of version v appearing at position k. This is a key basis for position-level correction in inverse propensity weighted IPS / SNIPS. `propensity_joint` is an object type that contains the complete display sequence and its joint allocation probability (e.g., `{order:["B","A","C"],prob:0.2156}`), used for sequence-level IPS estimation or offline replay evaluation.

[0108] User interactions are fully recorded through the `user_actions` object, including strong intent signals such as `select` (user's preferred version, e.g., "A"), `dwell_sec` (duration of stay, e.g., 42 seconds), `switch_from` (from which version to switch, e.g., "B"), `switch_to_song` (whether to switch to another song, e.g., null indicates no song switch), and `favorite` (whether to favorite, e.g., 1 indicates favorited). These signals are used to calculate the benefits of each version and generate normalized listwise soft tags. It also constructs pairwise win / loss pairs derived from the "version switching" behavior. `impression_time` is of type datetime (e.g., "2025-09-13T18:05:11Z"), recording the specific timestamp of the exposure, used to derive time-segment features and phased display location visibility parameters. It also supports version rollback and data slicing analysis. Finally, it displays the location visibility parameter. Stored in dictionary form by position (e.g., {1:1.0, 2:0.6, 3:0.4}), representing the probability that each position fitted by the PBM (Position-Based Model) is actually noticed by the user, used to divide the observation reward by... Position bias correction is performed to obtain an unbiased estimate that is closer to the true preference.

[0109] Furthermore, based on the collected user interaction behaviors (user_actions), the system calculates a comprehensive intra-group benefit value for each version in each exposure event to quantify user preferences. Specifically, multi-dimensional behaviors are aggregated into an intra-group benefit value through a weighted approach, comprehensively considering behaviors such as user preference, dwell time, attracting users to switch (positive feedback), and users switching away from this version (negative feedback), ultimately outputting a scalar value representing the overall preference strength of that version in this exposure.

[0110] Subsequently, two types of supervisory labels are generated using the revenue values: list-based soft labels: by applying the Softmax function to the revenue values ​​of all versions in the same exposure, a probability distribution is obtained, representing the estimated probability that each version is the most suitable version for the current scene, serving as a listwise supervisory signal for the model to learn the global ranking; and pairwise win / loss labels: directly extracted from version switching behavior. If a user switches from version A to B and meets the stay condition, a win / loss pair (B, A) is generated, indicating that B is superior to A. These labels provide direct preference comparison signals between versions, serving as auxiliary pairwise supervisory signals.

[0111] Once the accumulated number of training samples reaches a preset threshold (e.g., the number of effective exposures for each version of each song in the main scene meets the standard, or the total number of exposure events exceeds N0), the system initiates feature extraction. The core is to extract the general audio representation of the original song, rather than the audio of each adapted version. For example, the pre-trained model MERT is used to process the original song audio: the model outputs a three-dimensional tensor, which is then compressed in time dimension through layer pooling, followed by time pooling (calculating the mean and standard deviation) to obtain a high-dimensional vector. Finally, a projection layer is used to obtain a song-level semantic vector with fixed dimensions (e.g., 512 dimensions). This vector represents the inherent musical characteristics of the song and is stored in a feature library for training and online inference.

[0112] During the model training phase, a three-tower fusion neural network model is trained as a ranking model within song groups. Song tower: a general audio representation of the input song. Output the semantic vector of the song. Scene Tower: Input Context Features Output scene semantic vector Style Tower: Input the ID or description of the adapted style, output a style semantic vector. Fusion and scoring: The three semantic vectors are concatenated and then passed through a fully connected network to output the original preference score for that version.

[0113] To eliminate the influence of position bias in randomized displays, an inverse bias scoring method is used during training. First, the position visibility parameters are fitted using previous randomized logs. Then, for each training sample, its inverse tendency weight is calculated. This is then used to calculate the model's predicted probability. With real soft labels When applying cross-entropy loss, an inverse bias weight is used to weight the loss, thus making the model pay more attention to data obtained through randomization that better reflects true preferences. The total loss function consists of a weighted list loss and a pair loss. The pair loss directly utilizes win-loss pair labels, encouraging the model to score positive versions higher than negative versions. Furthermore, a style compatibility prior can be introduced, calculating the compatibility score between song vectors and style vectors, which is then superimposed on the original preference score to enhance stability under cold start conditions.

[0114] During the model validation phase, an independent validation set was used, with in-group evaluation metrics as the main focus, including: Group-NDCG@1 / 3 (measuring the quality of the in-group ranking of the top 1 or top 3 recommended versions), in-group preferred hit rate (whether the model's Top 1 recommendation is consistent with the user's actual preferred version, the higher the better), version switching rate (the frequency with which users switch between different versions within the same song, the lower the better), and post-switch stability rate (the length of time users stay after switching to a new version, the higher the better).

[0115] After training, the model is deployed online to provide real-time recommendation services. Real-time request processing: When a user initiates a playback request for a song, the system immediately obtains the current context (time, location, device, etc.). The audio vector of the song is read from the feature library and input into the trained model along with the current context and style information of all candidate versions of the song. The model calculates a preference score for each version. Softmax normalization is applied to the preference scores of all versions to obtain the preference probability for each version. All versions are sorted from high to low according to their preference probabilities. The default display strategy is to use the version with the highest probability (Top1) as the default playback item, and collapse the remaining versions in "More Versions" to reduce the user's selection burden. Alternatively, all versions can be displayed sequentially according to their scores. In low-signal scenarios (such as new songs or new users), the system will overlay the calculated style compatibility prior score to provide more stable recommendations. Simultaneously, before the final output, business strategy constraints will be overlaid, such as filtering out adapted versions that are not copyrighted in the current region, have excessively high licensing costs, or are blacklisted in specific scenarios (such as driving).

[0116] In addition, the system maintains a small proportion of exploratory traffic (e.g., 2%), continues to implement a controlled randomization display strategy, and continuously produces new, identifiable, unbiased log data. Periodically (e.g., daily or weekly), it uses the newly added exploratory data to incrementally update the location allocation probability and display location visibility parameters, and incrementally retrains or performs online learning on the ranking model. Through this continuous "exploration-utilization-update" cycle, the system can adaptively track changes in user preferences and the evolution of scene distribution, achieving long-term optimization and stability of recommendation performance.

[0117] As can be seen, this embodiment achieves refined ranking based on dynamic context within the same song group, significantly improving the contextual relevance of the recommendations. Through controlled randomized data collection and inverse bias scoring correction, the pollution of training data by positional bias is fundamentally resolved, enabling the model to learn more realistic user preferences. Furthermore, in the recommendation stage, it relies solely on the original song's general audio representation, eliminating the need to process massive amounts of adapted audio, thus reducing computational and storage costs. Additionally, the style compatibility prior enhances the cold-start effect.

[0118] The following describes a song recommendation device provided by an embodiment of this application. The song recommendation device described below can be referred to in conjunction with the song recommendation method described above. The song recommendation device provided by this application includes:

[0119] The display module is used to display multiple adapted versions of a target song based on a controlled randomization display strategy;

[0120] The construction module is used to construct training samples based on the interaction behavior data for multiple adapted versions in a single display event and the contextual scene data when the single display event occurs, and to construct sample labels corresponding to the training samples based on the interaction behavior data; wherein, the sample labels are used to describe the relative preference information between different adapted versions of the target song.

[0121] The input module is used to input the audio representation of the target song, the contextual scene data, and the adaptation style information of the adapted version into the same-song group ranking model when the number of training samples reaches a preset threshold; wherein, the same-song group ranking model includes a song feature encoding network, a scene feature encoding network, and a style feature encoding network;

[0122] The encoding module is used to encode the audio representation of the target song using the song feature encoding network to obtain the song semantic representation, to encode the context scene data using the scene feature encoding network to obtain the scene semantic representation, and to encode the adaptation style information using the style feature encoding network to obtain the style semantic representation.

[0123] The fusion module is used to fuse the song semantic representation, the scene semantic representation, and the style semantic representation to obtain fusion features, and to determine the preference score of the adapted version based on the fusion features;

[0124] The training module is used to construct a loss function based on the difference between the preference score and the sample label, and to train and optimize the intra-song ranking model based on the loss function to obtain a trained intra-song ranking model. The trained intra-song ranking model is used to recommend adapted versions of the target song.

[0125] The song recommendation device provided in this application embodiment uses a controlled randomization display strategy to randomly or controlled randomize multiple adapted versions of the same song in the early stages of data accumulation. This effectively breaks the inherent bias caused by the default display position, thereby collecting unbiased interaction data that is closer to the user's true preferences. Based on this, training samples and their labels are constructed using single display events as units, combining interaction behavior data and contextual scene data. This allows the samples to simultaneously capture user preferences and scene adaptability. Once the training samples have accumulated to a certain scale, the audio representation of the target song, contextual scene data, and adaptation style information are used, with sample labels as supervision signals, to train a ranking model within the same song group. This allows the model to learn the relative adaptability of different adapted versions in different scenes. Finally, when a playback request for the target song is received, the ranking model within the same song group can predict the preference probability of each adapted version based on the current contextual scene data and recommend the most suitable version accordingly. Therefore, this application embodiment achieves scene-based adaptive and accurate ranking of multiple adapted versions of the same song while eliminating positional bias, thereby improving the accuracy of song version recommendations.

[0126] Based on the above embodiments, as a preferred embodiment, the display module is specifically used to: display all adapted versions of the target song in full, or to rotate and display different adapted versions of the target song in a uniform or controlled random manner within a preset number of front display positions.

[0127] The process of rotating different adapted versions of the target song in a controlled random manner includes: swapping adapted versions in adjacent display positions with a preset probability, and / or determining the display positions of different adapted versions using sequence probability sampling or sorting sampling based on extreme value distribution according to a preset base score.

[0128] Based on the above embodiments, as a preferred embodiment, the building module includes:

[0129] The calculation unit is used to calculate the in-group benefit value of multiple adapted versions in the single display event based on the interaction behavior data; wherein, the in-group benefit value of the adapted version is used to describe the user's preference for the adapted version in the single display event;

[0130] The generation unit is used to generate sample labels based on the in-group return value.

[0131] Based on the above embodiments, as a preferred implementation, the calculation unit is specifically used to: obtain target behavior information for multiple adapted versions in a single display event based on the interactive behavior data; wherein, the target behavior information includes any one or a combination of several of the following: whether it is selected as the premiere version, playback duration, number of times the behavior switches from other adapted versions to the current adapted version, and number of times the behavior switches from the current adapted version to other adapted versions; and weight the different target behavior information of each adapted version according to the weights corresponding to different target behavior information to obtain the group benefit value of each adapted version.

[0132] Based on the above embodiments, as a preferred implementation, the generation unit is specifically used to: normalize the group benefit values ​​of multiple adapted versions to obtain the preference probability distribution of multiple adapted versions as the first sample label; and generate pairwise comparison labels as the second sample label based on the behavior of switching from the first adapted version to the second adapted version in the single display event; wherein, the pairwise comparison labels are used to characterize that the second adapted version is superior to the first adapted version.

[0133] Based on the above embodiments, as a preferred implementation, the training module includes:

[0134] The first calculation unit is used to obtain the location allocation probability and display location visibility parameter corresponding to the training sample, and calculate the inverse tendency weight based on the location allocation probability and the display location visibility parameter; wherein, the location allocation probability is used to describe the probability that the target modified version is assigned the target display location under the controlled randomization display strategy, and the display location visibility parameter is used to describe the probability that the target display location is noticed;

[0135] The first construction unit is used to normalize the preference score, construct a first loss term based on the difference between the first sample label and the normalized preference score, and weight the first loss term using the inverse bias weight.

[0136] The second construction unit is used to construct a second loss term based on the second sample label and the difference between the preference scores corresponding to the first modified version and the second modified version;

[0137] The third construction unit is used to construct a loss function based on the weighted first loss term and the second loss term.

[0138] Based on the above embodiments, as a preferred implementation, the training module further includes:

[0139] The second calculation unit is used to: calculate the style compatibility prior score between the song semantic vector and the style semantic vector, and obtain a comprehensive score based on the preference score and the style compatibility prior score;

[0140] Accordingly, the first construction unit is specifically used to: normalize the comprehensive score and construct a first loss term based on the difference between the first sample label and the normalized comprehensive score.

[0141] Based on the above embodiments, as a preferred embodiment, it further includes:

[0142] The recommendation module is used to respond to a playback request for a target song by obtaining the current context scene data; inputting the audio representation of the target song, the current context scene data, and the adaptation style information of multiple adapted versions of the target song into a trained intra-song group ranking model; obtaining the preference scores corresponding to the multiple adapted versions output by the intra-song group ranking model; normalizing the preference scores corresponding to the multiple adapted versions to obtain the preference probabilities corresponding to the multiple adapted versions; and determining the recommended adapted version of the target song based on the preference probabilities.

[0143] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0144] This application also provides an electronic device, see [link to document]. Figure 5 The present application provides a structural diagram of an electronic device, such as... Figure 5 As shown, it may include a processor and memory.

[0145] Memory, used to store computer programs;

[0146] A processor is configured to execute the computer program to implement the methods disclosed in any of the above embodiments.

[0147] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor can be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which handles computational operations related to machine learning.

[0148] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory is used to store at least the following computer program, which, after being loaded and executed by the processor, is capable of implementing the relevant steps in the obstacle avoidance method for a self-moving cleaning robot executed by the terminal side as disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, application update information.

[0149] In some embodiments, the electronic device may further include a display screen, input / output interfaces, communication interfaces, sensors, a power supply, and a communication bus.

[0150] certainly, Figure 5 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of this application. In practical applications, the electronic device may include more than [other components]. Figure 5 More or fewer components as shown, or combinations of certain components.

[0151] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the song recommendation method performed by the electronic device of any of the above embodiments.

[0152] In another exemplary embodiment, a computer program product is also provided, including a computer program that, when executed, implements the steps of the song recommendation method performed by the electronic device of any of the above embodiments.

[0153] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0154] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A song recommendation method, characterized in that, include: Multiple adapted versions of the target song are displayed based on a controlled randomization display strategy; Using a single display event as a unit, training samples are constructed based on the interaction behavior data for multiple adapted versions within the single display event and the contextual scene data at the time of the single display event, and sample labels are constructed based on the interaction behavior data for the training samples; wherein, the sample labels are used to describe the relative preference information between different adapted versions of the target song; When the number of training samples reaches a preset threshold, the audio representation of the target song, the contextual scene data, and the adaptation style information of the adapted version are input into the same song group ranking model; wherein, the same song group ranking model includes a song feature encoding network, a scene feature encoding network, and a style feature encoding network; The song semantic representation is obtained by encoding the audio representation of the target song using the song feature encoding network, the scene semantic representation is obtained by encoding the context scene data using the scene feature encoding network, and the style semantic representation is obtained by encoding the adaptation style information using the style feature encoding network. The semantic representations of the song, the scene, and the style are fused to obtain a fused feature, and the preference score of the adapted version is determined based on the fused feature. A loss function is constructed based on the difference between the preference score and the sample label, and the ranking model within the same song group is trained and optimized based on the loss function to obtain a trained ranking model within the same song group. The trained ranking model within the same song group is used to recommend adapted versions of the target song.

2. The song recommendation method according to claim 1, characterized in that, Multiple adapted versions of the target song are displayed based on a controlled randomization display strategy, including: Display all adapted versions of the target song. Alternatively, different adapted versions of the target song can be displayed in rotation in multiple preset front display positions in a uniform or controlled random manner; Among them, different adapted versions of the target song are displayed in a controlled random manner, including: The adapted versions in adjacent display positions are swapped with a preset probability, and / or the display positions of different adapted versions are determined by sequential probability sampling or sorting sampling based on extreme value distribution according to a preset base score.

3. The song recommendation method according to claim 1, characterized in that, Based on the interaction behavior data, sample labels corresponding to the training samples are constructed, including: The in-group benefit value of multiple adapted versions in a single display event is calculated based on the interactive behavior data; wherein, the in-group benefit value of the adapted version is used to describe the user's preference for the adapted version in the single display event; Sample labels are generated based on the group's earnings value.

4. The song recommendation method according to claim 3, characterized in that, The calculation of the group-wide revenue value for multiple adapted versions in a single display event based on the interactive behavior data includes: Based on the interactive behavior data, target behavior information for multiple adapted versions is obtained in the single display event; wherein, the target behavior information includes any one or a combination of any of the following: whether it is selected as the premiere version, playback duration, number of times the behavior switches from other adapted versions to the current adapted version, and number of times the behavior switches from the current adapted version to other adapted versions; The in-group benefit value of each adapted version is obtained by weighting the different target behavior information according to the weights corresponding to different target behavior information.

5. The song recommendation method according to claim 3, characterized in that, Sample labels are generated based on the in-group earnings values, including: The within-group payout values ​​of multiple adapted versions were normalized to obtain the preference probability distribution of multiple adapted versions, which was used as the first sample label. Based on the behavior of switching from the first adapted version to the second adapted version in the single display event, pairwise comparison labels are generated as second sample labels; wherein, the pairwise comparison labels are used to characterize that the second adapted version is superior to the first adapted version.

6. The song recommendation method according to claim 1, characterized in that, A loss function is constructed based on the difference between the preference score and the sample label, including: Obtain the location allocation probability and display location visibility parameter corresponding to the training sample, and calculate the inverse tendency weight based on the location allocation probability and the display location visibility parameter; wherein, the location allocation probability is used to describe the probability that the target modified version is assigned the target display location under the controlled randomization display strategy, and the display location visibility parameter is used to describe the probability that the target display location is noticed; The preference score is normalized, a first loss term is constructed based on the difference between the first sample label and the normalized preference score, and the first loss term is weighted using the inverse preference weight. A second loss term is constructed based on the second sample label and the difference between the preference scores corresponding to the first and second adapted versions; A loss function is constructed based on the weighted first loss term and the second loss term.

7. The song recommendation method according to claim 6, characterized in that, Before normalizing the preference scores, the process also includes: Calculate the style compatibility prior score between the song semantic representation and the style semantic representation, and obtain a comprehensive score based on the preference score and the style compatibility prior score; Accordingly, the preference score is normalized, and a first loss term is constructed based on the difference between the first sample label and the normalized preference score, including: The comprehensive score is normalized, and a first loss term is constructed based on the difference between the first sample label and the normalized comprehensive score.

8. The song recommendation method according to claim 1, characterized in that, Also includes: In response to a playback request for the target song, obtain the current context scene data; The audio representation of the target song, the current context scene data, and the adaptation style information of multiple adapted versions of the target song are input into the trained intra-song group ranking model. Obtain the preference scores corresponding to multiple adapted versions output by the ranking model within the same song group; Normalize the preference scores corresponding to multiple adapted versions to obtain the preference probabilities corresponding to multiple adapted versions; The adapted version of the target song is recommended based on the preference probability.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the song recommendation method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the steps of the song recommendation method as described in any one of claims 1 to 8.

11. A computer program product, characterized in that, It includes a computer program that, when executed, implements the steps of the song recommendation method as described in any one of claims 1 to 8.