Jump to content

Music Recommendation System for OCR


zygoth
 Share

Recommended Posts

Hi all,

I am a computer science major and am currently in a Big Data class where we do our own project. I am planning on creating a music recommendation system specific to OCR, by using some audio analysis tools and then clustering similar songs together.

In order to test the effectiveness of my approach, I need the personal libraries of some actual OCR listeners. My plan is to make a simple program that writes the filenames of all files in a directory to a text file. Volunteers would copy this file to the directory with their OCR music, run the program, and email me the text file.

If you are interested in volunteering your music library, please post on the thread. I will have the programs done within the week, and I will post links to them there. Let me know if you have any questions. Thanks!

Zygo

Edited by Liontamer
no need for dupe thread; people can post here
Link to comment
Share on other sites

I'd love to help you out, but I have some concerns. Call me paranoid, but I'm not too fond of the idea of running a program that I don't know the contents of from forum member that hasn't posted at all. Again, I'm happy to help. It just raises some red flags.

I've a few questions. What specific data are you wanting to grab from us? Just a list of the location/filenames of all the OCR tracks in our music library? If that's all, would you mind githubbing the program you'll have us run to grab data? That way we can check the source and make sure the code isn't malicious. If all you need is a list of files (and their directories) I can just write my own script, but not everyone on OCR knows how to do that.

Your project sounds interesting and I'd love to hear how you carry it out! I'm a CS student myself so I'd be really interested in your implementation.

Link to comment
Share on other sites

I'm with Koriantor on this one -- downloading a program authored by someone one doesn't know is foolish anywhere on the Internet. I'm all for helping people out, and I benefit from the assistance of this community for my own academic work, but asking someone to put a program on their computer is a big ask. I'm happy to throw my music library list to you, incidentally, but getting some code up on Github is a good suggestion.

Link to comment
Share on other sites

Hm, I understand your concerns. All I need are the filenames, so as long as those haven't been changed I could probably just do it with a 1-liner batch file. That way everybody can see what they're running.

Edited by zygoth
Link to comment
Share on other sites

for those of us with the 1-3000 OCR Torrent, we might not be that useful to you :P

"Music Recommendation System, what should I play now?"

"...Anything. Anything at all."

BTW, since all that's needed are the filenames, you really only need the dir or ls commands, like so:

dir /S /B > ocrlist.txt (Windows)

ls -R > ocrlist.txt (Linux/Mac)

Easiest way to set it up: put a makelist.bat (Windows) or makelist.sh (Linux/Mac) in your remix directory, save the command to it, then double-click to run. It's safe, quick, and effective :)

Edit: slightly more effective (the above will grab all files, not just the songs)

dir /S /B *.mp3 > ocrlist.txt

ls -R *.mp3 > ocrlist.txt

Edited by digitalxero
Link to comment
Share on other sites

Yes, that sounds great. The only thing I would add is a -1 option to the ls command so that I get one filename per line. Also, you could even do *OC_ReMix.mp3 so even if other types of songs are mixed in you only get the OCR ones. So, the commands would look like this:

dir /S /B *OC_ReMix.mp3 > ocrlist.txt (Windows)

ls -R -1 *OC_ReMix.mp3 > ocrlist.txt (Linux/Mac)

All of the songs are titled this way, right?

Link to comment
Share on other sites

Yes, that sounds great. The only thing I would add is a -1 option to the ls command so that I get one filename per line. Also, you could even do *OC_ReMix.mp3 so even if other types of songs are mixed in you only get the OCR ones. So, the commands would look like this:

dir /S /B *OC_ReMix.mp3 > ocrlist.txt (Windows)

ls -R -1 *OC_ReMix.mp3 > ocrlist.txt (Linux/Mac)

All of the songs are titled this way, right?

Yeah, that's right.

Link to comment
Share on other sites

by using some audio analysis tools and then clustering similar songs together.

Your assumption is that MIR DSP is advanced enough these days to be able to do this, and, well, it's not. :? Unless you're not using DSP and you're using user-defined tags, or internally defined tags (see last.fm, Pandora), in which case, you may want to take advantage of OCR's existing tag system, it'll make your job easier.

