I'm trying to run a displacy server in google colab:
from spacy import displacy
frasesin=nlp("Yo quisiera saber porqué el jugador hizo tan mala jugada")
dep=[]
for x in range(1,len(frasesin)):
dep.append([ frasesin[x].text, frasesin[x].dep_, frasesin[x].head.text])
dep
displacy.serve(frasesin, style="dep")
And it is running fine:
Using the 'dep' visualizer
Serving on http://0.0.0.0:5000 ...
But how can I access this port in colab to see the results?
Use displacy.render instead of .serve, and set jupyter=True
from spacy import displacy
displacy.render(doc, style='dep', jupyter=True, options={'distance': 90})
I had the same issue. Try this: http://localhost:5000/ It worked for me
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