mirror of https://github.com/explosion/spaCy.git
Auto-format code with black (#10260)
Co-authored-by: explosion-bot <explosion-bot@users.noreply.github.com>
This commit is contained in:
parent
9a06a210ec
commit
5adedb8587
|
@ -706,17 +706,27 @@ def test_permitted_package_names():
|
|||
assert _is_permitted_package_name("-package") == False
|
||||
assert _is_permitted_package_name("package-") == False
|
||||
|
||||
|
||||
|
||||
def test_debug_data_compile_gold():
|
||||
nlp = English()
|
||||
pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"])
|
||||
ref = Doc(nlp.vocab, words=["Token", ".", "New York City"], sent_starts=[True, False, True], ents=["O", "O", "B-ENT"])
|
||||
ref = Doc(
|
||||
nlp.vocab,
|
||||
words=["Token", ".", "New York City"],
|
||||
sent_starts=[True, False, True],
|
||||
ents=["O", "O", "B-ENT"],
|
||||
)
|
||||
eg = Example(pred, ref)
|
||||
data = _compile_gold([eg], ["ner"], nlp, True)
|
||||
assert data["boundary_cross_ents"] == 0
|
||||
|
||||
pred = Doc(nlp.vocab, words=["Token", ".", "New", "York", "City"])
|
||||
ref = Doc(nlp.vocab, words=["Token", ".", "New York City"], sent_starts=[True, False, True], ents=["O", "B-ENT", "I-ENT"])
|
||||
ref = Doc(
|
||||
nlp.vocab,
|
||||
words=["Token", ".", "New York City"],
|
||||
sent_starts=[True, False, True],
|
||||
ents=["O", "B-ENT", "I-ENT"],
|
||||
)
|
||||
eg = Example(pred, ref)
|
||||
data = _compile_gold([eg], ["ner"], nlp, True)
|
||||
assert data["boundary_cross_ents"] == 1
|
||||
assert data["boundary_cross_ents"] == 1
|
||||
|
|
Loading…
Reference in New Issue