4

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.

quartz
  • 747
  • 9
  • 26
  • 2
    Does this answer your question? http://stackoverflow.com/a/9606606/176075 – Jon Gauthier Dec 30 '14 at 01:18
  • 2
    It will be difficult to automatically infer pronouns as you have done here (i.e., determine that "the manager" can be replaced with "he" and not "she" or "it"). – Jon Gauthier Dec 30 '14 at 01:19

2 Answers2

8

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.

bogs
  • 2,286
  • 18
  • 22
1

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?

Community
  • 1
  • 1
Jeff Kang
  • 279
  • 4
  • 13