pipeline = make_pipeline(CountVectorizer(), FunctionTransformer(lambda x: x
    .todense(), accept_sparse=True), RandomForestClassifier())
Scikit-Learn's Pipeline: A sparse matrix was passed, but dense data is required