如何使用NLP确定句子中的主词?

如何使用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".

给定Python中的nltk包,如何找到它?我不是在说词干,而是指头词.

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

您正在寻找主词句子分析.

您可以在此链接.

这与依赖性解析也有很大关系,正如您在链接中的Stanford NLP软件包中所见.并在 Wiki

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