NLTK 有依赖解析的工具吗? [英] Does NLTK have a tool for dependency parsing?

查看:24
本文介绍了NLTK 有依赖解析的工具吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个 NLP 应用程序,并且在我的大部分解析工作中一直使用斯坦福解析器,但我想开始使用 Python.

I'm building a NLP application and have been using the Stanford Parser for most of my parsing work, but I would like to start using Python.

到目前为止,NLTK 似乎是最好的选择,但我不知道如何解析语法依赖项.IE.这是斯坦福解析器的一个例子.我希望能够使用原始句子我正在切换到 Python."中的 Python 在 NTLK 中生成这个:

So far, NLTK seems like the best bet, but I cannot figure out how to parse grammatical dependencies. I.e. this is an example from the Stanford Parser. I want to be able to produce this in NTLK using Python from the original sentence "I am switching to Python.":

nsubj(switching-3, I-1)
aux(switching-3, am-2)
prep_to(switching-3, Python-5)

谁能告诉我解析语法依赖的正确方向?

Can anyone give me a shove in the right direction to parse grammatical dependencies?

推荐答案

NLTK 包括对使用 MaltParser,请参阅 nltk.parse.malt.MaltParser.

NLTK includes support for using the MaltParser, see nltk.parse.malt.MaltParser.

可用的 MaltParser 的预训练英语模型此处 解析为斯坦福基本依赖表示.但是,您仍然需要调用斯坦福的 JavaNLP 代码将基本依赖项转换为上面示例解析中给出的 CCprocessed 表示.

The pretrained English model for the MaltParser that's available here parses to the Stanford basic dependency representation. However, you would still need to call Stanford's JavaNLP code to convert the basic dependencies to the CCprocessed representation given above in your example parse.

这篇关于NLTK 有依赖解析的工具吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