Commit
•
19d0a51
1
Parent(s):
a38ac92
bug fix
Browse files
ud.py
CHANGED
@@ -31,7 +31,7 @@ class UniversalDependenciesPipeline(TokenClassificationPipeline):
|
|
31 |
h=[b if i>b else b-1 for a,b in enumerate(h) if i!=a]
|
32 |
v[i-2]=(v[i-2][0],v.pop(i-1)[1])
|
33 |
q.pop(i)
|
34 |
-
t=model_output["sentence"]
|
35 |
u="# text = "+t+"\n"
|
36 |
for i,(s,e) in enumerate(v,1):
|
37 |
u+="\t".join([str(i),t[s:e],"_",q[i][0],"_","|".join(q[i][1:-1]),str(h[i]),q[i][-1],"_","_" if i<len(v) and e<v[i][0] else "SpaceAfter=No"])+"\n"
|
|
|
31 |
h=[b if i>b else b-1 for a,b in enumerate(h) if i!=a]
|
32 |
v[i-2]=(v[i-2][0],v.pop(i-1)[1])
|
33 |
q.pop(i)
|
34 |
+
t=model_output["sentence"].replace("\n"," ")
|
35 |
u="# text = "+t+"\n"
|
36 |
for i,(s,e) in enumerate(v,1):
|
37 |
u+="\t".join([str(i),t[s:e],"_",q[i][0],"_","|".join(q[i][1:-1]),str(h[i]),q[i][-1],"_","_" if i<len(v) and e<v[i][0] else "SpaceAfter=No"])+"\n"
|