Nltk library python

My below code is not working.I wanted to draw the named entity in a tree form.Have provided the code with error screenshot

What IDE are you running this code in? Maybe try the command line?

I am running it in jupyter notebook

For me this works in Jupyter. Try these in order:

Thanks a lot Jean, It worked for me with this code “svgling.draw_tree(nmedEnt)”. But even in this case one thing that I saw was when the data in “nmedEnt” is huge,it did not show any output/error.The cell just simply ran.

Well, do you get a picture for a very short sentence like "Cats eat dogs.? If not, there would be an infinite loop somewhere (post your code in this case). If yes, gradually add sentences and see where you can get (I am new to nltk so I have no idea of an order of magnitude here).