quartz
quartz

Reputation: 757

Decompose compound sentence to simple sentences

I am looking for a way to decompose the compound sentence to simple sentences in stanford nlp.
For ex: Input: The manager went home and committed suicide.
Output: The manager went home. He committed suicide.

Upvotes: 4

Views: 4004

Answers (2)

Jeff Kang
Jeff Kang

Reputation: 279

If you would be ok with, "The manager went home, and he committed suicide" (2 independent clauses can be found), maybe check out:

Clause Extraction using Stanford parser, or

Independent clause boundary disambiguation, and independent clause segmentation – any tools to do this?

Upvotes: 1

bogs
bogs

Reputation: 2296

If you are lucky and Stanford parser works correctly on your sentence, you can just decompose the parse tree:

(ROOT
  (S
    (S
      (NP (PRP I))
      (VP (VBP am)
        (NP (NNP John))))
    (CC and)
    (S
      (NP (PRP I))
      (VP (VBP am)
        (NP (DT an) (NN engineer))))
    (. .))) 

As you can see, there are 2 S nodes deriving from ROOT-S node. Another way of saying it: Take only the S nodes that don't have S children.

Upvotes: 8

Related Questions