From 25081175533fca2f97142c66e012ed15c21cef2e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 16 Oct 2016 17:58:37 +0200 Subject: [PATCH] Make train_parser example a bit simpler. --- examples/training/train_parser.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/examples/training/train_parser.py b/examples/training/train_parser.py index 5850a91a5..240c7d9af 100644 --- a/examples/training/train_parser.py +++ b/examples/training/train_parser.py @@ -59,11 +59,7 @@ def main(model_dir=None): parser = train_parser(nlp, train_data, sorted(left_labels), sorted(right_labels)) doc = nlp.make_doc(['I', 'like', 'securities', '.']) - with parser.step_through(doc) as state: - while not state.is_final: - action = state.predict() - state.transition(action) - #parser(doc) + parser(doc) for word in doc: print(word.text, word.dep_, word.head.text)