1from nltk.data import find
2from bllipparser import RerankingParser
3
4model_dir = find('models/bllip_wsj_no_aux').path
5parser = RerankingParser.from_unified_model_dir(model_dir)
6
7best = parser.parse("The old oak tree from India fell down.")
8
9print(best.get_reranker_best())
10print(best.get_parser_best())
1-80.435259246021 -23.831876011253 (S1 (S (NP (NP (DT The) (JJ old) (NN oak) (NN tree)) (PP (IN from) (NP (NNP India)))) (VP (VBD fell) (PRT (RP down))) (. .)))
2-79.703612178593 -24.505514522222 (S1 (S (NP (NP (DT The) (JJ old) (NN oak) (NN tree)) (PP (IN from) (NP (NNP India)))) (VP (VBD fell) (ADVP (RB down))) (. .)))