Build a weekly or monthly updated corpus of existing reddit entries along with the tripped html page targeted by the url and use the subreddit category as label (a farm of python crawlers with the HTML parser of lxml can be quite handy for that task).
Then for each entry extract sparse features vectors such as the log-TF-IDF, bi-grams, ... then train a classifier model on that data (linear support vector machines with an online learning implementation would do for instance).
It might not be necessary to make a SVM. I predict normalizing vector lengths and using k-nearest neighbors or just the closest average subreddit will work fine. This would also help get around the problem of low training data for new or infrequently used reddits.
We could even use similar methods to cluster subreddits. There may be obvious ways to divide large subreddits into two smaller subreddits.
I think that bigrams may be computationally expensive, relative to the minimal advances in accuracy they'd provide. This hypothesis is based on my view that subreddits are highly stratified, and many are well-defined in terms of one or two proper nouns. For example, my subreddits could be easily decided on the basis of the terms Haskell, Python, tomato, apple, Contador, Armstrong, and maybe recession.
I'm extrapolating a bit from my own usage patterns, but I don't know that that's inaccurate. I wouldn't argue against trying n-grams, but I think they wouldn't buy that much in terms of additional insight; then again, they might help solve the Christianity versus Athiesm subreddit issue.
View all comments
4
u/ogrisel Aug 02 '09
Build a weekly or monthly updated corpus of existing reddit entries along with the tripped html page targeted by the url and use the subreddit category as label (a farm of python crawlers with the HTML parser of lxml can be quite handy for that task).
Then for each entry extract sparse features vectors such as the log-TF-IDF, bi-grams, ... then train a classifier model on that data (linear support vector machines with an online learning implementation would do for instance).
The trending fast online classifier implementation is the Vowpal Wabbit by the Yahoo Research machine learning team: http://github.com/JohnLangford/vowpal_wabbit/