Does it have to be an SVM? NTLK has built-in tools to do POS tagging: Categorizing and Tagging Words
If you want to use a custom classifier, look here: http://www.nltk.org/api/nltk.classify.html, Ctrl+F "svm", NTLK provides a wrapper for scikit-learn algorithms called SklearnClassifier
. Then take a look here http://www.nltk.org/api/nltk.tag.html, Ctrl+F "classifier", there is a class nltk.tag.sequential.ClassifierBasedPOSTagger
which apparently can use wrapped up classifiers from sklearn.
I haven't tried this but it might work.
EDIT:
It should work like this:
from nltk.classify import SklearnClassifier
from sklearn.svm import SVC
clf = SklearnClassifier(SVC(),sparse=False)
cpos = nltk.tag.sequential.ClassifierBasedPOSTagger(train=train_sents,classifier_builder
= lambda train_feats: clf.train(train_feats))
The only problem is that sklearn classifiers take numerical features only, so you need to convert yours somehow.