I have a set of texts of wikipedia.
Using tf-idf, I can define the weight of each word.
Below is the code:
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer
wiki = pd.read_csv('people_wiki.csv')
tfidf_vectorizer = TfidfVectorizer(max_features= 1000000)
tfidf = tfidf_vectorizer.fit_transform(wiki['text'])
The goal is to see the weights like shown in the tf-idf column:
The file 'people_wiki.csv' is here:
