KoichiYasuoka
commited on
Commit
•
e33568a
1
Parent(s):
619b639
chu_liu_edmonds
Browse files
ud.py
CHANGED
@@ -51,7 +51,8 @@ class UniversalDependenciesPipeline(TokenClassificationPipeline):
|
|
51 |
x[i]=b(x,i,j)
|
52 |
if max(x)<0:
|
53 |
return h
|
54 |
-
y
|
|
|
55 |
m[0:-1,0:-1]=z=matrix-numpy.nanmax(matrix,axis=0)
|
56 |
m[0:-1,-1],m[-1,0:-1],m[-1,-1]=numpy.nanmax(z[:,y],axis=1),numpy.nanmax(z[y,:],axis=0),numpy.nanmax(z[y,y])
|
57 |
m[y,:]=m[:,y]=numpy.nan
|
|
|
51 |
x[i]=b(x,i,j)
|
52 |
if max(x)<0:
|
53 |
return h
|
54 |
+
y=[i for i,j in enumerate(x) if j==max(x)]
|
55 |
+
m=numpy.full((matrix.shape[0]+1,matrix.shape[1]+1),numpy.nan)
|
56 |
m[0:-1,0:-1]=z=matrix-numpy.nanmax(matrix,axis=0)
|
57 |
m[0:-1,-1],m[-1,0:-1],m[-1,-1]=numpy.nanmax(z[:,y],axis=1),numpy.nanmax(z[y,:],axis=0),numpy.nanmax(z[y,y])
|
58 |
m[y,:]=m[:,y]=numpy.nan
|