在 nltk wordnet 中找不到短语,但通过 princeton wordnetweb 在线搜索找到

phrase not found in nltk wordnet but found via the princeton wordnetweb online search

这可能是愚蠢的,但我似乎无法通过 wn.synsets('wheeled vehicle') 找到像 "wheeled vehicle" 这样的词(wn 通过 from nltk.corpus import wordnet as wn 创建)--- returns空数组,但我可以在 princeton wordnetweb online search

上找到它

有人知道我错过了什么吗?或者推荐更好的库?

谢谢!

对于多词引理,使用下划线代替空格。

>>> from nltk.corpus import wordnet as wn

# Retrieve the synsets that're associated with lemma "wheeled vehicle"
>>> wn.synsets('wheeled_vehicle')
[Synset('wheeled_vehicle.n.01')]

>>> wn.synsets('wheeled_vehicle')[0].definition()
u'a vehicle that moves on wheels and usually has a container for transporting things or people'

要直接访问同义词集,您需要知道同义词集的 POS 和词元索引:

>>> wn.synset('wheeled_vehicle.n.01')
Synset('wheeled_vehicle.n.01')