SpanCategorizer confidence scores are equal for all spans. #12090
-
I'm trying to understand how to interpret the confidence scores returned by Below is a code snippet to illustrate my question: import numpy as np
import spacy
docs = get_docs() # Some list of docs
spancat = spacy.load('path/to_model').get_pipe('spancat')
_, scores1 = spancat.predict(docs[0:1]) # Pick a first document
_, scores2 = spancat.predict(docs[10:11]) # Pick some random other document
unique1 = np.unique(scores1)
unique2 = np.unique(scores2)
unique1 == unique2 # True
len(unique1) # 1 The final two expressions are always the same, regardless of which documents I choose to predict. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
This is probably because the If you want a single independent component, you can use |
Beta Was this translation helpful? Give feedback.
-
Hey that did the trick, thanks! I don't fully understand why though. In the trainig config I am unable to set the |
Beta Was this translation helpful? Give feedback.
This is probably because the
spancat
component depends on an earliertok2vec
ortransformer
component in the pipeline.If you want a single independent component, you can use
Language.replace_listeners
to replace the listener with an internal copy of the tok2vec component.