text_plain_output_1.png
from sklearn.feature_extraction.text import TfidfVectorizer

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

root_path = '/kaggle/input/medieval-chant-corpus'
df_path = f'{root_path}/mh-corpus.json'
df = pd.read_json(df_path)
df.drop(['rawTextMusic', 'rawText'], axis=1, inplace=True)

from sklearn.feature_extraction.text import TfidfVectorizer
maxx_features = 2 ** 12
vectorizer = TfidfVectorizer(max_features=maxx_features)
X = vectorizer.fit_transform(df['music_as_words'].values)

vectorizer.get_feature_names()[:10]