Edited by Neblix
Link to comment
Share on other sites

I'm not familiar with OCR's tagging system, could you explain more? When I look at my mp3s, all I see is things like Composer and Remixer, which are not really relevant to my approach. Also, some papers that I have read have led me to believe classification via DSP is possible with at least moderate success:

http://ismir2001.ismir.net/pdf/tzanetakis.pdf

http://www.cs.cmu.edu/~yh/files/GCfA.pdf

I plan on using JAudio for feature extraction and WEKA for clustering.

Link to comment
Share on other sites

I'm not familiar with OCR's tagging system, could you explain more? When I look at my mp3s, all I see is things like Composer and Remixer, which are not really relevant to my approach. Also, some papers that I have read have led me to believe classification via DSP is possible with at least moderate success:

http://ismir2001.ismir.net/pdf/tzanetakis.pdf

http://www.cs.cmu.edu/~yh/files/GCfA.pdf

I plan on using JAudio for feature extraction and WEKA for clustering.

You have to understand the data a paper is drawing conclusions from when you read it. Obviously if you test your algorithm on data of 4 *distinct* musical styles (classical, jazz, rock, country), you'll see better results because of such strong differences. However, OCR artists are more hobbyists than professionals, a lot of whom blend styles and don't follow production conventions. Additionally, most electronic music has varying timbre even if it shares style with another, so that would further confuse the algorithm. There's no such thing as a practical genre DSP classification system yet.

That is the reason for which Pandora uses professional taggers. In fact, one grad from a music tech lab I worked at is now working at Pandora, I'm assuming trying to implement strategies similar to the one you're trying to use but more optimized and complex, but we're not going to see it in use for a long while.

If you took advantage of OCR's tag system that Larry and created your recommendation system out of that, that would still be an impressive data project of its own.

You can do whatever you want, all I'm saying is you may not get the results you were hoping for if you use signal analysis methods like feature extraction and such. I'm providing this insight as I was exposed to MIR when I worked for this lab, I just wanted to let you know sort of the other side of the coin so maybe you could redefine your project if you wanted to.

Edited by Neblix
Link to comment
Share on other sites

You have to understand the data a paper is drawing conclusions from when you read it. Obviously if you test your algorithm on data of 4 *distinct* musical styles (classical, jazz, rock, country), you'll see better results because of such strong differences. However, OCR artists are more hobbyists than professionals, a lot of whom blend styles and don't follow production conventions. Additionally, most electronic music has varying timbre even if it shares style with another, so that would further confuse the algorithm. There's no such thing as a practical genre DSP classification system yet.

That is the reason for which Pandora uses professional taggers. In fact, one grad from a music tech lab I worked at is now working at Pandora, I'm assuming trying to implement strategies similar to the one you're trying to use but more optimized and complex, but we're not going to see it in use for a long while.

If you took advantage of OCR's tag system that Larry and created your recommendation system out of that, that would still be an impressive data project of its own.

You can do whatever you want, all I'm saying is you may not get the results you were hoping for if you use signal analysis methods like feature extraction and such. I'm providing this insight as I was exposed to MIR when I worked for this lab, I just wanted to let you know sort of the other side of the coin so maybe you could redefine your project if you wanted to.

I'm going to phrase this in a slightly different way for the OP. The problem as originally stated sounds like a research project for a masters student (or potentially a PhD dissertation; I'm not as up on the research as I should be) -- because the software you want to use to do what you want to do doesn't function at the level you want it to function.

Regardless, you don't need to know people's libraries for this. You have every (non-rescinded) OCR track, and you should be able to map some random track to the feature space described by your classifier.

Link to comment
Share on other sites

How complete is the tagging database? If it was mostly complete I would consider using it instead of DSP. I appreciate your comments about the possibility of my project. I feel I'm trying to solve an easier problem even than 4-genre classification though, because I'm not trying to classify songs by genre, only find pairs of songs with similar features. The final output of my audio analysis would be a list of pairs of similar songs, which the recommender would use to find songs that are similar to songs a user has already downloaded.

Link to comment
Share on other sites

How complete is the tagging database? If it was mostly complete I would consider using it instead of DSP. I appreciate your comments about the possibility of my project. I feel I'm trying to solve an easier problem even than 4-genre classification though, because I'm not trying to classify songs by genre, only find pairs of songs with similar features. The final output of my audio analysis would be a list of pairs of similar songs, which the recommender would use to find songs that are similar to songs a user has already downloaded.

This complete. :lol:

He means this tagging system for genre/mood/instrumentation descriptors: http://ocremix.org/forums/tags.php - It's not complete, but we've been working on populating tags for ReMixes that way. We'll be working on completing these tags for all ReMixes in the actual site database.
Link to comment
Share on other sites

How complete is the tagging database? If it was mostly complete I would consider using it instead of DSP. I appreciate your comments about the possibility of my project. I feel I'm trying to solve an easier problem even than 4-genre classification though, because I'm not trying to classify songs by genre, only find pairs of songs with similar features. The final output of my audio analysis would be a list of pairs of similar songs, which the recommender would use to find songs that are similar to songs a user has already downloaded.

It's not an uncommon line of thinking, in fact it means that you're on the right track.

However, keep in mind that while you may be *comparing* features correctly, what these features *actually are* are a different story. At the very most, you'd be pairing songs with similar timbres, and that's about the extent of it. However, that's not quite a useful recommendation system, as users look for a lot more in similar music than just the spectral make-up (mood, tempo, lots of melodies or lots of solos, simple tonality or complex tonality, types of instruments, etc.). I'm not saying your system won't work at all, I'm just saying be wary of its limitations. I'm recommending avoiding DSP because tagging would give you a system with far more pleasing results, and something that could be legitimately used by OCR goers.

Edited by Neblix
Link to comment
Share on other sites

From what I understand, he wants to verify the effectiveness of his algorithm.

The way he is planning to do this is by operating under the assumption that people's personal libraries are sort of the "optimal" case, because people will only have similar songs in their own library. @Zygoth Unfortunately, this assumption fails in many cases, because people may be storing the entirety of the OCR catalog, or near, because they don't want only the music that sounds similar. Many people just download the whole catalog just to have it (I have it all, but I've listened to maybe less than 200 remixes, I'm definitely not the only one. :P)

Edited by Neblix
Link to comment
Share on other sites

Is there any easy way to extract the tags for each song in the database? I didn't know what I was looking at when I first looked at the tag page. o.O It looks like there is a lot of information there, I would be willing to try tags if I can figure how to get all the data.

I hadn't thought about the problem the torrents would present, I guess I just assumed most people downloaded songs one at a time to their library like me. I may have to use a more subjective method of validating my program, like surveys/feedback from the OCR community.

Link to comment
Share on other sites

Is there any easy way to extract the tags for each song in the database? I didn't know what I was looking at when I first looked at the tag page. o.O It looks like there is a lot of information there, I would be willing to try tags if I can figure how to get all the data.

Welcome to Big Data. If you are able to get to the data (which your comment indicates), it's not clear what you need help with.

Link to comment
Share on other sites

Is there any easy way to extract the tags for each song in the database? I didn't know what I was looking at when I first looked at the tag page. o.O It looks like there is a lot of information there, I would be willing to try tags if I can figure how to get all the data.

I hadn't thought about the problem the torrents would present, I guess I just assumed most people downloaded songs one at a time to their library like me. I may have to use a more subjective method of validating my program, like surveys/feedback from the OCR community.

Rather, I think you'll find it easier to scan the tag lists for the ReMixes under each tag. In theory, these tags should have overlapping results, giving you more precise information to work with, akin to the way Pandora has its massive network of tags.

So if you want something that's downtempo, jazzy, and contains acoustic guitar, strings, and saxophone, you search these tags and find overlapping results. Rather rudimentary compared to Pandora's crazy system, but it's a start.

And to answer your question, the tags are pulled from the corresponding comments thread for each remix. As far as I can tell, there are no tags directly on the */remix/OCRXXXXX/ pages.

