Commit
•
810032a
1
Parent(s):
987070c
improvement for duplicated roots
Browse files
README.md
CHANGED
@@ -45,6 +45,7 @@ class UDgoeswith(object):
|
|
45 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
46 |
if [0 for i in h if i==0]!=[0]:
|
47 |
m[:,0]+=numpy.where(m[:,0]<numpy.nanmax(m[:,0]),numpy.nan,0)
|
|
|
48 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
49 |
u="# text = "+text+"\n"
|
50 |
v=[(s,e) for s,e in w["offset_mapping"] if s<e]
|
|
|
45 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
46 |
if [0 for i in h if i==0]!=[0]:
|
47 |
m[:,0]+=numpy.where(m[:,0]<numpy.nanmax(m[:,0]),numpy.nan,0)
|
48 |
+
m[[i for i,j in enumerate(h) if j==0]]+=[0 if i==0 or j==0 else numpy.nan for i,j in enumerate(h)]
|
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]
|
ud.py
CHANGED
@@ -22,6 +22,7 @@ class UniversalDependenciesPipeline(TokenClassificationPipeline):
|
|
22 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
23 |
if [0 for i in h if i==0]!=[0]:
|
24 |
m[:,0]+=numpy.where(m[:,0]<numpy.nanmax(m[:,0]),numpy.nan,0)
|
|
|
25 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
26 |
v=[(s,e) for s,e in model_output["offset_mapping"][0].tolist() if s<e]
|
27 |
q=[self.model.config.id2label[p[i,j]].split("|") for i,j in enumerate(h)]
|
|
|
22 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
23 |
if [0 for i in h if i==0]!=[0]:
|
24 |
m[:,0]+=numpy.where(m[:,0]<numpy.nanmax(m[:,0]),numpy.nan,0)
|
25 |
+
m[[i for i,j in enumerate(h) if j==0]]+=[0 if i==0 or j==0 else numpy.nan for i,j in enumerate(h)]
|
26 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
27 |
v=[(s,e) for s,e in model_output["offset_mapping"][0].tolist() if s<e]
|
28 |
q=[self.model.config.id2label[p[i,j]].split("|") for i,j in enumerate(h)]
|