Ask YC: How would you do keyword classification
I'm trying to automate the classification of documents that we are seeing from our crawler. I have done a google search for keyword classification using Python but I'm not getting any joy. Anyone here automatically tagging or classifying documents (Maybe after some teaching) ? Would be good to know how if you are
20 comments
[ 3.5 ms ] story [ 59.0 ms ] threadthe current state of the art algorithms are based on support vector machines, but their learning part could be tricky to implement in a scalable fashion. if you are looking for a quick and dirty approach, TFIDF algorithm (it is a naive "naive Bayes" :) is simple and is adequate for many applications
KVM (support vector machines) so far is considered the best classification algorithm.
In the spirit of accuracy, SVM algorithms aren't _the best_. The best algorithms are ensemble-based, incorporating SVM and alternatives.
http://developer.yahoo.com/search/content/V1/termExtraction....
http://opencalais.com/
http://nltk.org/index.php
Email me if you have any questions-I've been playing with this stuff for a while and it's really interesting.
1. You already have a set of keywords (categories) that the document can belong to. The objective is to match a document to its category. This is true classification.
2. You want to extract relevant keywords from a document. This is not classification in the true sense but keyword extraction.
Each one has different approaches to achieve it, but they are similar problems. (As an example of similarity: you have a set of categories each defined by a tag cloud. You extract keywords from a document and see which tag cloud it matches best.)
So how do you do each one?
Classification: I'm not well versed in this area and I'm interested in learning - it's next on my to-do list.
Keyword Extraction: Yahoo! has an API to do that, but honestly, it's rubbish. I don't know how it "works" but it doesn't really. Open Calais is really good but has a noticeable error rate (I didn't quantify it but after trying many documents with it, I regularly noticed minor mistakes).
Hope this helps.
http://news.ycombinator.com/item?id=124085
It's based on a Bayesian algorithm plus a bunch of other heuristics for fine-tuning. In our case, the classification algorithm is not nearly as important as how we select documents for the training set.
Also, take a look at this post that was mentioned here a few days ago:
More data usually beats better algorithms: http://anand.typepad.com/datawocky/2008/03/more-data-usual.h...
- classification (also known as categorization) - you have a set of categories into which you expect your documents to be assigned to (the documents will be matched with the existing categories)
- clustering - you expect the algorithm to give you a set of categories (the ML algorithms will find similarities between the several documents and will group them accordingly)
And http://opencalais.com/
There are a lot of things to have in mind when trying to do document classification with keywords. Document preprocessing, keyword weighting and much more.
Someone mentioned Latent Semantic Indexing, it's worth a look, but if you're just starting, you should look at the big picture.