【发布时间】:2017-01-12 04:48:04
【问题描述】:
给定一个像
这样的 NLP 解析树(ROOT (S (NP (PRP You)) (VP (MD could) (VP (VB say) (SBAR (IN that) (S (NP (PRP they)) (ADVP (RB regularly)) (VP (VB catch) (NP (NP (DT a) (NN shower)) (, ,) (SBAR (WHNP (WDT which)) (S (VP (VBZ adds) (PP (TO to) (NP (NP (PRP$ their) (NN exhilaration)) (CC and) (NP (FW joie) (FW de) (FW vivre))))))))))))) (. .)))
原句是“你可以说他们经常洗澡,这增加了他们的兴奋和生活乐趣。”
如何提取子句并对其进行逆向工程? 我们将在 S 和 SBAR 处拆分(以保留子句的类型,例如从属)
- (S (NP (PRP You)) (VP (MD could) (VP (VB say)
- (SBAR (IN that) (S (NP (PRP they)) (ADVP (RB regularly)) (VP (VB catch) (NP (NP (DT a) (NN shower))
- (, ,) (SBAR (WHNP (WDT which)) (S (VP (VBZ adds) (PP (TO to)
(NP (NP (PRP$ their) (NN exhilaration)) (CC and) (NP (FW joie) (FW
de) (FW vivre))))))))))))) (. .)))
到达
- You could say
- that they regularly catch a shower
- , which adds to their exhilaration and joie de vivre.
在 S 和 SBAR 处拆分似乎很容易。问题似乎是从片段中剥离了所有 POS 标签和块。
【问题讨论】:
标签: nlp nltk grammar stanford-nlp clause