mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-15 10:42:34 +03:00
update tests to use label_smoothing = 0.0
This commit is contained in:
parent
1507e357dc
commit
344e2d6314
|
@ -160,7 +160,7 @@ def test_no_data():
|
||||||
def test_incomplete_data():
|
def test_incomplete_data():
|
||||||
# Test that the tagger works with incomplete information
|
# Test that the tagger works with incomplete information
|
||||||
nlp = English()
|
nlp = English()
|
||||||
nlp.add_pipe("tagger")
|
nlp.add_pipe("tagger", config=dict(label_smoothing=0.0))
|
||||||
train_examples = []
|
train_examples = []
|
||||||
for t in PARTIAL_DATA:
|
for t in PARTIAL_DATA:
|
||||||
train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
|
train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
|
||||||
|
@ -180,7 +180,7 @@ def test_incomplete_data():
|
||||||
def test_overfitting_IO():
|
def test_overfitting_IO():
|
||||||
# Simple test to try and quickly overfit the tagger - ensuring the ML models work correctly
|
# Simple test to try and quickly overfit the tagger - ensuring the ML models work correctly
|
||||||
nlp = English()
|
nlp = English()
|
||||||
tagger = nlp.add_pipe("tagger")
|
tagger = nlp.add_pipe("tagger", config=dict(label_smoothing=0.0))
|
||||||
train_examples = []
|
train_examples = []
|
||||||
for t in TRAIN_DATA:
|
for t in TRAIN_DATA:
|
||||||
train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
|
train_examples.append(Example.from_dict(nlp.make_doc(t[0]), t[1]))
|
||||||
|
|
|
@ -115,6 +115,7 @@ cfg_string = """
|
||||||
|
|
||||||
[components.tagger]
|
[components.tagger]
|
||||||
factory = "tagger"
|
factory = "tagger"
|
||||||
|
label_smoothing = 0.0
|
||||||
|
|
||||||
[components.tagger.model]
|
[components.tagger.model]
|
||||||
@architectures = "spacy.Tagger.v2"
|
@architectures = "spacy.Tagger.v2"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user