After fitting with tfidf, I'm looking at the features that were generated:
from sklearn.feature_extraction.text import TfidfVectorizer
corpus = [
'This is the first document.',
'This document is the second document.',
'And this is the third one.',
'Is this the first document?',
]
vectorizer = TfidfVectorizer()
X = vectorizer.fit_transform(corpus)
print(vectorizer.get_feature_names_out())
but I want to get the frequency of each term as well
One way to "count the number of sentences a particular word appears in" is to use
sklearn.feature_extraction.text.CountVectorizer.