Reputation: 1
I've recently started playing around with Python's Spacy library. I wanted to use it to find the subject of a sentence. I used the method detailed in this post, but it doesn't find the entire subject.
For Example:
doc = nlp(u"Mr Bob Bobson enjoyed hunting and fishing")
sub_toks = [tok for tok in doc if (tok.dep_ == "nsubj")]
print(sub_toks)
Results in
[Bobson]
However, the result I want is
[Mr Bob Bobson]
Upvotes: 0
Views: 1273