diff --git a/src/documents/classifier.py b/src/documents/classifier.py index b577997e3..47dd7dfc7 100755 --- a/src/documents/classifier.py +++ b/src/documents/classifier.py @@ -95,9 +95,6 @@ class DocumentClassifier(object): pickle.dump(self.document_type_classifier, f) def train(self): - from sklearn.feature_extraction.text import CountVectorizer - from sklearn.neural_network import MLPClassifier - from sklearn.preprocessing import MultiLabelBinarizer, LabelBinarizer data = list() labels_tags = list() @@ -162,6 +159,10 @@ class DocumentClassifier(object): ) ) + from sklearn.feature_extraction.text import CountVectorizer + from sklearn.neural_network import MLPClassifier + from sklearn.preprocessing import MultiLabelBinarizer, LabelBinarizer + # Step 2: vectorize data logger.debug("Vectorizing data...") self.data_vectorizer = CountVectorizer(