KoichiYasuoka commited on
Commit
ae14de7
1 Parent(s): b96cf19

script improved

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