I am trying to display Spacy Dependency Tree in Pyspark (Databricks). But I am getting this error. Could someone help me with the display of html object please. I am attaching screenshot of the Error message. Thanks in advance. Here is my code:
import spacy
from spacy import displacy
doc = nlp("Reliance is looking at buying U.K. based analytics startup for $7 billion")
displacy.render(doc, style="dep" , jupyter=True)
Error message:

This won't work in the Databricks notebooks, because it's not an Jupyter. But you can use displayHTML function together with rendering as HTML:
displayHTML(displacy.render(doc, style="dep", page=True))
Or even display SVG data directly:
displayHTML(displacy.render(doc, style="dep"))
here is result:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With