def sent2graph(sentence):
dot = Digraph(format='png')
for chunk in sentence:
if chunk.dst != -1:
dot.node(str(chunk.id), chunk.join_surface())
dot.node(str(chunk.dst), sentence[chunk.dst].join_surface())
dot.edge(str(chunk.id), str(chunk.dst))
dot.render('knock44')
评论列表
文章目录