Skip to content
Snippets Groups Projects
Commit a455a0d1 authored by Mateusz Klimaszewski's avatar Mateusz Klimaszewski
Browse files

Add deps sorting.

parent a17f6c4b
Branches
No related merge requests found
Pipeline #2939 passed with stage
in 4 minutes and 19 seconds
......@@ -74,8 +74,11 @@ def graph_and_tree_merge(tree_arc_scores,
parse_graph[d] = sorted(parse_graph[d])
for i, g in enumerate(parse_graph):
heads = [x[0] for x in g]
rels = [x[1] for x in g]
heads = np.array([x[0] for x in g])
rels = np.array([x[1] for x in g])
indices = rels.argsort()
heads = heads[indices].tolist()
rels = rels[indices].tolist()
deps = '|'.join(f'{h}:{r}' for h, r in zip(heads, rels))
tokens[i - 1]["deps"] = deps
return
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment