问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/20500176/how-can-i-determine-the-head-word-in-a-sentence-using-nlp