Guardar el clasificador entrenado Bayes ingenuo en NLTK
Estoy un poco confundido con respecto a cómo salvar a un clasificador entrenado. Al igual que en, volver a entrenar a un clasificador cada vez que quiero usarlo es obviamente muy malo y lento, ¿cómo lo guardo y lo vuelvo a cargar cuando lo necesito? El código está abajo, gracias de antemano por su ayuda. Estoy usando Python con NLTK Naive Bayes Classifier.
classifier = nltk.NaiveBayesClassifier.train(training_set)
# look inside the classifier train method in the source code of the NLTK library
def train(labeled_featuresets, estimator=nltk.probability.ELEProbDist):
# Create the P(label) distribution
label_probdist = estimator(label_freqdist)
# Create the P(fval|label, fname) distribution
feature_probdist = {}
return NaiveBayesClassifier(label_probdist, feature_probdist)