In my scikits-learn Pipeline, I would like to pass a custom dictionary to CountVectorizer ():
text_classifier = Pipeline([
('count', CountVectorizer(vocabulary=myvocab)),
('tfidf', TfidfTransformer()),
('clf', LinearSVC(C=1000))
])
However, as I understand it, when I call
text_classifier.fit(X_train, y_train)
Pipeline uses the fit_transform () method of CountVectorizer (), which ignores myvocab. How can I change my pipeline to use myvocab? Thank!
source
share