Method, device, and storage medium for training a scoring model
By comparing the predicted scores and benchmark scores of the sample objects and adjusting the weight parameters of the scoring model, the problem of more training times in the existing technology is solved, and faster and more accurate scoring model training is achieved.
Patent Information
- Application Number
- CN202011629200.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In the prior art, the scoring model requires a lot of training to achieve better prediction results, and the training process is cumbersome and inefficient.
By comparing the predicted scores and benchmark scores of the sample object, adjusting the weight parameters of the scoring model, and using multiple loss functions and weights to weight sum the weight parameters, to achieve rapid training of the scoring model.
The number of training times is reduced, the prediction effect and accuracy of the scoring model are improved, and faster convergence is achieved.
Smart Images

Figure CN112699268B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and particularly to a method, device, and storage medium for training a scoring model. Background Art
[0002] With the continuous development of Internet technology, personalized recommendation for users has become increasingly important. Taking the recommendation of songs to users as an example, the server can input multiple candidate audios into a pre-trained scoring model to obtain the predicted score corresponding to each candidate audio. According to the predicted scores corresponding to each candidate audio, the candidate audios are sorted to generate a list of candidate audios. Then, the server recommends a list formed by a preset number of candidate audios ranked at the front in the list of candidate audios to the user.
[0003] In the related art, the training process of the scoring model is to input any sample audio in the sample audio set into the scoring model to obtain the predicted score corresponding to the sample audio. Based on the predicted score corresponding to the sample audio, the benchmark score, and a pre-set loss function, the weight parameters in the scoring model are trained and adjusted, thus completing one training process and obtaining a trained scoring model. Then, other sample audios in the sample audio set are selected to train the scoring model, and thus the preset number of training processes are completed to obtain a pre-trained scoring model.
[0004] During the training process, a large number of samples need to be collected, and then the machine learning model is trained with a large number of samples. Therefore, when training the scoring model by the above method, a large number of training processes are required to make the scoring model achieve a better prediction effect. Summary of the Invention
[0005] Embodiments of this application provide a method, device, and storage medium for training a scoring model, which can solve the problem that the scoring model in the prior art needs to be trained a large number of times. The technical solution is as follows:
[0006] On the one hand, embodiments of this application provide a method for training a scoring model, and the method includes:
[0007] Obtain the account information of the sample account, the first benchmark score, the object information of the first sample object, the second benchmark score, and the object information of the second sample object, where the first benchmark score is greater than the second benchmark score, the first benchmark score is the score given by the sample account to the first sample object, and the second benchmark score is the score given by the sample account to the second sample object;
[0008] Input the account information of the sample account and the object information of the first sample object into the scoring model to obtain the first predicted score of the first sample object, and input the account information of the sample account and the object information of the second sample object into the scoring model to obtain the second predicted score of the second sample object;
[0009] If the first predicted score is less than the second predicted score, train and adjust the weight parameters in the scoring model based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score.
[0010] Optionally, the step of "if the first predicted score is less than the second predicted score, train and adjust the weight parameters in the scoring model based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score" includes:
[0011] If the first predicted score is less than the second predicted score, obtain first loss information based on the first predicted score, the first benchmark score, and a preset first loss function, obtain second loss information based on the second predicted score, the second benchmark score, and a preset second loss function, obtain third loss information based on the first predicted score, the second predicted score, and a preset third loss function, perform weighted summation processing on the first loss information, the second loss information, and the third loss information respectively based on preset first weight, second weight, and third weight to obtain fourth loss information, and train and adjust the weight parameters in the scoring model based on the fourth loss information.
[0012] Optionally, the step of "if the first predicted score is less than the second predicted score, train and adjust the weight parameters in the scoring model based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score" includes:
[0013] If the first predicted score is less than the second predicted score, obtain first loss information based on the first predicted score, the first benchmark score, and a preset first loss function, obtain second loss information based on the second predicted score, the second benchmark score, and a preset second loss function, obtain third loss information based on the first predicted score, the second predicted score, and a preset third loss function, and train and adjust the weight parameters in the scoring model respectively based on the first loss information, the second loss information, and the third loss information.
[0014] Optionally, the method further includes:
[0015] If the first prediction score is greater than the second prediction score, then based on the first prediction score, the first reference score, the second prediction score, and the second reference score, the weight parameters in the scoring model are trained and adjusted.
[0016] Optionally, the step of, if the first prediction score is greater than the second prediction score, then based on the first prediction score, the first reference score, the second prediction score, and the second reference score, training and adjusting the weight parameters in the scoring model includes:
[0017] If the first prediction score is greater than the second prediction score, then based on the first prediction score, the first reference score, and a preset first loss function, first loss information is obtained; based on the second prediction score, the second reference score, and a preset second loss function, second loss information is obtained; based on a preset first weight value and a second weight value, weighted summation processing is respectively performed on the first loss information and the second loss information to obtain fifth loss information; and based on the fifth loss information, the weight parameters in the scoring model are trained and adjusted.
[0018] Optionally, the step of, if the first prediction score is greater than the second prediction score, then based on the first prediction score, the first reference score, the second prediction score, and the second reference score, training and adjusting the weight parameters in the scoring model includes:
[0019] If the first prediction score is greater than the second prediction score, then based on the first prediction score, the first reference score, and a preset first loss function, first loss information is obtained; based on the second prediction score, the second reference score, and a preset second loss function, second loss information is obtained; and based on the first loss information and the second loss information, the weight parameters in the scoring model are trained and adjusted respectively.
[0020] Optionally, the method further includes:
[0021] When an object display trigger event corresponding to a target account is detected, the account information of the target account and the object information of a plurality of candidate objects are obtained;
[0022] The account information of the target account and the object information of each candidate object are respectively input into a scoring model whose weight parameters have been trained and adjusted to obtain the prediction score of each candidate object;
[0023] Based on the prediction scores of each candidate object, determine the object to be displayed and the ranking of the object to be displayed among multiple candidate objects.
[0024] Optionally, the inputting the account information of the sample account and the object information of the first sample object into the scoring model to obtain the first prediction score of the first sample object includes:
[0025] Based on the account information of the sample account, the object information of the first sample object, and the first feature processing module in the scoring model, obtain the first sample feature information;
[0026] Based on the account information of the sample account, the object information of the first sample object, and the second feature processing module in the scoring model, obtain the second sample feature information;
[0027] Based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtain multiple third sample feature information;
[0028] Based on the first sample feature information, the second sample feature information, the third sample feature information, and the sub-scoring module in the scoring model, obtain the first prediction score of the first sample object.
[0029] Optionally, the based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtaining multiple third sample feature information includes:
[0030] Based on the account information of the sample account and the object information of the first sample object, obtain multiple feature embedding vectors;
[0031] For each feature embedding vector, pair the feature embedding vector with each other feature embedding vector respectively to obtain multiple feature embedding vector pairs, perform outer product cross calculation on the two feature embedding vectors in each feature embedding vector pair to obtain the feature cross matrix of the two feature embedding vectors in each feature embedding vector pair, perform sum pooling on each feature cross matrix to obtain the matrix after sum pooling, and based on the matrix after sum pooling, determine the third sample feature information corresponding to the feature embedding vector.
[0032] On the one hand, an embodiment of the present application provides a device for training a scoring model, and the device includes:
[0033] An acquisition module, configured to acquire account information of a sample account, a first benchmark score, object information of a first sample object, a second benchmark score, and object information of a second sample object, wherein the first benchmark score is greater than the second benchmark score, the first benchmark score is the score given by the sample account to the first sample object, and the second benchmark score is the score given by the sample account to the second sample object;
[0034] A prediction module, configured to input the account information of the sample account and the object information of the first sample object into a scoring model to obtain a first prediction score of the first sample object, and input the account information of the sample account and the object information of the second sample object into the scoring model to obtain a second prediction score of the second sample object;
[0035] A first adjustment module, configured to, if the first prediction score is less than the second prediction score, train and adjust the weight parameters in the scoring model based on the first prediction score and the first benchmark score, the second prediction score and the second benchmark score, and the first prediction score and the second prediction score.
[0036] Optionally, the first adjustment module is configured to:
[0037] If the first prediction score is less than the second prediction score, obtain first loss information based on the first prediction score, the first benchmark score, and a preset first loss function, obtain second loss information based on the second prediction score, the second benchmark score, and a preset second loss function, obtain third loss information based on the first prediction score, the second prediction score, and a preset third loss function, perform weighted summation processing on the first loss information, the second loss information, and the third loss information respectively based on preset first weight, second weight, and third weight to obtain fourth loss information, and train and adjust the weight parameters in the scoring model based on the fourth loss information.
[0038] Optionally, the first adjustment module is configured to:
[0039] If the first predicted score is less than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function, second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function, third loss information is obtained based on the first predicted score, the second predicted score, and a preset third loss function, and the weight parameters in the scoring model are trained and adjusted respectively based on the first loss information, the second loss information, and the third loss information.
[0040] Optionally, the apparatus further includes a second adjustment module, and the second adjustment module is configured to:
[0041] If the first predicted score is greater than the second predicted score, the weight parameters in the scoring model are trained and adjusted based on the first predicted score and the first reference score, and the second predicted score and the second reference score.
[0042] Optionally, the second adjustment module is configured to:
[0043] If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function, second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function, the first loss information and the second loss information are respectively weighted and summed based on preset first and second weights to obtain fifth loss information, and the weight parameters in the scoring model are trained and adjusted based on the fifth loss information.
[0044] Optionally, the second adjustment module is configured to:
[0045] If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function, second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function, and the weight parameters in the scoring model are trained and adjusted respectively based on the first loss information and the second loss information.
[0046] Optionally, the apparatus further includes a sorting module, and the sorting module is configured to:
[0047] When an object display trigger event corresponding to a target account is detected, the account information of the target account and the object information of a plurality of candidate objects are obtained;
[0048] Input the account information of the target account and the object information of each candidate object into the scoring model trained and adjusted with weight parameters to obtain the predicted scores of each candidate object.
[0049] Based on the predicted scores of each candidate object, determine the object to be displayed and the ranking of the object to be displayed among multiple candidate objects.
[0050] Optionally, the prediction module is configured to:
[0051] Based on the account information of the sample account, the object information of the first sample object, and the first feature processing module in the scoring model, obtain the first sample feature information.
[0052] Based on the account information of the sample account, the object information of the first sample object, and the second feature processing module in the scoring model, obtain the second sample feature information.
[0053] Based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtain multiple third sample feature information.
[0054] Based on the first sample feature information, the second sample feature information, the third sample feature information, and the sub-scoring module in the scoring model, obtain the first predicted score of the first sample object.
[0055] Optionally, the prediction module is configured to:
[0056] Based on the account information of the sample account and the object information of the first sample object, obtain multiple feature embedding vectors.
[0057] For each feature embedding vector, pair the feature embedding vector with each other feature embedding vector respectively to obtain multiple feature embedding vector pairs. Perform outer product cross calculation on the two feature embedding vectors in each feature embedding vector pair to obtain the feature cross matrix of the two feature embedding vectors in each feature embedding vector pair. Perform sum pooling on each feature cross matrix to obtain the matrix after sum pooling. Based on the matrix after sum pooling, determine the third sample feature information corresponding to the feature embedding vector.
[0058] On the one hand, an embodiment of the present application provides a device, which includes a processor and a memory. At least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the above method for training a scoring model.
[0059] On the one hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement the method for training a scoring model as described above.
[0060] When training a scoring model using the technical solution provided by the embodiment of the present application, not only can the weight parameters in the scoring model be adjusted according to the predicted score and the benchmark score of the sample object, but also the weight parameters in the scoring model can be adjusted according to the predicted scores of two sample objects. In this way, each training can adjust the weight parameters in multiple aspects, enabling the scoring model to converge more quickly. Therefore, when the prediction effect of the scoring model in the present application is the same as the training effect of the scoring model in the prior art, the number of training times required in the present application is much less than the number of training times required in the prior art.
[0061] At the same time, in the embodiment of the present application, since the first benchmark score of the first sample object is greater than the second benchmark score of the second sample object, the true ranking is that the first sample object is ranked in front of the second sample object. Since the first predicted score of the first sample object is less than the second predicted score of the second sample object, the predicted ranking is that the first sample object is ranked behind the second sample object. At this time, the true ranking and the predicted ranking are different. When the true ranking and the predicted ranking are different, the embodiment of the present application can adjust the weight parameters of the scoring model according to the first predicted score and the second predicted score, so that the scoring model learns the true ranking of the first sample object and the second sample object, and further improves the accuracy of the predicted ranking of the scoring model. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0063] Figure 1 is a schematic diagram of an implementation environment for training a scoring model provided by an embodiment of the present application;
[0064] Figure 2 is a flowchart of a method for training a scoring model provided by an embodiment of the present application;
[0065] Figure 3 is a flowchart of a method for training a scoring model provided by an embodiment of the present application;
[0066] Figure 4 is a schematic diagram of a method for training a scoring model provided by an embodiment of the present application;
[0067] Figure 5 It is a schematic diagram of a training scoring model provided by an embodiment of the present application;
[0068] Figure 6 It is a flowchart of a method for training a scoring model provided by an embodiment of the present application;
[0069] Figure 7 It is a schematic diagram of the structure of a device for training a scoring model provided by an embodiment of the present application;
[0070] Figure 8 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present application;
[0071] Figure 9 It is a schematic diagram of the structure of a server provided by an embodiment of the present application. Detailed implementation manners
[0072] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.
[0073] Figure 1 It is a schematic diagram of an implementation environment for training a scoring model provided by an embodiment of the present application. As Figure 1 shown, the implementation environment may include: a server 101 and a terminal 102.
[0074] The server 101 may be a single server or a server cluster composed of multiple servers. The server 101 may be at least one of a cloud computing platform and a virtualization center, and the embodiments of the present application do not make any limitations thereto. Taking the object as audio as an example, the server 101 may be used to train a scoring model, may also be used to obtain the account information of a target account and the object information of multiple candidate objects, and determine the object to be displayed and the sorting of the object to be displayed among the multiple candidate objects. Moreover, it may be used to send the object to be displayed and the sorting of the object to be displayed to the terminal. Of course, the server 101 may also include other functional servers to provide more comprehensive and diverse services.
[0075] The terminal 102 may be at least one of a smart phone, a game console, a desktop computer, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, and a laptop computer. The terminal 102 is connected to the server 101 through a wired network or a wireless network. An application program that can recommend to users, such as a shopping application program, a music application program, etc., is installed and run in the terminal 102. The terminal 102 can be used to send the account information of the target account and the object information of multiple candidate objects to the server, and is also used to receive the audio to be displayed sent by the server and the sorting of the audio to be displayed, and perform the display.
[0076] The method provided by the embodiment of the present application can be applied to a music application program. The music application program can recommend song audio or playlists to users according to the method provided by the embodiment of the present application. It can also be applied to a shopping application program. The shopping application program can recommend commodities to users according to the method provided by the embodiment of the present application. It can even be applied to a video application program. The video application program can recommend videos to users according to the method provided by the embodiment of the present application.
[0077] Figure 2 It is a flowchart of a method for training a scoring model provided by an embodiment of the present application. This embodiment is described with the server as the execution subject. Refer to Figure 2 , this embodiment includes:
[0078] Step 201, obtain the account information of the sample account, the first reference score, the object information of the first sample object, the second reference score, and the object information of the second sample object.
[0079] Among them, the first reference score is greater than the second reference score. The first reference score is the score given by the sample account to the first sample object, and the second reference score is the score given by the sample account to the second sample object.
[0080] Step 202, input the account information of the sample account and the object information of the first sample object into the scoring model to obtain the first predicted score of the first sample object, and input the account information of the sample account and the object information of the second sample object into the scoring model to obtain the second predicted score of the second sample object.
[0081] Step 203: If the first predicted score is less than the second predicted score, then based on the first predicted score and the first reference score, the second predicted score and the second reference score, and the first predicted score and the second predicted score, train and adjust the weight parameters in the scoring model.
[0082] When training the scoring model using the technical solution provided in the embodiments of the present application, not only can the weight parameters in the scoring model be adjusted according to the predicted scores and reference scores of the sample objects, but also the weight parameters in the scoring model can be adjusted according to the predicted scores of two sample objects. In this way, the weight parameters can be adjusted in multiple dimensions each time of training, enabling the scoring model to converge more quickly. When the prediction effect of the scoring model in the present application is the same as the training effect of the scoring model in the prior art, the number of training times required in the present application is much less than the number of training times required in the prior art.
[0083] Meanwhile, in the embodiments of the present application, since the first reference score of the first sample object is greater than the second reference score of the second sample object, the true ranking is that the first sample object is ranked in front of the second sample object. Since the first predicted score of the first sample object is less than the second predicted score of the second sample object, the predicted ranking is that the first sample object is ranked behind the second sample object. At this time, the true ranking and the predicted ranking are different. And when the true ranking and the predicted ranking are different, the embodiments of the present application can adjust the weight parameters of the scoring model according to the first predicted score and the second predicted score, so that the scoring model learns the true ranking of the first sample object and the second sample object, to further improve the accuracy of the predicted ranking of the scoring model.
[0084] Figure 3 It is a flowchart of a method for training a scoring model provided by an embodiment of the present application. This embodiment is described with the server as the execution subject. Refer to Figure 3 This embodiment includes:
[0085] Step 301: Obtain the account information of the sample account, the first reference score, the object information of the first sample object, the second reference score, and the object information of the second sample object.
[0086] Among them, the first reference score is greater than the second reference score. The first reference score is the score given by the sample account to the first sample object, and the second reference score is the score given by the sample account to the second sample object.
[0087] Before training the scoring model, it is necessary to obtain the account information corresponding to each sample account, all sample objects, and the object information and benchmark scores of each sample object. Among all the sample objects corresponding to multiple sample accounts, any two sample objects are paired, and multiple pairs of sample objects corresponding to the sample accounts are obtained. The account information of each sample account, the object information and benchmark scores of each sample object in any pair of sample objects corresponding to the sample account are stored as a training sample in the training set.
[0088] During each training process of the scoring model, any one training sample is selected from the training set, and the account information of the sample account, the object information of the two sample objects, and the corresponding benchmark scores in the training sample are determined. Compare the magnitudes of the benchmark scores of the two sample objects. If the benchmark scores of the two sample objects are equal, for each sample object, the object information of the sample object and the account information of the sample account are input into the scoring model to obtain the predicted score of the sample object, and then the scoring model is trained and adjusted based on the predicted score and the benchmark score of the sample object. If the benchmark scores of the two sample objects are not equal, the larger benchmark score is used as the first benchmark score, the sample object corresponding to the first benchmark score is used as the first sample object, the smaller benchmark score is used as the second benchmark score, and the sample object corresponding to the second benchmark score is used as the second sample object.
[0089] Alternatively, before training the scoring model, check the magnitudes of the benchmark scores of the two sample objects in each training sample. If the benchmark scores of the two sample objects are equal, discard the training sample.
[0090] Optionally, the object can be audio. The account information of the sample account may include account feature information and account attribute information. The account attribute information corresponding to the sample account is determined according to the basic attribute information and the favorite song preference feature information corresponding to the sample account. Among them, the basic attribute information includes the age information, gender information, location information, etc. of the user using the sample account, and the favorite song preference feature information can be the number of songs of different genres in the favorite list of the sample account. The account feature information of the sample account is determined according to the audio feature information of the audio collected, listened to, and downloaded during the first preset historical period in the historical listening record. Among them, the audio collected, listened to, and downloaded during the first preset historical period in the historical listening record can be input into the audio feature extraction module to obtain the audio feature information corresponding to each song audio. The account attribute information corresponding to the sample account and the account feature information corresponding to the sample account are determined as the account information corresponding to the sample account.
[0091] The object information of the sample object may be the audio information of the sample audio. Among them, the sample audio may be the audio collected, listened to, and downloaded by the sample account within the second preset historical period in the historical listening record. The audio information may include audio feature information and audio attribute information. The audio attribute information includes the age information of the people who prefer the sample audio, the genre information of the sample audio, the number of times the sample audio is listened to within the preset historical time, the music style of the sample audio, etc. The audio feature information may be the feature information of the sample audio. The sample audio may be input into the audio feature extraction module to obtain the audio feature information of the sample audio.
[0092] It should be noted that the account information and audio information in the embodiments of the present application are actually feature vectors.
[0093] The baseline score of the sample object can be obtained based on the attention information of the sample account to the sample audio. For example, every time the sample account listens to a sample audio, the score of the sample audio is recorded as 1. Every time the sample account downloads a sample audio, the score of the sample audio is recorded as 2. If the sample account has favorited a certain sample audio, the score of the sample audio is recorded as 3. According to the listening information, download information, and favoriting information of the sample account for the sample audio within the second preset historical period, the baseline score of the sample audio is determined.
[0094] It should be noted that the preset historical period can be divided into a first preset historical period and a second preset historical period.
[0095] Step 302: Input the account information of the sample account and the object information of the first sample object into the scoring model to obtain the first predicted score of the first sample object, and input the account information of the sample account and the object information of the second sample object into the scoring model to obtain the second predicted score of the second sample object.
[0096] Optionally, the scoring model is divided into a first feature processing module, a second feature processing module, a third feature processing module, and a sub-scoring module. Among them, the first feature processing module, the second feature processing module, and the third feature processing module are all used for feature processing, and the sub-scoring model is used to process the outputs of the first feature processing module, the second feature processing module, and the third feature processing module, and output the predicted score of the sample object. The specific steps are as follows: Based on the account information of the sample account, the object information of the first sample object, and the first feature processing module in the scoring model, obtain the first sample feature information. Based on the account information of the sample account, the object information of the first sample object, and the second feature processing module in the scoring model, obtain the second sample feature information. Based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtain multiple third sample feature information. Based on the first sample feature information, the second sample feature information, the third sample feature information, and the sub-scoring module in the scoring model, obtain the first predicted score of the first sample object.
[0097] The above process involves that the first feature processing module can be an FM module. In the account information of the sample account and the object information of the first sample object, obtain sparse feature vectors and continuous feature lines corresponding to different types respectively. Perform one-hot encoding and feature mapping processing on each sparse feature vector to obtain dense feature embedding vectors. Discretize the continuous feature line, and then perform feature mapping to obtain the feature embedding vector corresponding to the continuous feature line. Through the above method, multiple feature embedding vectors can be obtained. Input the multiple feature embedding vectors into the FM module to obtain the first sample feature information.
[0098] Alternatively, in the account information of the sample account and the object information of the first sample object, only obtain sparse feature vectors corresponding to different types or continuous feature lines corresponding to different types, and thus only obtain the feature embedding vectors corresponding to the sparse feature vectors or the continuous feature lines.
[0099] It should be noted that the account information includes various different types of feature information, and this feature information can be a sparse feature vector or a continuous feature line. Similarly, the object information includes various different types of feature information, and this feature information can be a sparse feature vector or a continuous feature line. The steps to obtain the sparse feature vector or continuous feature line of the same type are as follows: In the account information of the sample account and the object information of the first sample object, obtain the first feature information in the account information and the second feature information in the object information, and splice the first feature information and the second feature information to obtain a sparse feature or a continuous feature line. Among them, the first feature information and the second feature information are feature information of the same type. For example, splice the age feature information in the account information and the age feature information in the object information (this age feature information is the age feature information of the people who prefer this sample object) to obtain a continuous feature line. Splice the location feature information in the account information and the location feature information in the object information (this location feature information is the location feature information of the people who prefer the sample object) to obtain a sparse feature vector. The sparse feature vector in the above process is non-comparable feature information. For example, the sparse feature vector can be the feature information of the music style of the sample audio, the feature information of the song audio preferred by the sample account, etc. The continuous feature line is comparable feature information. For example, the continuous feature line can be the age feature information of the sample account, the feature information of the number of times the sample audio is listened to within a preset historical time, etc.
[0100] The specific process of the FM module processing multiple feature embedding vectors is as follows: Perform linear processing on each feature embedding vector separately, and linearly add the linearly processed feature embedding vectors to obtain the first feature vector after addition. Perform an inner product operation on every two feature embedding vectors to obtain multiple second feature vectors after the inner product. Input the multiple second feature vectors and the first feature vector into the Sigmiod Function (non-linear function) to obtain the first sample feature information. Among them, the inner product in the above process is also called vector dot product, that is, perform vector dot product on every two feature embedding vectors to obtain the second feature vector. The first sample feature information is a feature vector.
[0101] The first feature processing module can be the FM module in the DeepFM model. Summing the feature embedding vectors can reflect the first-order features, and performing an inner product on the feature embedding vectors can reflect the influence of the second-order feature combination on the prediction result, thereby enabling the FM module to capture the low-order cross features of the features.
[0102] It should be noted that the FM module is a training module, and thus during the training process, the coefficients and other weight parameters required in the linear processing process and the non-linear processing process are adjusted.
[0103] For example, Figure 4The first feature processing module in [[ ]] processes the feature embedding vector 1, the feature embedding vector 2, and the feature embedding vector 3 to obtain the first sample feature information.
[0104] The second feature processing module involved in the above process can be a DNN module. Through the method of obtaining feature embedding vectors as described above, multiple feature embedding vectors are obtained. The multiple feature embedding vectors are input into the DNN module to obtain the second sample feature information.
[0105] The process of the DNN module processing multiple feature embedding vectors is as follows: The multiple feature embedding vectors are input into the Hidden Layer in the DNN module, and multiple third feature vectors are output. The multiple third feature vectors are input into the Sigmiod Function to obtain the second sample feature information. Among them, the second sample feature information is a sample vector.
[0106] It should be noted that the Hidden Layer includes multiple Activation Functions, and the multiple activation functions process the multiple feature embedding vectors to obtain multiple feature vectors. The second feature processing module can be the DNN module in the DeepFM model, and the DNN module can capture any high-order feature combinations.
[0107] It should be noted that the DNN module is a training module, and thus, during the training process, the coefficients in the Activation Function, the coefficients in the Sigmiod Function, and the weight coefficients of the hidden layer are adjusted.
[0108] For example, Figure 4 the second feature processing module in [[ ]] processes the feature embedding vector 1, the feature embedding vector 2, and the feature embedding vector 3 to obtain the second sample feature information.
[0109] The third feature processing module involved in the above process is an outer product feature module. The steps for the outer product feature module to obtain multiple third sample feature information based on the account information of the sample account and the object information of the first sample object are as follows: Through the method of obtaining feature embedding vectors as described above, multiple feature embedding vectors are obtained. For each feature embedding vector, the feature embedding vector is paired with each other feature embedding vector respectively to obtain multiple feature embedding vector pairs. The outer product cross calculation is performed on the two feature embedding vectors in each feature embedding vector pair to obtain the feature cross matrix of the two feature embedding vectors in each feature matrix pair. The sum pooling is performed on each feature cross matrix to obtain the sum-pooled matrix. Based on the sum-pooled matrix, the third sample feature information corresponding to the feature embedding vector is determined.
[0110] Among them, sum pooling is used to make the scoring module more generalizable, while significantly reducing the parameter scale to ensure the online performance of the scoring module.
[0111] Specifically, the process of the outer product feature module processing n feature embedding vectors with dimension d is as follows: for each of the n feature embedding vectors, pair the feature embedding vector with each other feature embedding vector respectively to obtain multiple pairs of feature embedding vectors, perform an outer product cross calculation on the two feature embedding vectors in each pair of feature embedding vectors to obtain n - 1 feature cross matrices with dimension d×d. Sum pool the n - 1 feature cross matrices with dimension d×d (add the corresponding positions of each of the n - 1 feature cross matrices with dimension d×d), and finally obtain a sum matrix with dimension d×d. Flatten the sum matrix with dimension d×d to obtain a vector with dimension 1×d 2 , that is, obtain the third sample feature information corresponding to the feature embedding vector, and further obtain the third sample feature information corresponding to each feature embedding vector.
[0112] It should be noted that the outer product is also called the vector product or cross product. Flattening processing means splicing each row in the sum matrix with dimension d×d to obtain a vector with dimension 1×d 2 . The first sample feature information, the second sample feature information, and the third sample feature information are all feature vectors.
[0113] For example, when the object is audio, according to the sample account, it includes three features: the location feature information of the sample account, the age feature information of the user using the sample account, and the genre preference feature information of the sample account. The sample audio includes three features: the age feature information of the people listening to the sample audio, the location feature information of the people who prefer the sample audio, and the genre feature information of the sample audio. Splice the location feature information of the sample account and the location feature information of the people who prefer the sample audio to obtain the first feature embedding vector corresponding to the location; splice the age feature information of the sample account and the age feature information of the people who prefer the sample audio to obtain the second feature embedding vector corresponding to the age; splice the genre preference feature information of the sample account and the genre feature information of the sample audio to obtain the third feature embedding vector corresponding to the genre. The first feature embedding vector, the second feature embedding vector, and the third feature embedding vector are as Figure 5 shown. Perform an outer product cross calculation on the first feature embedding vector with the second feature embedding vector and the third feature embedding vector respectively to obtain two feature cross matrices, sum pool the two feature cross matrices to obtain the sum-pooled matrix, and flatten the sum-pooled matrix to obtain the sample feature information corresponding to the first feature embedding vector, specifically as Figure 5As shown. The sample feature information corresponding to the second feature embedding vector and the sample feature information corresponding to the third feature embedding vector are obtained by the same method. Among them, the dimensions of the position feature information, age feature information, and genre preference feature information in the above process may be different. These feature information can be aligned in dimension first, and then the two feature information can be concatenated.
[0114] The outer product feature module in this application can model various association relationships between different feature embedding vectors, explicitly capture the relationships between features in each dimension, depict the association relationships between multiple feature dimensions, improve the understanding ability of the scoring model for features, and thus improve the model performance.
[0115] For example, Figure 4 the third feature processing module in processes the feature embedding vector 1, feature embedding vector 2, and feature embedding vector 3 to obtain the third sample feature information.
[0116] After determining the first sample feature information, second sample feature information, and third sample feature information, the first sample feature information, second sample feature information, and third sample feature information are concatenated and processed, and input into the sub-scoring model in the scoring model to obtain the first prediction score of the first sample object.
[0117] Similarly, based on the account information of the sample account, the object information of the second sample object, and the first feature processing module in the scoring model, the fourth sample feature information is obtained; based on the account information of the sample account, the object information of the second sample object, and the second feature processing module in the scoring model, the fifth sample feature information is obtained; based on the account information of the sample account, the object information of the second sample object, and the third feature processing model in the scoring model, multiple sixth sample feature information are obtained; the fourth sample feature information, fifth sample feature information, and sixth sample feature information are concatenated and input into the sub-scoring module in the scoring model to obtain the second prediction score of the second sample object.
[0118] Step 303, whether the first prediction score is less than the second prediction score. If the first prediction score is less than the second prediction score, then execute step 304. If the first prediction score is greater than the second prediction score, then execute step 305.
[0119] Step 304, based on the first prediction score and the first benchmark score, the second prediction score and the second benchmark score, and the first prediction score and the second prediction score, train and adjust the weight parameters in the scoring model.
[0120] When the first prediction score is less than the second prediction score, the weight parameters of the scoring model can be trained and adjusted in the following two ways.
[0121] In the first method, based on the first prediction score, the first benchmark score, and a preset first loss function, first loss information is obtained; based on the second prediction score, the second benchmark score, and a preset second loss function, second loss information is obtained; based on the first prediction score, the second prediction score, and a preset third loss function, third loss information is obtained; based on preset first weight, second weight, and third weight, weighted summation processing is respectively performed on the first loss information, the second loss information, and the third loss information to obtain fourth loss information; based on the fourth loss information, training adjustment is performed on the weight parameters in the scoring model.
[0122] It should be noted that the first weight, the second weight, and the third weight can be preset by those skilled in the art according to needs, and these three weights can be equal or unequal. The first loss function, the second loss function, and the third loss function can be the same loss function or different loss functions. For example, the first loss function, the second loss function, and the third loss function are hinge loss functions.
[0123] In the second method, based on the first prediction score, the first benchmark score, and a preset first loss function, first loss information is obtained; based on the second prediction score, the second benchmark score, and a preset second loss function, second loss information is obtained; based on the first prediction score, the second prediction score, and a preset third loss function, third loss information is obtained; based on the first loss information, the second loss information, and the third loss information, training adjustment is respectively performed on the weight parameters in the scoring model.
[0124] In the process of sorting the first sample object and the second sample object by the method provided in the embodiment of the present application, since the first benchmark score of the first sample object is greater than the second benchmark score of the second sample object, therefore, the true sorting should be that the first sample object is ranked in front of the second sample object. However, the predicted arrangement is that the second sample object is ranked in front of the first sample object. At this time, the predicted sorting does not match the true sorting. The weight parameters in the scoring model can be trained and adjusted according to the first prediction score corresponding to the first sample object and the second prediction score corresponding to the second sample object, so that the sorting obtained based on the scoring model is closer to the true sorting.
[0125] Step 305, based on the first prediction score and the first benchmark score, and the second prediction score and the second benchmark score, training adjustment is performed on the weight parameters in the scoring model.
[0126] There are two methods as described below for training and adjusting the weight parameters in the scoring model according to the first prediction score and the first benchmark score, and the second prediction score and the second benchmark score.
[0127] In the first method, first loss information is obtained based on a first prediction score, a first reference score, and a preset first loss function. Second loss information is obtained based on a second prediction score, a second reference score, and a preset second loss function. Based on preset first and second weights, weighted summation processing is respectively performed on the first loss information and the second loss information to obtain fifth loss information. Based on the fifth loss information, the weight parameters in the scoring model are trained and adjusted.
[0128] Among them, the first weight and the second weight may be equal or may not be equal.
[0129] In the second method, if the first prediction score is greater than the second prediction score, first loss information is obtained based on the first prediction score, the first reference score, and the preset first loss function, second loss information is obtained based on the second prediction score, the second reference score, and the preset second loss function, and based on the first loss information and the second loss information, the weight parameters in the scoring model are respectively trained and adjusted.
[0130] Figure 6It is a flowchart of a method for training a scoring model provided by an embodiment of the present application. The flowchart includes the steps of the above process, including: obtaining the account information of the sample account, the object information and the benchmark scores of all sample objects corresponding to the sample account. For each sample object corresponding to a sample account, any two sample objects among these sample objects are paired to obtain a plurality of sample object pairs. The object information and the benchmark scores of each sample object in each sample object pair are obtained, and the object information and the benchmark scores of each sample object in the sample object pair are respectively used as a training sample together with the account information of the sample account. Through the above method, a plurality of training samples corresponding to each sample account are obtained, and then a training set composed of a plurality of training samples is obtained. Obtain any one training sample in the training set, and obtain the account information of the sample account in the training sample and the object information and the benchmark scores of the two sample objects in the sample object pair corresponding to the sample account (S601). Determine whether the benchmark scores of the two sample objects are equal (S602). If the two benchmark scores are equal, for each sample object, the account information of the sample account and the object information of the sample object are input into the scoring model to obtain the predicted score of the sample object (S603). If the two benchmark scores are not equal, the larger benchmark score is used as the first benchmark score, the sample object corresponding to the larger benchmark score is used as the first sample object, the smaller benchmark score is used as the second benchmark score, and the sample object corresponding to the smaller benchmark score is used as the second sample object (S604). The account information of the sample account and the object information of the first sample object are input into the scoring model to obtain the first predicted score of the first sample object, and the account information of the sample account and the object information of the second sample object are input into the scoring model to obtain the second predicted score of the second sample object (S605). Determine whether the first predicted score is less than the second predicted score (S606). If the first predicted score is greater than the second predicted score, the weight parameters in the scoring model are trained and adjusted based on the first predicted score and the first benchmark score, and the second predicted score and the second benchmark score (S607). If the first predicted score is less than the second predicted score, the weight parameters in the scoring model are trained and adjusted based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score (S608).
[0131] When training the scoring model using the technical solution provided by the embodiments of the present application, not only can the weight parameters in the scoring model be adjusted according to the predicted scores and benchmark scores of the sample objects, but also the weight parameters in the scoring model can be adjusted according to the predicted scores of two sample objects. In this way, each training can adjust the weight parameters in multiple dimensions, enabling the scoring model to converge more quickly. When the prediction effect of the scoring model in the present application is the same as the training effect of the scoring model in the prior art, the number of training times required by the present application is much less than the number of training times required by the prior art.
[0132] Meanwhile, in the embodiments of the present application, since the first benchmark score of the first sample object is greater than the second benchmark score of the second sample object, the true ranking is that the first sample object is ranked in front of the second sample object. Since the first predicted score of the first sample object is less than the second predicted score of the second sample object, the predicted ranking is that the first sample object is ranked behind the second sample object. At this time, the true ranking and the predicted ranking are different. And when the true ranking and the predicted ranking are different, the embodiments of the present application can adjust the weight parameters of the scoring model according to the first predicted score and the second predicted score, enabling the scoring model to learn the true ranking of the first sample object and the second sample object, so as to further improve the accuracy of the predicted ranking of the scoring model.
[0133] Optionally, in the actual use process, when an object display trigger event corresponding to a target account is detected, the account information of the target account and the object information of multiple candidate objects are obtained; the account information of the target account is respectively input into the scoring model that has been trained and adjusted with weight parameters together with the object information of each candidate object to obtain the predicted scores of each candidate object; based on the predicted scores of each candidate object, the object to be displayed and the ranking of the object to be displayed are determined among the multiple candidate objects.
[0134] Among them, when the object is an audio, the object display trigger event can be a display trigger event of a song audio, a display trigger event of a playlist, a display trigger event of a commodity, a display trigger event of a video, etc. Taking the display trigger event of a song audio as an example, the trigger event of the song audio can be a song audio recommendation request sent by the terminal logged in by the account. During the working process, the server can detect the song audio recommendation trigger events corresponding to each account. When the server detects that the song audio recommendation trigger event corresponding to the target account occurs, the server obtains the account information of the target account and the audio information of multiple candidate audios, and inputs them into the scoring model that has been trained and adjusted with weight parameters to obtain the predicted scores of each candidate audio. Based on the predicted scores of each candidate audio, the audio to be displayed and the ranking of the audio to be displayed are determined among the multiple candidate audios, and they are sent to the terminal. The terminal receives the audio to be displayed and the ranking of the audio to be displayed and displays them.
[0135] Figure 7 It is a schematic structural diagram of a device for training a scoring model provided by an embodiment of the present application. Refer to Figure 7 , this device can be the server in the above embodiment. This device includes:
[0136] An acquisition module 701, configured to acquire account information of a sample account, a first benchmark score, object information of a first sample object, a second benchmark score, and object information of a second sample object, where the first benchmark score is greater than the second benchmark score, the first benchmark score is the score given by the sample account to the first sample object, and the second benchmark score is the score given by the sample account to the second sample object;
[0137] A prediction module 702, configured to input the account information of the sample account and the object information of the first sample object into the scoring model to obtain a first predicted score of the first sample object, and input the account information of the sample account and the object information of the second sample object into the scoring model to obtain a second predicted score of the second sample object;
[0138] A first adjustment module 703, configured to, if the first predicted score is less than the second predicted score, train and adjust the weight parameters in the scoring model based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score.
[0139] Optionally, the first adjustment module 703 is configured to:
[0140] If the first predicted score is less than the second predicted score, obtain first loss information based on the first predicted score, the first benchmark score, and a preset first loss function, obtain second loss information based on the second predicted score, the second benchmark score, and a preset second loss function; obtain third loss information based on the first predicted score, the second predicted score, and a preset third loss function; perform weighted summation processing on the first loss information, the second loss information, and the third loss information respectively based on preset first weights, second weights, and third weights to obtain fourth loss information; train and adjust the weight parameters in the scoring model based on the fourth loss information.
[0141] Optionally, the first adjustment module 703 is configured to:
[0142] If the first predicted score is less than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function; second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function; third loss information is obtained based on the first predicted score, the second predicted score, and a preset third loss function; and the weight parameters in the scoring model are trained and adjusted based on the first loss information, the second loss information, and the third loss information.
[0143] Optionally, the apparatus further includes a second adjustment module configured to:
[0144] If the first predicted score is greater than the second predicted score, the weight parameters in the scoring model are trained and adjusted based on the first predicted score and the first reference score, and the second predicted score and the second reference score.
[0145] Optionally, the second adjustment module is configured to:
[0146] If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function; second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function; fifth loss information is obtained by performing weighted summation processing on the first loss information and the second loss information respectively based on a preset first weight value and a second weight value; and the weight parameters in the scoring model are trained and adjusted based on the fifth loss information.
[0147] Optionally, the second adjustment module is configured to:
[0148] If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function; second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function; and the weight parameters in the scoring model are trained and adjusted based on the first loss information and the second loss information respectively.
[0149] Optionally, the apparatus further includes a sorting module configured to:
[0150] When an object display trigger event corresponding to a target account is detected, the account information of the target account and the object information of a plurality of candidate objects are obtained;
[0151] Input the account information of the target account and the object information of each candidate object into the scoring model adjusted by weight parameters to obtain the predicted scores of each candidate object.
[0152] Based on the predicted scores of each candidate object, determine the object to be displayed and the ranking of the object to be displayed among multiple candidate objects.
[0153] Optionally, the prediction module 702 is configured to:
[0154] Based on the account information of the sample account, the object information of the first sample object, and the first feature processing module in the scoring model, obtain the first sample feature information.
[0155] Based on the account information of the sample account, the object information of the first sample object, and the second feature processing module in the scoring model, obtain the second sample feature information.
[0156] Based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtain multiple third sample feature information.
[0157] Based on the first sample feature information, the second sample feature information, the third sample feature information, and the sub-scoring module in the scoring model, obtain the first predicted score of the first sample object.
[0158] Optionally, the prediction module 702 is configured to:
[0159] Based on the account information of the sample account and the object information of the first sample object, obtain multiple feature embedding vectors.
[0160] For each feature embedding vector, pair the feature embedding vector with each other feature embedding vector to obtain multiple feature embedding vector pairs. Perform outer product cross calculation on the two feature embedding vectors in each feature embedding vector pair to obtain the feature cross matrix of the two feature embedding vectors in each feature embedding vector pair. Perform sum pooling on each feature cross matrix to obtain the matrix after sum pooling. Based on the matrix after sum pooling, determine the third sample feature information corresponding to the feature embedding vector.
[0161] It should be noted that when the device for training the scoring model provided in the above embodiments trains the scoring model, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for training the scoring model provided in the above embodiments and the method embodiments for training the scoring model belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.
[0162] Figure 8 It is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal 800 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer, or a desktop computer. The terminal 800 may also be referred to by other names such as a user equipment, a portable terminal, a laptop terminal, a desktop terminal, etc.
[0163] Generally, the terminal 800 includes: a processor 801 and a memory 802.
[0164] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0165] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 802 is used to store at least one program code, and the at least one program code is used to be executed by the processor 801 to implement the method for training a scoring model provided in the method embodiments of the present application.
[0166] In some embodiments, the terminal 800 may further optionally include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802, and the peripheral device interface 803 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 803 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, a positioning assembly 808, and a power supply 809.
[0167] The peripheral device interface 803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 may be implemented on a separate chip or circuit board, and the present embodiment does not limit this.
[0168] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 804 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: a metropolitan area network, each generation of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 804 may further include a circuit related to NFC (Near Field Communication), and the present application does not limit this.
[0169] The display screen 805 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on or above the surface of the display screen 805. The touch signals can be input as control signals to the processor 801 for processing. At this time, the display screen 805 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 805, which is provided on the front panel of the terminal 800; in other embodiments, there may be at least two display screens 805, which are respectively provided on different surfaces of the terminal 800 or are in a folding design; in other embodiments, the display screen 805 may be a flexible display screen, which is provided on the curved surface or the folding surface of the terminal 800. Even, the display screen 805 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 805 can be prepared using materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0170] The camera module 806 is used to collect images or videos. Optionally, the camera module 806 includes a front camera and a rear camera. Generally, the front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the function of background blurring by fusing the main camera and the depth-of-field camera, the function of panoramic shooting by fusing the main camera and the wide-angle camera, and the VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera module 806 may also include a flash. The flash can be a single-color-temperature flash or a two-color-temperature flash. A two-color-temperature flash refers to a combination of a warm-light flash and a cold-light flash, which can be used for light compensation under different color temperatures.
[0171] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 801 for processing, or input to the radio frequency circuit 804 to enable voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 800. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 807 may further include a headphone jack.
[0172] The positioning component 808 is used to locate the current geographical location of the terminal 800 to achieve navigation or LBS (Location Based Service). The positioning component 808 may be a positioning component based on the GPS (Global Positioning System) of the United States, the Beidou system of China, the GLONASS system of Russia, or the Galileo system of the European Union.
[0173] The power supply 809 is used to supply power to each component in the terminal 800. The power supply 809 may be alternating current, direct current, a disposable battery, or a rechargeable battery. When the power supply 809 includes a rechargeable battery, the rechargeable battery may support wired charging or wireless charging. The rechargeable battery may also be used to support fast charging technology.
[0174] In some embodiments, the terminal 800 further includes one or more sensors 810. The one or more sensors 810 include but are not limited to: an acceleration sensor 811, a gyroscope sensor 812, a pressure sensor 813, a fingerprint sensor 814, an optical sensor 815, and a proximity sensor 816.
[0175] The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the terminal 800. For example, the acceleration sensor 811 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 801 can control the display screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 can also be used for collecting game or user movement data.
[0176] The gyroscope sensor 812 can detect the body direction and rotation angle of the terminal 800. The gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the 3D actions of the user on the terminal 800. Based on the data collected by the gyroscope sensor 812, the processor 801 can implement the following functions: motion sensing (such as changing the UI according to the user's tilting operation), image stabilization during shooting, game control, and inertial navigation.
[0177] The pressure sensor 813 can be disposed on the side frame of the terminal 800 and / or the lower layer of the display screen 805. When the pressure sensor 813 is disposed on the side frame of the terminal 800, it can detect the holding signal of the user on the terminal 800, and the processor 801 can identify the left or right hand or perform a quick operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed on the lower layer of the display screen 805, the processor 801 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 805. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0178] The fingerprint sensor 814 is used to collect the fingerprint of the user. The processor 801 can identify the user's identity according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 can identify the user's identity according to the collected fingerprint. When the identity of the user is identified as a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations, and the sensitive operations include unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings, etc. The fingerprint sensor 814 can be disposed on the front, back, or side of the terminal 800. When there are physical buttons or manufacturer logos on the terminal 800, the fingerprint sensor 814 can be integrated with the physical buttons or manufacturer logos.
[0179] The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is decreased. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera module 806 according to the ambient light intensity collected by the optical sensor 815.
[0180] The proximity sensor 816, also known as a distance sensor, is usually disposed on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually decreasing, the processor 801 controls the display screen 805 to switch from the lit state to the off state; when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually increasing, the processor 801 controls the display screen 805 to switch from the off state to the lit state.
[0181] Those skilled in the art can understand that Figure 8 the structure shown in does not constitute a limitation on the terminal 800, and may include more or fewer components than shown in the figure, or combine certain components, or adopt different component arrangements.
[0182] The computer device provided by the embodiments of the present application can be provided as a server. Figure 9 FIG. is a schematic structural diagram of a server provided by an embodiment of the present application. The server 900 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 901 and one or more memories 902. Among them, at least one program code is stored in the memory 902, and the at least one program code is loaded and executed by the processor 901 to implement the method for training a scoring model provided by each of the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input / output interface for input and output. The server may also include other components for implementing the functions of the device, which will not be elaborated here.
[0183] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including program code, and the above program code can be executed by a processor in a terminal or a server to complete the media resource playback method in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact-disc read-only memory, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0184] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by hardware related to program code. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk, or an optical disc, etc.
[0185] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for training a scoring model, characterized in that, The method includes: Obtaining the account information of a sample account, a first benchmark score, the object information of a first sample object, a second benchmark score, and the object information of a second sample object, where the first benchmark score is greater than the second benchmark score, the first benchmark score is the score given by the sample account to the first sample object, the second benchmark score is the score given by the sample account to the second sample object, both the first sample object and the second sample object are sample audios, the account information of the sample account includes account feature information and account attribute information, and the object information is the audio information of the sample audio; Inputting the account information of the sample account and the object information of the first sample object into a scoring model to obtain a first predicted score for the first sample object, and inputting the account information of the sample account and the object information of the second sample object into the scoring model to obtain a second predicted score for the second sample object; If the first predicted score is less than the second predicted score, then based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score, training and adjusting the weight parameters in the scoring model; Among them, the step of if the first predicted score is less than the second predicted score, then based on the first predicted score and the first benchmark score, the second predicted score and the second benchmark score, and the first predicted score and the second predicted score, training and adjusting the weight parameters in the scoring model includes: If the first predicted score is less than the second predicted score, then based on the first predicted score, the first benchmark score, and a preset first loss function, obtaining first loss information, based on the second predicted score, the second benchmark score, and a preset second loss function, obtaining second loss information, based on the first predicted score, the second predicted score, and a preset third loss function, obtaining third loss information, based on preset first weight, second weight, and third weight, respectively performing weighted summation processing on the first loss information, the second loss information, and the third loss information to obtain fourth loss information, and based on the fourth loss information, training and adjusting the weight parameters in the scoring model; Or, if the first predicted score is less than the second predicted score, then based on the first predicted score, the first benchmark score, and a preset first loss function, obtaining first loss information, based on the second predicted score, the second benchmark score, and a preset second loss function, obtaining second loss information, based on the first predicted score, the second predicted score, and a preset third loss function, obtaining third loss information, and based on the first loss information, the second loss information, and the third loss information, respectively training and adjusting the weight parameters in the scoring model.
2. The method according to claim 1, wherein The method further includes: If the first predicted score is greater than the second predicted score, the weight parameters in the scoring model are trained and adjusted based on the first predicted score, the first reference score, the second predicted score, and the second reference score.
3. The method according to claim 2, wherein The step of, if the first predicted score is greater than the second predicted score, training and adjusting the weight parameters in the scoring model based on the first predicted score, the first reference score, the second predicted score, and the second reference score, includes: If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function, second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function, weighted summation processing is respectively performed on the first loss information and the second loss information based on preset first and second weight values to obtain fifth loss information, and the weight parameters in the scoring model are trained and adjusted based on the fifth loss information.
4. The method according to claim 2, wherein The step of, if the first predicted score is greater than the second predicted score, training and adjusting the weight parameters in the scoring model based on the first predicted score, the first reference score, the second predicted score, and the second reference score, includes: If the first predicted score is greater than the second predicted score, first loss information is obtained based on the first predicted score, the first reference score, and a preset first loss function, second loss information is obtained based on the second predicted score, the second reference score, and a preset second loss function, and the weight parameters in the scoring model are trained and adjusted respectively based on the first loss information and the second loss information.
5. The method according to claim 1, characterized in that, The method further includes: When an object display trigger event corresponding to a target account is detected, the account information of the target account and the object information of multiple candidate objects are obtained; The account information of the target account and the object information of each candidate object are respectively input into the scoring model with trained and adjusted weight parameters to obtain the predicted score of each candidate object; Based on the predicted scores of each candidate object, the object to be displayed and the sorting of the object to be displayed are determined among multiple candidate objects.
6. The method according to claim 1, characterized in that The step of inputting the account information of the sample account and the object information of the first sample object into the scoring model to obtain the first predicted score of the first sample object includes: First sample feature information is obtained based on the account information of the sample account, the object information of the first sample object, and the first feature processing module in the scoring model; Second sample feature information is obtained based on the account information of the sample account, the object information of the first sample object, and the second feature processing module in the scoring model; Multiple third sample feature information is obtained based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model; Based on the first sample feature information, the second sample feature information, the third sample feature information, and the sub-scoring modules in the scoring model, obtain the first predicted score of the first sample object.
7. The method according to claim 6, wherein Based on the account information of the sample account, the object information of the first sample object, and the third feature processing model in the scoring model, obtain a plurality of third sample feature information, including: Based on the account information of the sample account and the object information of the first sample object, obtain a plurality of feature embedding vectors; For each feature embedding vector, pair the feature embedding vector with each other feature embedding vector respectively to obtain a plurality of feature embedding vector pairs, perform outer product cross calculation on the two feature embedding vectors in each feature embedding vector pair to obtain the feature cross matrix of the two feature embedding vectors in each feature embedding vector pair, perform sum pooling on each feature cross matrix to obtain the matrix after sum pooling, and based on the matrix after sum pooling, determine the third sample feature information corresponding to the feature embedding vector.
8. A device, characterized in that, The device includes a processor and a memory, and at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the operations performed by the method for training a scoring model according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, At least one program code is stored in the computer-readable storage medium, and the at least one program code is loaded and executed by a processor to implement the operations performed by the method for training a scoring model according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for transmitting playlist identifier
CN108388652A
Shared account detection method and related device
CN110175438A