English grammar for parsing in NLTK

后端 未结 8 872
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 20:02

Is there a ready-to-use English grammar that I can just load it and use in NLTK? I\'ve searched around examples of parsing with NLTK, but it seems like that I have to manual

8条回答
  •  青春惊慌失措
    2020-11-29 21:03

    Use the MaltParser, there you have a pretrained english-grammar, and also some other pretrained languages. And the Maltparser is a dependency parser and not some simple bottom-up, or top-down Parser.

    Just download the MaltParser from http://www.maltparser.org/index.html and use the NLTK like this:

    import nltk
    parser = nltk.parse.malt.MaltParser()
    

提交回复
热议问题