user2878953
user2878953

Reputation: 99

How can i determine the head word in a Sentence, using NLP?

For example, if I have been given a sentence:

A British soldier was killed in the fighting in Afghanistan

The head word of that sentence is "killed".

How can I find it, given the nltk package in Python? I am not talking about stemming, I refer to the head word.

Upvotes: 4

Views: 4096

Answers (1)

justhalf
justhalf

Reputation: 9117

You are looking for the head word Sentence Parsing.

It's available in Python's nltk package, as you can see in this link.

It's also much related to Dependency Parsing, as you can see from Stanford NLP package in this link and explained quite a bit in this Wiki

Upvotes: 4

Related Questions