NLTK does not seem to have a cross validation method.
I was trying to develop an Hidden Markov Model (HMM) based tagger in NLTK. I found a previous post on related topic. Based on the answers here if I try to write it as,
cv = cross_validation.KFold(len(train_corp), n_folds=10,shuffle=False)
for traincv, testcv in cv:
hmm_tagger=nltk.HiddenMarkovModelTagger.train(train_corp[traincv[0]:traincv[len(traincv)-1]])
evaluation=hmm_tagger.evaluate(train_corp[testcv[0]:testcv[len(testcv)-1]])
print evaluation
am I going fine?
If any one may kindly suggest.