mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
Add extra beam parsing test
This commit is contained in:
parent
e777ea25bb
commit
00435d8f0c
|
@ -2,10 +2,22 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from ...language import Language
|
||||||
|
from ...pipeline import DependencyParser
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.models('en')
|
@pytest.mark.models('en')
|
||||||
def test_beam_parse(EN):
|
def test_beam_parse_en(EN):
|
||||||
doc = EN(u'Australia is a country', disable=['ner'])
|
doc = EN(u'Australia is a country', disable=['ner'])
|
||||||
ents = EN.entity(doc, beam_width=2)
|
ents = EN.entity(doc, beam_width=2)
|
||||||
print(ents)
|
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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user