Closed caizhuo closed 5 years ago
@caizhuo Which version of LTP are you using? Did you get an error or some unexpected result?
i use the version 'ltp_data_v3.4.0', it didn't show up.
@yulongleo
I was using LTP 3.3.1
when I wrote the code, better to stick with that version
@caizhuo Though its long closed... If you're using ltp_data_v3.4.0, you need to substract the arc.head by 1 cuz for arc.head, index 0 is occupied by the ROOT node. This won't cause errors cuz the ROOT node will only be linked once and is used in
root = [i for i, x in enumerate(arcs) if x.relation == 'HED']
E.g.
change
relations = [i for i, x in enumerate(arcs) if x.head == root and x.relation == 'COO']
to
relations = [i for i, x in enumerate(arcs) if x.head - 1 == root and x.relation == 'COO']
I'm getting the demo results and it seems using ltp_data_v3.4.0 could get more.
B.T.W. I render the unclosed issues are related to this as well.
I used this example, but it didn't show up.