Nltk: 动词语料库已过期

创建于 2018-05-05  ·  13评论  ·  资料来源: nltk/nltk

nltk数据索引(https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/index.xml)将verbnet指向版本2.1。 最新的verbnet定义为3.2。

最新版本更新了框架说明,这些描述提供了有关短语结构的更多信息。 例如,最新版本中类future_having-13.3的框架的主要描述是NP V NP-Dative NP ,将框架的结构描述为(名词短语,动词,名词短语(dative),名词-短语),而在2.1版中,它只会读取Dative

bug corpus enhancement nltk_data

最有用的评论

@alvations
它确实可以满足我的用途。 让我向您展示我的代码:

import nltk
v3 = nltk.corpus.util.LazyCorpusLoader(
    'verbnet3', nltk.corpus.reader.verbnet.VerbnetCorpusReader,
    r'(?!\.).*\.xml')
v3.classids('add') # returns ['mix-22.1-2', 'multiply-108', 'say-37.7-1']

为此,您需要从此处下载verbnet3 。 将此文件解压缩到文件夹~/nltk_data/corpora~. When unzipped it should create a new folder 〜/ nltk_data / corpora / verbnet3 which contains all the Verbnet3 definitions. Then you should be able to run the code above. Notice that for Verbnet 2 (the default) the code v3.classids('add')`中只会返回第一类(mix-22.1-2)。

既然这基本上就是我使用Verbnet3的全部功能,因为我还没有测试其他API,但是classids方法已经用不同的单词测试过,并且它们都可以工作。 我希望这有帮助!

所有13条评论

@agodbehere ,感谢您报告此问题。 我已经验证了现有的verbnet 2语料库阅读器会破坏verbnet 3数据,因此两者都需要在语料库集合中彼此并存。

下一步是让某人贡献相应的语料库阅读器nltk.corpus.verbnet3 ,希望可以共享一些现有代码。

我们需要一段时间支持。

@stevenbird ,您发现将现有的语料库阅读器与verbnet 2一起使用会遇到什么破例? 更新语料库后,我没有运行测试套件,但是对于我的用例(请求类ID和框架),现有的语料库阅读器工作正常。

动词网络3存在问题。我们需要使用其他语料库阅读器
那。

2018年5月16日,星期三,上​​午10:45,安德鲁·戈德贝里[email protected]
写道:

@stevenbird https://github.com/stevenbird ,你是什么破案
查找将现有的语料库阅读器与verbnet 2配合使用? 我没有跑
更新语料库之后的测试套件,但针对我的用例(请求
类和框架),现有的语料库阅读器就可以正常工作。


您收到此邮件是因为有人提到您。
直接回复此电子邮件,在GitHub上查看
https://github.com/nltk/nltk/issues/2015#issuecomment-389363521或静音
线程
https://github.com/notifications/unsubscribe-auth/AADYbsgbjtFTKsyamRPG0OpJuWnF3UJ0ks5ty33DgaJpZM4Tzc0d

@stevenbird @agodbehere嗨,我在CU Boulder从事VerbNet项目,很高兴为VerbNet 3+的语料库阅读器贡献和维护代码。

@amosleokim :谢谢,不客气!

你可以看到,我们有verbnet (2)和verbnet3的数据在这里

我建议我们在此处verbnet3添加一个条目

然后找出如何扩展verbnet.py以支持verbnetverbnet3

听起来怎么样? 我们需要同时支持和(最终)弃用动词网络2。

我们有一个NLTK松弛频道,可以在必要时讨论详细信息。 谢谢!

@stevenbird对我来说听起来不错! 如果您可以向我发送邀请代码到松弛频道,我将继续前进,以便我们从精髓入手。

在这个话题上有什么进展吗? 我正在尝试使用verbnet进行研究,从classids方法获得的输出似乎很奇怪

感谢@stevenbird ,旧版本似乎是问题的原因。 我能够手动下载verbnet3.zip并使用nltk中的verbnet 2.1的阅读器进行阅读。

@salompas就像再次检查一样,NLTK中的verbnet API是否可以与verbnet3一起使用?

@alvations
它确实可以满足我的用途。 让我向您展示我的代码:

import nltk
v3 = nltk.corpus.util.LazyCorpusLoader(
    'verbnet3', nltk.corpus.reader.verbnet.VerbnetCorpusReader,
    r'(?!\.).*\.xml')
v3.classids('add') # returns ['mix-22.1-2', 'multiply-108', 'say-37.7-1']

为此,您需要从此处下载verbnet3 。 将此文件解压缩到文件夹~/nltk_data/corpora~. When unzipped it should create a new folder 〜/ nltk_data / corpora / verbnet3 which contains all the Verbnet3 definitions. Then you should be able to run the code above. Notice that for Verbnet 2 (the default) the code v3.classids('add')`中只会返回第一类(mix-22.1-2)。

既然这基本上就是我使用Verbnet3的全部功能,因为我还没有测试其他API,但是classids方法已经用不同的单词测试过,并且它们都可以工作。 我希望这有帮助!

@Salompas嗨,谢谢您的解决方案! 您的“ verbnet3”是哪个版本的verbnet3? 是3.3版还是3.2版?

@Salompas嗨,谢谢您的解决方案! 您的“ verbnet3”是哪个版本的verbnet3? 是3.3版还是3.2版?

嘿@ songhee-kim,距我从事此工作已经2年了,所以我不知道确切的版本。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

ndvbd picture ndvbd  ·  4评论

stevenbird picture stevenbird  ·  4评论

alvations picture alvations  ·  4评论

libingnan54321 picture libingnan54321  ·  3评论

alvations picture alvations  ·  3评论