Finding meaningful sub-sentences from a sentence

后端 未结 4 1955
北海茫月
北海茫月 2020-12-13 07:27

Is there a way to to find all the sub-sentences of a sentence that still are meaningful and contain at least one subject, verb, and a predicate/object?

For example,

4条回答
  •  情书的邮戳
    2020-12-13 08:13

    You can use dependency parser provided by Stanford CoreNLP. Collapsed output of your sentence will look like below.

    nsubj(going-3, I-1)
    xsubj(do-5, I-1)
    aux(going-3, am-2)
    root(ROOT-0, going-3)
    aux(do-5, to-4)
    xcomp(going-3, do-5)
    det(seminar-7, a-6)
    dobj(do-5, seminar-7)
    prep_on(seminar-7, NLP-9)
    prep_at(do-5, -11)
    prep_in(do-5, Austin-13)
    amod(month-15, next-14)
    tmod(do-5, month-15)
    

    The last 5 of your sentence output are optional. You can remove one or more parts that are not essential to your sentence.
    Most of this optional parts are belong to prepositional and modifier e.g : prep_in, prep_do, advmod, tmod, etc. See Stanford Dependency Manual.

    For example, if you remove all modifier from the output, you will get

    I am going to do a seminar on NLP at SXSW in Austin.

提交回复
热议问题