spaCy/spacy/tests/parser/test_beam_parse.py

11 lines
226 B
Python
Raw Normal View History

2017-07-21 23:48:35 +00:00
import spacy
import pytest
@pytest.mark.models
def test_beam_parse():
nlp = spacy.load('en_core_web_sm')
doc = nlp(u'Australia is a country', disable=['ner'])
ents = nlp.entity(doc, beam_width=2)
print(ents)