mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-20 21:40:35 +03:00
Update tagger.begin_training
This commit is contained in:
parent
c558ca4485
commit
237cfa2053
|
@ -287,7 +287,13 @@ class Tagger(Pipe):
|
|||
self.add_label(tag)
|
||||
self.set_output(len(self.labels))
|
||||
if self.labels:
|
||||
self.model.initialize(X=doc_sample)
|
||||
label_sample = [
|
||||
self.model.ops.alloc2f(len(doc), len(self.labels))
|
||||
for doc in docs
|
||||
]
|
||||
for y in label_sample:
|
||||
y[:, 0] = 1.0
|
||||
self.model.initialize(X=doc_sample, Y=label_sample)
|
||||
else:
|
||||
self.model.initialize()
|
||||
if sgd is None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user