如何将旧版本Wordnet (具体为1.6)的synsets偏移量映射到当前版本(3.0),最好使用NLTK?
例如,在1.6中,wrath的偏移量为5588321,而3.0的偏移量为7516905。
我的主要需求是实现Wordnet-Affect http://wndomains.fbk.eu/wnaffect.html,不幸的是它使用了1.6版本。
我确实设法在https://github.com/clemtoy/WNAffect上找到了一个存储库,多亏了它,我才能成功地使用数据库,该数据库确实为使用Wordnet影响的需求提供了解决方案,但它没有映射同义词集来实现它。
在Wordnet 3.0中获取偏移,nltk
wn.synset('wrath.n.01').offset()
7516905编辑:
从Wordnet 1.6的id中获取同义词集的名称也会起作用。
EDIT2:
下面是信息的确切存储方式。这是一个很小的子集-
<noun-syn id="n#05588321" categ="wrath"/>
<noun-syn id="n#05576115" categ="worship"/>
<noun-syn id="n#05600844" categ="world-weariness"/>
<noun-syn id="n#05582577" categ="wonder"/>
<noun-syn id="n#05600968" categ="woe"/>
<noun-syn id="n#05579569" categ="withdrawal"/>
<noun-syn id="n#05604301" categ="weight"/>
<noun-syn id="n#05601315" categ="weepiness"/>
<noun-syn id="n#05574157" categ="weakness"/>
<noun-syn id="n#05611809" categ="warpath"/>这些ids都是过期的WN1.6 ids
发布于 2016-08-22 04:47:55
既然没有人建议一个捷径,听起来你需要以显而易见的方式来做:启动1.6 Wordnet并自己将偏移量转换为同义词集。你可以在this page.上找到WordNet1.6版的官方下载
我不知道他们如何努力保持向后兼容性,但希望wrath.n.01在所有版本的Wordnet中或多或少都是一样的。我猜有些词义在不同版本之间被分成了两个或更多个同义词集,甚至可能偶尔会出现相反的情况。在这种情况下,不会有与原始同义词集完全对应的东西。这是否对你来说是一个问题,由你来决定。
https://stackoverflow.com/questions/38853772
复制相似问题