tf_vectorizer = CountVectorizer(strip_accents = 'unicode',
max_features=n_features,
stop_words='english',
max_df = 0.5,
min_df = 10)
tf = tf_vectorizer.fit_transform(df.content_cutted)
运行结果
NameError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8172/3651868830.py in <module>
1 tf_vectorizer = CountVectorizer(strip_accents = 'unicode',
----> 2 max_features=n_features,
3 stop_words='english',
4 max_df = 0.5,
5 min_df = 10)
NameError: name 'n_features' is not defined