Edited by Anorax
Link to comment
Share on other sites

So I've finished creating a file with a list of all the songs and their corresponding tags. I have a few questions:

What do these tags mean: compo, compo-dod

Should I ignore these tags as irrelevant: resub, collab

What regex would you recommend I use to extract the title only from a string like this: Majora's Mask 'Serious Moon Business' ? My simple regex '.*' gets: 's Mask 'Serious Moon Business' because of the extra apostrophe in the game's title.

Where can I see a list of all the tags, not just the top 70?

Other notes: There are currently about 5,000 tag-song pairs when extracting the top 70 tags. Almost all of them are for OCR1000-3000 and not any of the earlier songs. I haven't looked at the distribution, but on average we're talking 2-3 tags per tagged song, and 1000 songs with no tag info at all. This seems a little sparse to make a good recommender, but maybe when I add in all the tags that aren't in the top 70 it will get better. At any rate, I can make a system that will update automatically (barring any major site overhauls) so that as tags accumulate over time the recommender will use the new data.

After thinking about the project a bit more, I think the recommender might work best as a sort of Amazon-style "Items Bought Together" section on song pages. On each page there would be a "Similar Songs" section with the 5 songs that share the most tags with the song on the page. This would obviously require djpretzel(or whoever he has delegated to run the site)'s permission. I have no idea how likely he would be to give it.

Edited by zygoth
Link to comment
Share on other sites

Somebody else will have to answer the rest of your questions, but:

"What do these tags mean: compo, compo-dod" - Tracks that originally came from competitions (such as anything in here) and were subbed to OCR later on, with the latter tag being stuff specifically coming from the Dwelling of Duels compo.

"Should I ignore these tags as irrelevant: resub, collab" - For the purposes of your project here, yeah. A track that was submitted to OCR at least twice before passing the bar and a track that had multiple people involved shouldn't have any extra weight in a recommendation system. Well, I guess the latter might affect a system based specifically on how popular individual artists are, but I'm not sure that's what you're going for here.

Link to comment
Share on other sites

What do these tags mean: compo, compo-dod

Should I ignore these tags as irrelevant: resub, collab

What regex would you recommend I use to extract the title only from a string like this: Majora's Mask 'Serious Moon Business' ? My simple regex '.*' gets: 's Mask 'Serious Moon Business' because of the extra apostrophe in the game's title.

Where can I see a list of all the tags, not just the top 70?

What you probably want is to grab everything from between the last two apostrophes (set song name) and everything before the second to last apostrophe (set game name).

You should be able to look up how to do this in the man pages of whatever regex lib you're using.

Link to comment
Share on other sites

Hey everybody, just wanted to update you on how the project is going. I have a basic recommendation system working now, which rates songs' similarity by how many tags they have in common. I've put the code on github, mostly just so you can look through the recommendation files if you're interested. Here is some sample output (first the similar song, then the tags they have in common).

For the song "A Different Kind of Peace":

Then the Healing Came orchestral,strings,cinematic

Shield of Legend orchestral,epic,cinematic

Justice for All orchestral,epic,cinematic

Captain of the Skies orchestral,epic,strings,cinematic

Enemy Underworld orchestral,epic,strings,cinematic

For the song "Adlehyde Castle Flow":

Insecta Robotica mellow,jazz,electric-piano

This Heart percussion,mellow,tempo-slow

Gemini Salsa percussion,jazz,tempo-slow

Holiday Frappe mellow,jazz,electric-piano

Fighting (7/8 Jazz Spiritual) mellow,jazz,electric-piano

There is still a real sparsity of tags--only 1,306 songs even have one tag, and only about half of those have more than one. My next move is to incorporate Remixer and source-game as tags, by extracting the meta-data from the MP3s. That should help, but it seems like to be successful the tag-based system needs more data. Once again, does anybody know how to see a list of all the tags in the system, not just that page with the top 70?

EDIT: forgot the github link... https://github.com/zygoth/OCR-Music-Recommendation-System/tree/master/

Edited by zygoth
forgot to add the link
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...