nikitakit / self-attentive-parser

High-accuracy NLP parser with models for 11 languages.

Home Page:https://parser.kitaev.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get only the text of a span

sabn0 opened this issue · comments

for example, extract "house" from the span (NN house)
Is it possible?

@nonowar7
Look into the spaCy documentations. (on a spaCy Span or Doc object, "orth_" attribute contains the text for it)

text = "this is my sentence."
doc = nlp(text)
sent = list(doc.sents)[0]
child = list(sent._.children)[0].orth_

This is not working