Commit
•
fc5131d
1
Parent(s):
e264969
aggregation_strategy
Browse files
ud.py
CHANGED
@@ -32,9 +32,7 @@ class UniversalDependenciesPipeline(TokenClassificationPipeline):
|
|
32 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
33 |
v=[(s,e) for s,e in model_output["offset_mapping"][0].tolist() if s<e]
|
34 |
q=[self.model.config.id2label[p[i,j]].split("|") for i,j in enumerate(h)]
|
35 |
-
g=
|
36 |
-
if "aggregation_strategy" in kwargs:
|
37 |
-
g=kwargs["aggregation_strategy"]!="none"
|
38 |
if g:
|
39 |
for i,j in reversed(list(enumerate(q[2:],2))):
|
40 |
if j[-1]=="goeswith":
|
|
|
32 |
h=ufal.chu_liu_edmonds.chu_liu_edmonds(m)[0]
|
33 |
v=[(s,e) for s,e in model_output["offset_mapping"][0].tolist() if s<e]
|
34 |
q=[self.model.config.id2label[p[i,j]].split("|") for i,j in enumerate(h)]
|
35 |
+
g="aggregation_strategy" in kwargs and kwargs["aggregation_strategy"]!="none"
|
|
|
|
|
36 |
if g:
|
37 |
for i,j in reversed(list(enumerate(q[2:],2))):
|
38 |
if j[-1]=="goeswith":
|