Finding the main subject of a sentence #12943
-
I have the below sentence, I am trying to find the main subject/entity of the sentence. Is there a way to find it? When I do the dependency parsing/pos tagging, it doesn't give nsubj.
I am trying to extract the main subject - "Dr. Ben Gupta" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @mattkallo, I think I understand what you're trying to do, but you'll need to allow for some syntactic variation across sentences to be able to do this. For instance, in the sentence that you used, there is no actual verb, and so there also isn't a "nsubj" grammar relation. Instead, as you've found, "Gupta" is the ROOT word of the sentence. Now, suppose we'd have the sentence
then your code snippet would in fact show:
thus marking "Dr Ben Gupta" as the main "entity", if you like. On a related topic, which might be relevant for what you're trying to do, have you had a look at our built-in |
Beta Was this translation helpful? Give feedback.
Hi @mattkallo,
I think I understand what you're trying to do, but you'll need to allow for some syntactic variation across sentences to be able to do this. For instance, in the sentence that you used, there is no actual verb, and so there also isn't a "nsubj" grammar relation. Instead, as you've found, "Gupta" is the ROOT word of the sentence.
Now, suppose we'd have the sentence
then your code snippet would in fact show:
thus marking "Dr Ben Gupta" as the main "entity", if you like.
On a related topic, which might be relevant for what you're trying to do, have you had a look at…