# spaCy get confidence on entity classification?

**URL:** <https://support.prodi.gy/t/spacy-get-confidence-on-entity-classification/1294>\
**Category:** Uncategorized\
**Tags:** ner, spacy\
**Created:** [March 12, 2019, 6:44pm UTC](https://support.prodi.gy/t/spacy-get-confidence-on-entity-classification/1294 "2019-03-12T18:44:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![andy](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/andy/32/966_2.png) [@andy](https://support.prodi.gy/u/andy)\
**Post date:** [March 18, 2019, 5:14pm UTC](https://support.prodi.gy/t/spacy-get-confidence-on-entity-classification/1294/2 "2019-03-18T17:14:56Z")

</div>

There's not a built-in method, but you can get approximate confidence using the code posted here:

> [@Displaying a confidence score next to a user-defined entity](https://support.prodi.gy/t/displaying-a-confidence-score-next-to-a-user-defined-entity/403/7):
>
> Hmm. Actually that code looks weird. Try this: text = content doc = nlp.make\_doc(text) (beams, somethingelse) = nlp.entity.beam\_parse([doc], beam\_width=16, beam\_density=0.0001) for score, ents in nlp.entity.moves.get\_beam\_parses(beams[0]): print (score, ents) entity\_scores = defaultdict(float) for start, end, label in ents: # print ("here") entity\_scores[(start, end, label)] += score print ('entity\_scores', entity\_scores)

---

_[View the full topic](https://support.prodi.gy/t/spacy-get-confidence-on-entity-classification/1294)._
