English grammar for parsing in NLTK

后端 未结 8 873
没有蜡笔的小新
没有蜡笔的小新 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:00

    There is a Library called Pattern. It is quite fast and easy to use.

    >>> from pattern.en import parse
    >>>  
    >>> s = 'The mobile web is more important than mobile apps.'
    >>> s = parse(s, relations=True, lemmata=True)
    >>> print s
    
    'The/DT/B-NP/O/NP-SBJ-1/the mobile/JJ/I-NP/O/NP-SBJ-1/mobile' ... 
    

提交回复
热议问题