NLTK SVM Classifier Terminates

nltk, python, python-2.7, svm

Solution

`nltk.classify.svm` was deprecated. For classification based on support vector machines SVMs use `nltk.classify.scikitlearn` (or scikit-learn directly).For more details NLTK 3.0 documentation

You can use `nltk.classify.scikitlearn` as follows

import nltk.classify
from sklearn.svm import LinearSVC

classifier = nltk.classify.SklearnClassifier(LinearSVC())
classifier.train(train_features)

for test_record in test_data_list:
    features = extract_features(test_record)
    predict = classifier.classify(features)
    print predict

Problem

I am using the SVM classifier built in NLTK and after training the model, when I try to classify a document, the program terminates with `Error during execution, QProcess error: 1 Execution Interrupted` I am using the following code:- ``` classifier = nltk.classify.svm.SvmClassifier.train(train_features) for test_record in test_data_list: features = extract_features(test_record) predict = classifier.classify(features) print predict ``` What could be the reason for the error?

Original source