No, spaCy’s NER model currently uses the
SHAPE attributes as its features. Custom attributes are not used, because they can contain pretty much any arbitrary information – so spaCy has no way of knowing what is relevant and what isn’t, or how the custom attributes relate to the data.
You can customise the features of the model, but this will take a little more work. Our video on how spaCy’s NER model works should be a good place to get started. You can also find more details on this in the neural network model architecture section of the docs.
One thing you could do pretty easily, however, is to use custom attributes to influence the selection of relevant examples. By default,
ner.teach uses uncertainty sampling, which is implemented via the
prefer_uncertain sorter. Sorter functions take a stream of
(score, example) tuples and yield a stream of sorted annotation tasks, based on the score. So instead of using the built-in model to score the examples, you can implement your own function that takes custom attributes into account. Here’s a simplified example:
for eg in stream:
doc = nlp(eg['text']) # process the example text with spaCy
score = doc._.custom_score # get a score from your custom attribute
yield (score, eg)
stream = prefer_uncertain(get_stream(stream)) # sort stream
Of course, how useful any of this will be depends on what you’re trying to do.