How to visualize entities in a sentence line by line in Python?
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.