KoichiYasuoka commited on
Commit
ed37fa0
1 Parent(s): a2eb47f

script improved

Browse files
Files changed (1) hide show
  1. README.md +3 -0
README.md CHANGED
@@ -42,6 +42,9 @@ class UDgoeswith(object):
42
  for i in range(1,m.shape[0]):
43
  m[i,0],m[i,i],p[i,0]=m[i,i],numpy.nan,p[i,i]
44
  h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
 
 
 
45
  u="# text = "+text+"\n"
46
  v=[(s,e) for s,e in w["offset_mapping"] if s<e]
47
  for i,(s,e) in enumerate(v,1):
 
42
  for i in range(1,m.shape[0]):
43
  m[i,0],m[i,i],p[i,0]=m[i,i],numpy.nan,p[i,i]
44
  h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
45
+ if [0 for i in h if i==0]!=[0]:
46
+ m[:,0]+=numpy.where(m[:,0]<numpy.nanmax(m[:,0]),numpy.nan,0)
47
+ h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
48
  u="# text = "+text+"\n"
49
  v=[(s,e) for s,e in w["offset_mapping"] if s<e]
50
  for i,(s,e) in enumerate(v,1):