From 00435d8f0cc906878cd6084c78c17cbc5a49b66e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 5 Nov 2017 14:39:57 +0100 Subject: [PATCH] Add extra beam parsing test --- spacy/tests/parser/test_beam_parse.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/spacy/tests/parser/test_beam_parse.py b/spacy/tests/parser/test_beam_parse.py index dd77c6805..59e307bcb 100644 --- a/spacy/tests/parser/test_beam_parse.py +++ b/spacy/tests/parser/test_beam_parse.py @@ -2,10 +2,22 @@ from __future__ import unicode_literals import pytest +from ...language import Language +from ...pipeline import DependencyParser @pytest.mark.models('en') -def test_beam_parse(EN): +def test_beam_parse_en(EN): doc = EN(u'Australia is a country', disable=['ner']) ents = EN.entity(doc, beam_width=2) print(ents) + + +def test_beam_parse(): + nlp = Language() + nlp.add_pipe(DependencyParser(nlp.vocab), name='parser') + nlp.parser.add_label('nsubj') + nlp.begin_training() + + doc = nlp.make_doc(u'Australia is a country') + nlp.parser(doc, beam_width=2)