Calculul similarității cântecelor Pink Floyd
În acest exercițiu final, ți s-au oferit versurile a trei cântece ale trupei britanice Pink Floyd: „High Hopes", „Hey You" și „Mother". Versurile acestor cântece sunt disponibile ca hopes, hey și respectiv mother.
Sarcina ta este să calculezi similaritatea pereche dintre mother și hopes, și dintre mother și hey.
Acest exercițiu face parte din cursul
Ingineria caracteristicilor pentru NLP în Python
Instrucțiuni pentru exercițiu
- Creează obiecte
Docpentrumother,hopesșihey. - Calculează similaritatea dintre
motherșihopes. - Calculează similaritatea dintre
motherșihey.
Exercițiu interactiv practic
Încearcă acest exercițiu completând acest cod de exemplu.
# 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.____(____))