[summary of the invention]
Technical problem to be solved by the invention is to provide a kind of method and devices of song recommendations, to solve the prior art
The middle matching degree haveed the defects that between recommendation song and user is not high, user satisfaction is low.
The present invention is in order to solve the technical problem and the technical solution adopted is that provide a kind of method of song recommendations, including under line
On the step of carrying out feature mining and line the step of progress song recommendations, the step of progress feature mining, includes: under middle line
A. musical features are extracted to the song in song collection;B. for each user in user's set, the song collection is utilized
In there are the musical features of the song of incidence relation between the user, calculate the musical features of the user;C. it is directed to the use
Each user in the set of family, using associated by the other users in user set between the user there are incidence relation
Song musical features, the musical features of the user are modified;D. for every song in the song collection, benefit
With revised musical features of user between the song there are incidence relation in user set, to the song
Musical features are modified;The step of song recommendations are carried out on the line includes: that E. chooses finally from the song collection
Similarity is met the requirements between the final musical features of user on musical features and line song simultaneously recommends user on the line,
Wherein user is user in user set on the line.
One of according to the present invention preferred embodiment, the musical features include at least following one kind: audio physical feature, song
Word physical features and lyrics theme feature.
One of according to the present invention preferred embodiment, in the step B, the music for calculating each user according to the following formula is special
Sign:Wherein U (j) indicates the musical features of user j, M (i) indicate in the song collection with user j
Between there are the musical features of the i-th song of incidence relation, n is indicated to exist between user j in the song collection and is associated with
The song sum of relationship.
One of according to the present invention preferred embodiment, in the step C, the music for correcting each user according to the following formula is special
Sign:After wherein U (j) ' indicates user j amendment
Musical features, it is special that M (i) indicates in the song collection that there are the music of the i-th song of incidence relation between user j
Sign, v indicate that there are the song of incidence relation sum, α between user j in the song collectionpIt indicates in user's set
There are the grade weight of p-th of other users of incidence relation between user j, z indicate in user's set with user j it
Between there are the other users of incidence relation sum, Mp(k) it indicates to exist in the song collection with p-th of other users to close
The musical features of the kth song of connection relationship, wpIt indicates to exist in the song collection with p-th of other users and be associated with
The song sum of system.
One of according to the present invention preferred embodiment, in the step D, the music for correcting each song according to the following formula is special
Sign:Wherein M (j) ' indicates that the revised musical features of song j, U (i) ' indicate user's set
In with song j there are the revised musical features of i-th of user of incidence relation, n indicates to deposit in user's set with song j
In the total number of users of incidence relation.
One of according to the present invention preferred embodiment, the step of carrying out feature mining under the line further comprise: judgement is eventually
Only whether condition meets, if it is not, then iteration executes the step B to the step D.
One of according to the present invention preferred embodiment, the termination condition include at least following one kind: the number of iteration reaches
Setting value;Or the time of iteration reaches setting value;Or the music that the song current iteration in the song collection obtains is special
The difference between musical features that sign and upper wheel iteration obtain is less than setting value;Or the user in user's set currently changes
The difference between musical features that the musical features and upper wheel iteration that generation obtains obtain is less than setting value.
The present invention also provides a kind of devices of song recommendations, including feature mining module and song recommendations module, wherein
The feature mining module includes: extraction unit, for extracting musical features to the song in song collection;Computing unit is used
In for each user in user's set, using in the song collection, there are the songs of incidence relation between the user
Musical features calculate the musical features of the user;First amending unit, each user for being directed in user set,
It is right using the musical features of song associated by the other users in user set between the user there are incidence relation
The musical features of the user are modified;Second amending unit, for utilizing institute for every song in the song collection
The revised musical features of user in user's set between the song there are incidence relation are stated, to the music of the song
Feature is modified;The song recommendations module, for being used on final musical features and line from being chosen in the song collection
Similarity is met the requirements between the final musical features in family song simultaneously recommends user on the line, wherein user on the line
It is the user in user's set.
One of according to the present invention preferred embodiment, the musical features include at least following one kind: audio physical feature, song
Word physical features and lyrics theme feature.
One of according to the present invention preferred embodiment, the music that the computing unit calculates each user according to the following formula are special
Sign:Wherein U (j) indicates the musical features of user j, M (i) indicate in the song collection with user j
Between there are the musical features of the i-th song of incidence relation, n is indicated to exist between user j in the song collection and is associated with
The song sum of relationship.
Preferred embodiment, first amending unit correct the music of each user according to the following formula one of according to the present invention
Feature:Wherein U (j) ' indicates user j amendment
Musical features afterwards, M (i) indicate that there are the music of the i-th song of incidence relation spies between user j in the song collection
Sign, v indicate that there are the song of incidence relation sum, α between user j in the song collectionpIt indicates in user's set
There are the grade weight of p-th of other users of incidence relation between user j, z indicate in user's set with user j it
Between there are the other users of incidence relation sum, Mp(k) it indicates to exist in the song collection with p-th of other users to close
The musical features of the kth song of connection relationship, wpIt indicates to exist in the song collection with p-th of other users and be associated with
The song sum of system.
Preferred embodiment, second amending unit correct the sound of each song according to the following formula one of according to the present invention
Happy feature:Wherein M (j) ' indicates that the revised musical features of song j, U (i) ' indicate the user
With song j there are the revised musical features of i-th of user of incidence relation in set, n indicate in user's set with song
There are the total numbers of users of incidence relation by bent j.
One of according to the present invention preferred embodiment, the feature mining module further comprises: judging unit, for judging
Whether termination condition meets, and executes if it is not, then triggering the computing unit to the second amending unit iteration.
One of according to the present invention preferred embodiment, the termination condition include at least following one kind: the number of iteration reaches
Setting value;Or the time of iteration reaches setting value;Or the music that the song current iteration in the song collection obtains is special
The difference between musical features that sign and upper wheel iteration obtain is less than setting value;Or the user in user's set currently changes
The difference between musical features that the musical features and upper wheel iteration that generation obtains obtain is less than setting value.
As can be seen from the above technical solutions, the present invention extracts down the musical features of song online first, then by song
Musical features obtain the musical features of user, then user's musical features are modified, it is revised finally by user
Musical features are modified the musical features of song, and enabling to the musical features of song and user, all more accurately description is each
From feature, to can be chosen according to the musical features of user on line optimum when user carries out song recommendations on line
Song recommendations improve the matching degree on song and line between user to user on line, increase the satisfaction of user on line.
[specific embodiment]
To make the objectives, technical solutions, and advantages of the present invention clearer, right in the following with reference to the drawings and specific embodiments
The present invention is described in detail.
The basic data relied on first the present invention is introduced, and basic data of the invention includes between song and user
Incidence relation and user and user between incidence relation.Wherein, being associated between a song and a user, both may be used
To be to be also possible to this song song since this song song is by the association that this user likes and establishes and listened and built by this user
Vertical association, the present invention are without limitation.Incidence relation between user and user, either being closed caused by social connections
Connection relationship is also possible to due to incidence relation caused by having selected identical preference label.Such as between user 1 and user 2
It is good friend, therefore between user 1 and user 2 there is incidence relation or user 1 and user 2 to have selected identical preference label
" rock and roll ", therefore there is incidence relation between user 1 and user 2.
The incidence relation between incidence relation or user and user between the above song and user is used in user
When music website, carrying out record to the behavior of user be can be obtained.Such as user 1 clicks when listening song A and likes button, note
The record behavior can be obtained by the incidence relation between user 1 and song A, alternatively, user 1 when using music website, selects
Friend relation is established with user 2, the record behavior can be obtained by the incidence relation between user 1 and user 2.
It is appreciated that the song saved in music website database, may be constructed a song collection, and in music website
The registration user saved in database then constitutes user's set.
Referring to FIG. 1, Fig. 1 is the flow diagram of one embodiment of the method for song recommendations in the present invention.The implementation
Example includes the steps that carrying out under line the step of carrying out song recommendations on feature mining and line, carries out feature mining under middle line
The step of the step of including step S1 to step S4, song recommendations are carried out on line include step S5.
It describes in detail below to each step shown in FIG. 1.
Musical features in the present invention, for song, representative be song an attribute, for a user, represent
Be preference of the user to the attribute.Such as the hertz frequency of song this musical features, representative be song hertz frequency
This attribute, and the hertz frequency of user this musical features, representative is preference of the user to hertz frequency.Implement at one
In example, the musical features in step S1 include at least one in audio physical feature, lyrics physical features and lyrics theme feature
Kind.
Specifically, hertz frequency, Mel frequency cepstrum coefficient (Mel Frequency CepstrumCoefficient,
MFCC one of audio physical feature) is belonged to.Participle quantity, the subordinate sentence quantity of the lyrics, the lyrics readability of the lyrics belong to
In one of audio physical feature, wherein lyrics readability is represented by the lyrics and readability can index, and specifically refers to
Introduction in http://en.wikipedia.org/wiki/Automated_Readability_Index.Lyrics theme distribution
Belong to lyrics theme feature, LDA (Latent Dirichlet Allocation) algorithm can be used and calculate the lyrics each
Semantic probability on theme obtains.
As an implementation, every kind of musical features can be with quantization means at a feature row.It is with hertz frequency
Example, it is assumed that the hertz frequency of song can be divided into 0-300hz, 300-500hz, 500-1000hz, 1k-5khz, 5k-15khz this five
The hertz frequency of a section, song " only feeling to you " is 1.5khz, then the hertz frequency for this song of " only feeling to you "
Feature is represented by [0,0,0,1,0] such a feature row.If being extracted n(n≤1 to song) kind musical features, this n
Kind musical features may be constructed the feature vector of n dimension, be expressed as [x1, x2......xn]T, wherein xi (1≤i≤n)
It is a kind of feature row that musical features are formed.
After step S1 processing, every song in song collection is provided with musical features, in step s 2,
Utilize the incidence relation in the musical features and database of song between the song saved and user, so that it may calculate the sound of user
Happy feature.Specifically, in step S2, the musical features of each user can be calculated according to the following formula:
Wherein U (j) indicates that the musical features of user j, M (i) indicate that there are incidence relations between user j in song collection
The i-th song musical features, n indicate song collection between user j there are the song of incidence relation sum.
For example, the song between user 1 there are incidence relation has song A, song B, song C, the hertz frequency of song A
Feature is [0,0,0,1,0], and the hertz frequency feature of song B is [0,0,0,1,0], the hertz frequency feature of song C be [0,0,
1,0,0], then user 1
By the above-mentioned means, each user in user's set is provided with musical features, in step s3, data are utilized
The incidence relation between user and user and the incidence relation between song and user saved in library, so that it may to user's
Musical features are modified.It is worth noting that, the musical features of not necessarily all users require it is modified, if one
Associated other users are not present in a user, then musical features obtained in step S2 are there is no need to be modified, this reality
It applies example and determines the final musical features of each user in a manner of step S2 and S3 cooperation, computation burden can be reduced in this way, accelerated
Treatment effeciency.
Specifically, in step S3, can the musical features according to the following formula to each user be modified:
Wherein U (j) ' indicates that the revised musical features of user j, M (i) indicate exist between user j in song collection
The musical features of i-th song of incidence relation, v indicate that the song in song collection between user j there are incidence relation is total
Number, αpIndicate that there are the grade weight of p-th of other users of incidence relation, z expression users between user j in user's set
There are the other users of incidence relation sum, M between user j in setp(k) indicate song collection in described p-th its
There are the musical features of the kth song of incidence relation, w by his userpIt indicates to deposit in song collection with p-th of other users
In the song sum of incidence relation.
The grade weight of user can be acquired previously according to user behavior, such as a kind of embodiment is if user
User 2 is set as level-one good friend by 1, then user 2 is 1 for the grade weight of user 1, if user 3 is set as two by user 1
Grade good friend, then user 3 is 0.5 for the grade weight of user 1.
Still by taking front user 1 and song A, song B, song C as an example.Assuming that existing between user 1
The user of incidence relation has user 2, user 3.Wherein there are the songs of incidence relation song A with user 2,
There are the songs of incidence relation song B with user 3, then user 1 is revised
By the above-mentioned means, the musical features of each user are modified in can gathering user, in step s 4, lead to
Cross the incidence relation in the revised musical features of user and database between the song saved and user, so that it may to song
Musical features are modified.
Specifically, in step S4, can the musical features according to the following formula to each song be modified:
Wherein M (j) ' indicates that the revised musical features of song j, U (i) ' are indicated to exist in user's set with song j and are associated with
The revised musical features of i-th of user of relationship, n indicate that there are the total numbers of users of incidence relation with song j in user's set.
For example, with song A, there are the users of incidence relation user 1 and user 2, and the revised hertz frequency of user 1 is special
Sign is [0,0,0.2,0.7,0], and the revised hertz frequency feature of user 2 is [0,0,0,0.3,0], then song A is revised
After above-mentioned processing, the musical features of available user and the musical features of song.In this way, in step
The song and recommendation by the way that similarity is met the requirements between the musical features of user on determining musical features and line are only needed in S5
To user on line, it will be able to meet the song preference demand of user on line.Since musical features can be expressed as the form of vector,
It is thus determined that the similarity between the musical features of user and the musical features of song, it is only necessary to ask European between two vectors
Distance, if the Euclidean distance between two vectors in some setting value, it may be considered that the two vectors are corresponding
Similarity between musical features is met the requirements.Here user on line, it should be the user in user's set, that is, be registered in number
According to the user in library.
Referring to FIG. 2, Fig. 2 is the flow diagram of another embodiment of the method for song recommendations in the present invention.Such as Fig. 2
Shown, in this embodiment, the step of progress feature mining, further comprises under line: step S6: judging whether termination condition is full
Foot, if it is not, then iteration executes step S2 to step S4.
Wherein, termination condition includes at least following one kind: the number of iteration reaches setting value;Or the time of iteration reaches
Setting value;Or musical features and the upper musical features taking turns iteration and obtaining that the song current iteration in the song collection obtains
Between difference be less than setting value;Or the obtained musical features of user's current iteration in user set and upper wheel iteration
The obtained difference between musical features is less than setting value.Such as the number of iterations set is 4 time, or the iteration time of setting
It is 60 seconds, then when reaching above-mentioned condition, iteration will be terminated, so that song and user obtain final music spy
Sign.Furthermore, it is to be understood that above-mentioned iterative process can make the musical features of final song and user all tend to restrain, therefore,
If the difference between the musical features that musical features that current iteration obtains (song or user) and upper wheel iteration obtain is small
When some setting value, iteration can also be stopped, so that song and user obtain final musical features.
In the present embodiment, by step S6, the musical features and use of every song in song collection are enabled to
The musical features of each user in the set of family more accurately meet mutual connection.
In the present embodiment, under line carry out song recommendations the step of be in a upper embodiment it is identical, herein no longer weigh
It is multiple.
Referring to FIG. 3, Fig. 3 is the structural schematic block diagram of one embodiment of the device of song recommendations in the present invention, such as Fig. 3
Shown, device described in the embodiment includes: feature mining module 100 and song recommendations module 200, wherein feature mining module
100 include extraction unit 101, computing unit 102, the first amending unit 103 and the second amending unit 104.
Wherein extraction unit 101, for extracting musical features to the song in song collection.Computing unit 102 is used for needle
To each user in user's set, using there are the music of the song of incidence relation spies between the user in song collection
Sign, calculates the musical features of the user.First amending unit 103, for utilizing user for each user in user's set
The musical features of song associated by other users in set between the user there are incidence relation, to the music of the user
Feature is modified.Second amending unit 104, for for every song in song collection, using user gather in this
The revised musical features of user between song there are incidence relation, are modified the musical features of the song.
Song recommendations module 200, for from choosing the sound that user is final on final musical features and line in song collection
Similarity is met the requirements between happy feature song simultaneously recommends user on line.
In one embodiment, musical features include at least following one kind: audio physical feature, lyrics physical features and song
Word theme feature.
In one embodiment, computing unit 102 calculates the musical features of each user according to the following formula:
Wherein U (j) indicates that the musical features of user j, M (i) indicate that there are incidence relations between user j in song collection
The i-th song musical features, n indicate song collection between user j there are the song of incidence relation sum.
In one embodiment, the first amending unit 103 can the musical features according to the following formula to each user repair
Just:
Wherein U (j) ' indicates that the revised musical features of user j, M (i) indicate exist between user j in song collection
The musical features of i-th song of incidence relation, v indicate that the song in song collection between user j there are incidence relation is total
Number, αpIndicate that there are the grade weight of p-th of other users of incidence relation, z expression users between user j in user's set
There are the other users of incidence relation sum, M between user j in setp(k) indicate song collection in described p-th its
There are the musical features of the kth song of incidence relation, w by his userpIt indicates to deposit in song collection with p-th of other users
In the song sum of incidence relation.
In one embodiment, the second amending unit 104 musical features to each song can carry out according to the following formula
Amendment:
Wherein M (j) ' indicates that the revised musical features of song j, U (i) ' are indicated to exist in user's set with song j and are associated with
The revised musical features of i-th of user of relationship, n indicate that there are the total numbers of users of incidence relation with song j in user's set.
In one embodiment, feature mining module 100 further comprises judging unit (not shown).The judgement list
Member is for judging whether termination condition meets, if it is not, then triggering 102 to the second amending unit of computing unit, 104 iteration executes.
Wherein, termination condition includes at least following one kind: the number of iteration reaches setting value;Or the time of iteration reaches setting value;
Or between the obtained musical features of the obtained musical features of the song current iteration in the song collection and upper wheel iteration
Difference is less than setting value;Or the musical features that user's current iteration in user's set obtains take turns what iteration obtained with upper
Difference between musical features is less than setting value.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.