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