tim5go / zhopenie

Chinese Open Information Extraction (Tree-based Triple Relation Extraction Module)
119 stars 26 forks source link

Results cannot be displayed #9

Closed caizhuo closed 5 years ago

caizhuo commented 5 years ago

image

I used this example, but it didn't show up.

tim5go commented 5 years ago

@caizhuo Which version of LTP are you using? Did you get an error or some unexpected result?

OnePunchMann commented 5 years ago

i use the version 'ltp_data_v3.4.0', it didn't show up.

tim5go commented 5 years ago

@yulongleo I was using LTP 3.3.1 when I wrote the code, better to stick with that version

linfeng-du commented 3 years ago

@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. image

B.T.W. I render the unclosed issues are related to this as well.