mini_grammar = ContextFreeGrammar(Nonterminal('S'), treebank.parsed_sents()
    [0].productions())
parser = nltk.parse.EarleyChartParser(mini_grammar)
print(parser.parse(treebank.sents()[0]))
How do I get a set of grammar rules from Penn Treebank using python & NLTK?