self-attentive-parser
self-attentive-parser copied to clipboard
Get only the text of a span
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