mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Fix gold training (#4938)
* label in span not writable anymore
* Revert "label in span not writable anymore"
This reverts commit ab442338c8
.
* ensure doc is not None
This commit is contained in:
parent
199d89943e
commit
0a0de85409
|
@ -326,14 +326,18 @@ class GoldCorpus(object):
|
|||
@classmethod
|
||||
def _make_golds(cls, examples, vocab=None, make_projective=False,
|
||||
ignore_misaligned=False):
|
||||
filtered_examples = []
|
||||
for example in examples:
|
||||
gold_parses = example.get_gold_parses(vocab=vocab,
|
||||
make_projective=make_projective,
|
||||
ignore_misaligned=ignore_misaligned)
|
||||
assert len(gold_parses) == 1
|
||||
assert gold_parses[0][0] == example.doc
|
||||
example.goldparse = gold_parses[0][1]
|
||||
return examples
|
||||
doc, gold = gold_parses[0]
|
||||
if doc:
|
||||
assert doc == example.doc
|
||||
example.goldparse = gold
|
||||
filtered_examples.append(example)
|
||||
return filtered_examples
|
||||
|
||||
|
||||
def make_orth_variants(nlp, example, orth_variant_level=0.0):
|
||||
|
|
Loading…
Reference in New Issue
Block a user