我如何输出从左到右的NLP依赖图?

问题描述 投票:0回答:1

如何从depparse输出(在JSON或CONLLU中)输出与此图类似的图?

Graphviz中是否有模板的特定工具或特定设置?

enter image description here

我可以在Graphviz中输出类似这样的内容(不同的句子):

enter image description here

但是平坦的,从左到右的有序视图更具可读性。

nlp stanford-nlp graphviz
1个回答
0
投票

查看rankrankdir属性。此输入:

digraph {
 {
   rank=same
   rankdir=LR
   a->b
   a->c
   a->d
   b->c
   b->e
   f->g
 }
}

产生此:enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.