KoichiYasuoka commited on
Commit
fceb6cc
1 Parent(s): 8e56bd5
Files changed (1) hide show
  1. ud.py +1 -1
ud.py CHANGED
@@ -30,7 +30,7 @@ class UniversalDependenciesPipeline(TokenClassificationPipeline):
30
  g="aggregation_strategy" in kwargs and kwargs["aggregation_strategy"]!="none"
31
  if g:
32
  for i,j in reversed(list(enumerate(q[1:],1))):
33
- if j[-1]=="goeswith":
34
  h=[b if i>b else b-1 for a,b in enumerate(h) if i!=a]
35
  v[i-1]=(v[i-1][0],v.pop(i)[1])
36
  q.pop(i)
 
30
  g="aggregation_strategy" in kwargs and kwargs["aggregation_strategy"]!="none"
31
  if g:
32
  for i,j in reversed(list(enumerate(q[1:],1))):
33
+ if j[-1]=="goeswith" and set([t[-1] for t in q[h[i]+1:i+1]])=={"goeswith"}:
34
  h=[b if i>b else b-1 for a,b in enumerate(h) if i!=a]
35
  v[i-1]=(v[i-1][0],v.pop(i)[1])
36
  q.pop(i)