Update tests

This commit is contained in:
Matthew Honnibal 2020-08-09 15:01:16 +02:00
parent bbd8acd4bf
commit 8a13f510d6
4 changed files with 0 additions and 16 deletions

View File

@ -145,8 +145,6 @@ def test_accept_blocked_token():
nlp1 = English()
doc1 = nlp1("I live in New York")
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner1 = nlp1.create_pipe("ner", config=config)
assert [token.ent_iob_ for token in doc1] == ["", "", "", "", ""]
@ -167,8 +165,6 @@ def test_accept_blocked_token():
nlp2 = English()
doc2 = nlp2("I live in New York")
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner2 = nlp2.create_pipe("ner", config=config)
@ -225,8 +221,6 @@ def test_overwrite_token():
assert [token.ent_type_ for token in doc] == ["", "", "", "", ""]
# Check that a new ner can overwrite O
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner2 = nlp.create_pipe("ner", config=config)
ner2.moves.add_action(5, "")

View File

@ -272,8 +272,6 @@ def test_issue1963(en_tokenizer):
def test_issue1967(label):
nlp = Language()
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner = nlp.create_pipe("ner", config=config)
example = Example.from_dict(

View File

@ -139,8 +139,6 @@ def test_issue4042_bug2():
output_dir.mkdir()
ner1.to_disk(output_dir)
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner2 = nlp1.create_pipe("ner", config=config)
ner2.from_disk(output_dir)
@ -304,8 +302,6 @@ def test_issue4313():
beam_density = 0.0001
nlp = English()
config = {
"learn_tokens": False,
"min_action_freq": 30,
}
ner = nlp.create_pipe("ner", config=config)
ner.add_label("SOME_LABEL")

View File

@ -185,20 +185,16 @@ def test_issue4725_1():
vocab = Vocab(vectors_name="test_vocab_add_vector")
nlp = English(vocab=vocab)
config = {
"learn_tokens": False,
"min_action_freq": 342,
"update_with_oracle_cut_size": 111,
}
ner = nlp.create_pipe("ner", config=config)
with make_tempdir() as tmp_path:
with (tmp_path / "ner.pkl").open("wb") as file_:
pickle.dump(ner, file_)
assert ner.cfg["min_action_freq"] == 342
assert ner.cfg["update_with_oracle_cut_size"] == 111
with (tmp_path / "ner.pkl").open("rb") as file_:
ner2 = pickle.load(file_)
assert ner2.cfg["min_action_freq"] == 342
assert ner2.cfg["update_with_oracle_cut_size"] == 111