代码之家  ›  专栏  ›  技术社区  ›  sholsapp

Does NLTK have a tool for dependency parsing?

  •  15
  • sholsapp  · 技术社区  · 14 年前

    到目前为止,NLTK似乎是最好的选择,但我不知道如何解析语法依赖项。也就是说,这是斯坦福解析器的一个例子。我希望能够在Ntlk中使用原始句子“我要切换到python”中的python生成此内容:

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

    有人能给我一个正确的方向来分析语法依赖吗?

    1 回复  |  直到 8 年前
        1
  •  13
  •   dmcer    14 年前

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

    The pretrained English model for the MaltParser that's available here 解析为斯坦福基本依赖关系表示。但是,您仍然需要调用斯坦福的javanlp代码来将基本依赖项转换为上面在示例分析中给出的ccprocessed表示。