Generating label data for custom component #10287
-
I'm working on a very basic trainable custom component that assigns a single custom attribute. It's intended to be almost identical to the built-in
I imagine this is the same problem and it's related to correctly informing spaCy that the component annotates/initializes from a custom extension attribute, but I'm not sure where I'm going wrong. The script I have that generates the training data seems to be working the way I want, and I can see that it produces The repository with the spaCy project is here: https://github.com/direct-phonology/och-g2p; the custom component is defined in Any help/advice is appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If In To take advantage of the default serialization in |
Beta Was this translation helpful? Give feedback.
If
spacy init labels
doesn't find labels, it usually means that something is wrong with the training data, or possibly with howinitialize
reads the labels from the training data.In
get_loss
, you need to use the alignment in the Example to allow for differences between the reference tokenization and the predicted tokenization.To take advantage of the default serialization in
TrainablePipe
, you want to store the labels inself.cfg
as inTagger
. Otherwise the labels aren't saved when you useto_disk
orto_bytes
.