How to identify the subject of a sentence?

前端 未结 6 1600
我在风中等你
我在风中等你 2020-12-14 18:53

Can Python + NLTK be used to identify the subject of a sentence? From what I have learned till now is that a sentence can be broken into a head and its dependents. For e.g.

6条回答
  •  萌比男神i
    2020-12-14 19:28

    As NLTK book (exercise 29) says, "One common way of defining the subject of a sentence S in English is as the noun phrase that is the child of S and the sibling of VP."

    Look at tree example: indeed, "I" is the noun phrase that is the child of S that is the sibling of VP, while "elephant" is not.

提交回复
热议问题