How can we extract the main verb from a sentence?

后端 未结 2 1784
眼角桃花
眼角桃花 2021-01-22 11:46

For example, \"parrots do not swim.\" Here the main verb is \"swim\". How can we extract that by language processing? Are there any known algorithms for this purpose?

2条回答
  •  执念已碎
    2021-01-22 12:35

    To get the verb (or any other Part-Of-Speech) there are many supervised and unsupervised algorithms available like Viterbi Algorithm, Hidden Markov Models, Brill Tagger, Constraint Grammer, etc. Even we have libraries like NLTK(Natural Language Tool Kit) for Python (and similar is also available for Java) which have these algorithm already encoded in them. Annotating POS in any document or sentence is a complex job (especially when you desire high accuracy ) and you need an in-depth knowledge in this field, begin with the very basics first and continuous effort might lead you to develop an algorithm which has higher efficiency than the prevailing one.

提交回复
热议问题