Skip to content
Discussion options

You must be logged in to vote

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

"Dr. Ben Gupta, the chief medical officer of Amazon Pharmacy, is happy."

then your code snippet would in fact show:

Dr. Ben Gupta => Gupta => nsubj => is

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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mattkallo
Comment options

@svlandeg
Comment options

Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / ner Feature: Named Entity Recognizer feat / parser Feature: Dependency Parser
2 participants