mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Fix entity recognition example (closes #803)
This commit is contained in:
parent
cf529f4774
commit
9aaa2c5633
|
@ -54,7 +54,7 @@ p
|
||||||
doc = nlp(u'London is a big city in the United Kingdom.')
|
doc = nlp(u'London is a big city in the United Kingdom.')
|
||||||
doc.ents = []
|
doc.ents = []
|
||||||
assert doc[0].ent_type_ == ''
|
assert doc[0].ent_type_ == ''
|
||||||
doc.ents = [Span(0, 1, label='GPE')]
|
doc.ents = [Span(doc, 0, 1, label=doc.vocab.strings['GPE'])]
|
||||||
assert doc[0].ent_type_ == 'GPE'
|
assert doc[0].ent_type_ == 'GPE'
|
||||||
doc.ents = []
|
doc.ents = []
|
||||||
doc.ents = [(u'LondonCity', u'GPE', 0, 1)]
|
doc.ents = [(u'LondonCity', u'GPE', 0, 1)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user