版本 3.4.0 windows 需使用 pisrl_win.model
下载链接: http://ltp.ai/download.html
roles = labeller.label(words, postags, arcs)
for role in roles:
print([role.index, "".join(["%s:(%d,%d)" % (arg.name, arg.range.start, arg.range.end) for arg in role.arguments])])
[11, 'A1:(0,9)ADV:(10,10)'] [24, 'A1:(19,21)ADV:(22,23)']