How to visualize entities in a sentence line by line in Python?

879    Asked by OkamotoBando in Data Science , Asked on Nov 13, 2019
Answered by Okamoto Bando

Unlike the display dependency parse, the NER viewer has to take in a Doc object with an ents attribute. For this reason, we can't just pass a list of spans to .render(), we have to create a new Doc from each span.text

Here, span.text is used to view the sentence line by line. This makes a much better interpretation when it comes to visualizing more sentences.

Your Answer


Parent Categories