In [5]:
import spacy
from spacy import displacy
In [6]:
nlp = spacy.load('en')
In [7]:
text1 = "Hi this is my test script. My Name is Rishu and i am learning NLP with Spacy. Hoorah !!!"
In [8]:
doc1 = nlp(text1)
In [22]:
for t in doc1:
print(t, t.pos_, t.tag_, t.lemma_)
In [23]:
displacy.render(doc1, style='dep', jupyter=True, options={'distance': 110})
In [ ]:
## for handling large texts
doc2 = nlp(u"This is a sentence. This is another, possibly longer sentence.")
# Create spans from Doc.sents:
spans = list(doc2.sents)
displacy.serve(spans, style='dep', options={'distance': 110})
In [ ]: