title: Confidence Score of Predicted NER entities using Spacy
body: <p>I am trying to predict entities using a custom trained NER model using spacy. I read <a href="https://github.com/explosion/spaCy/pull/8855" rel="nofollow noreferrer">https://github.com/explosion/spaCy/pull/8855</a> that confidence scores of each entity can be obtained using spancat. But I have a little confusion regarding to make that work. According to my understanding, we have to train a pipeline using spancat component. So while training, within the config file there is a segment,</p>
  <pre><code>[nlp]
  lang = &quot;en&quot;
  pipeline = [&quot;tok2vec&quot;,&quot;ner&quot;]
  batch_size = 1000
  </code></pre>
  <p>Should we have to change this to</p>
  <pre><code>[nlp]
  lang = &quot;en&quot;
  pipeline = [&quot;tok2vec&quot;,&quot;ner&quot;,&quot;spancat&quot;]
  batch_size = 1000
  </code></pre>
  <p>for the spancat to work.</p>
  <p>Then after training, while predicting the entities from unknown text, should we have to use</p>
  <pre><code>doc = nlp(data_to_be_predicted)
  spans = doc.spans[&quot;spancat&quot;] # SpanGroup
  print(spans.attrs[&quot;scores&quot;]) # list of numbers, span length as SpanGroup
  </code></pre>
  <p>to get the confidence scores.</p>
  <p>I am using spacy 3.1.3. I believe according to the documentation, this feature is rolled out by now.</p>