mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-15 06:09:01 +03:00
Fix gold-preproc training mode
This commit is contained in:
parent
63ff233ba2
commit
a132da1558
|
@ -252,8 +252,12 @@ class GoldCorpus(object):
|
||||||
raw_text = add_noise(raw_text, noise_level)
|
raw_text = add_noise(raw_text, noise_level)
|
||||||
return [nlp.make_doc(raw_text)], paragraph_tuples
|
return [nlp.make_doc(raw_text)], paragraph_tuples
|
||||||
else:
|
else:
|
||||||
docs = []
|
|
||||||
raw_text, paragraph_tuples = make_orth_variants(nlp, None, paragraph_tuples, orth_variant_level=orth_variant_level)
|
raw_text, paragraph_tuples = make_orth_variants(nlp, None, paragraph_tuples, orth_variant_level=orth_variant_level)
|
||||||
|
cats = paragraph_tuples.pop()
|
||||||
|
for i in range(len(paragraph_tuples)):
|
||||||
|
sent_tuples, brackets = paragraph_tuples[i]
|
||||||
|
sent_tuples = sent_tuples + [cats]
|
||||||
|
paragraph_tuples[i] = [sent_tuples, brackets]
|
||||||
return [Doc(nlp.vocab, words=add_noise(sent_tuples[1], noise_level))
|
return [Doc(nlp.vocab, words=add_noise(sent_tuples[1], noise_level))
|
||||||
for (sent_tuples, brackets) in paragraph_tuples], paragraph_tuples
|
for (sent_tuples, brackets) in paragraph_tuples], paragraph_tuples
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user