I have seen in the documents of spacy that confidence score of NER entities are rolled out in recent version. I am using spacy==3.1.2. I tried the following code to find the confidence score but i am getting an error. Also is it possible to find the confidence score for both custom and pretrained model.
Code
nlp = spacy.load("output/model-best")
test_data = 'Sample data here'
doc = nlp(test_data)
spans = doc.spans["spancat"] # SpanGroup
print(spans.attrs["scores"]) # list of numbers, span length as SpanGroup
Error
KeyError: 'spancat'