tfidf = TfidfVectorizer(preprocessor=lambda x: x, tokenizer=lambda x: x)
tfidf_matrix = tfidf.fit_transform(corpus)
Scikit Learn - Calculating TF-IDF from a corpus of arrays of features instead of from a corpus of raw documents