max_sim = -1.0
best_pair = None, None
for synset_1 in synsets_1:
for synset_2 in synsets_2:
sim = wn.path_similarity(synset_1, synset_2)
print (sim)
if sim > max_sim:
max_sim = sim
best_pair = synset_1, synset_2
通过使用nltk包,代码是余弦相似性,我能够执行并查看IDLE中的输出。但是在jupyter笔记本电脑中' sim'正在展示一些“无”#39;值