Pink Floydの楽曲の類似度を計算する
この最後の演習では、イギリスのバンド Pink Floyd の3曲、'High Hopes'、'Hey You'、'Mother' の歌詞が与えられています。これらの歌詞はそれぞれ hopes、hey、mother として利用できます。
あなたのタスクは、mother と hopes、そして mother と hey のペアごとの類似度を計算することです。
この演習はコースの一部です
Pythonで学ぶNLPの特徴量エンジニアリング
演習の手順
mother、hopes、heyのDocオブジェクトを作成します。motherとhopesの類似度を計算します。motherとheyの類似度を計算します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Create Doc objects
mother_doc = nlp(____)
hopes_doc = nlp(____)
hey_doc = nlp(hey)
# Print similarity between mother and hopes
print(mother_doc.____(hopes_doc))
# Print similarity between mother and hey
print(mother_doc.____(____))