这是一些其他的用法,包括
- 共同上位词
- 词集深度
- 词集相似度
- 相似词集
用法与示例
from nltk.corpus import wordnet as wn
word = wn.synsets("word") # 同义词集
print("word词集的第一个释义::", word[0])
print("word词集的第一个释义的词集深度:", word[0].min_depth())
print("word词集的第一个释义与第二个释义的最低共同上位", word[0].lowest_common_hypernyms(word[1]))
print("word词集的第一个释义与第二个释义的词集相似度:", word[0].path_similarity(word[1]))
print("与beautiful的第1个词集相似的词:", wn.synsets("beautiful")[0].similar_tos())