mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-04 20:30:24 +03:00
removing redundant tests, cf #8106
This commit is contained in:
parent
394862b0f4
commit
68e3d464b6
|
@ -132,41 +132,6 @@ def test_negative_sample_key_is_in_config(vocab, entity_types):
|
|||
assert tsys.cfg["neg_key"] == "non_entities"
|
||||
|
||||
|
||||
@pytest.mark.filterwarnings("ignore::UserWarning")
|
||||
def test_get_oracle_moves_negative_entities(tsys, doc, entity_annots):
|
||||
entity_annots = [(s, e, "!" + label) for s, e, label in entity_annots]
|
||||
example = Example.from_dict(doc, {"entities": entity_annots})
|
||||
ex_dict = example.to_dict()
|
||||
|
||||
for i, tag in enumerate(ex_dict["doc_annotation"]["entities"]):
|
||||
if tag == "L-!GPE":
|
||||
ex_dict["doc_annotation"]["entities"][i] = "-"
|
||||
example = Example.from_dict(doc, ex_dict)
|
||||
|
||||
act_classes = tsys.get_oracle_sequence(example)
|
||||
names = [tsys.get_class_name(act) for act in act_classes]
|
||||
assert names
|
||||
|
||||
|
||||
def test_get_oracle_moves_negative_entities2(tsys, vocab):
|
||||
doc = Doc(vocab, words=["A", "B", "C", "D"])
|
||||
entity_annots = ["B-!PERSON", "L-!PERSON", "B-!PERSON", "L-!PERSON"]
|
||||
example = Example.from_dict(doc, {"entities": entity_annots})
|
||||
act_classes = tsys.get_oracle_sequence(example)
|
||||
names = [tsys.get_class_name(act) for act in act_classes]
|
||||
assert names
|
||||
|
||||
|
||||
@pytest.mark.skip(reason="Maybe outdated? Unsure")
|
||||
def test_get_oracle_moves_negative_O(tsys, vocab):
|
||||
doc = Doc(vocab, words=["A", "B", "C", "D"])
|
||||
entity_annots = ["O", "!O", "O", "!O"]
|
||||
example = Example.from_dict(doc, {"entities": entity_annots})
|
||||
act_classes = tsys.get_oracle_sequence(example)
|
||||
names = [tsys.get_class_name(act) for act in act_classes]
|
||||
assert names
|
||||
|
||||
|
||||
# We can't easily represent this on a Doc object. Not sure what the best solution
|
||||
# would be, but I don't think it's an important use case?
|
||||
@pytest.mark.skip(reason="No longer supported")
|
||||
|
|
|
@ -268,7 +268,7 @@ def test_overfitting_IO(pipe_name):
|
|||
train_examples.append(Example.from_dict(nlp.make_doc(text), annotations))
|
||||
for dep in annotations.get("deps", []):
|
||||
parser.add_label(dep)
|
||||
#train_examples = train_examples[:1]
|
||||
# train_examples = train_examples[:1]
|
||||
optimizer = nlp.initialize()
|
||||
# run overfitting
|
||||
for i in range(200):
|
||||
|
|
Loading…
Reference in New Issue
Block a user