相关疑难解决方法(0)

如何在python nltk和wordnet中获得单词/ synset的所有下位词?

我有一个wordnet中所有名词的列表,现在我想只留下车辆中的单词并删除其余的单词.我该怎么做?下面是我想要的伪代码,但我不知道如何使其工作

for word in wordlist:
  if not "vehicle" in wn.synsets(word):
    wordlist.remove(word)
Run Code Online (Sandbox Code Playgroud)

python nltk wordnet

8
推荐指数
2
解决办法
9544
查看次数

标签 统计

nltk ×1

python ×1

wordnet ×1