Skip to content

Commit 516b071

Browse files
committed
Note about where the root score fiddling came from
1 parent a2751eb commit 516b071

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stanza/models/common/chuliu_edmonds.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ def chuliu_edmonds_one_root(scores):
248248
Return the results of the dependency tree search, but with exactly one link to root (0)
249249
250250
scores is a numpy array, with scores[x][y] should be the cost for assigning y to be the head of x
251+
252+
Here we reweight the root arcs so as to ensure that the picker only ever chooses one root.
253+
See for example
254+
255+
https://aclanthology.org/2021.emnlp-main.823/
256+
A Root of a Problem: Optimizing Single-Root Dependency Parsing
257+
Miloš Stanojević, Shay B. Cohen
251258
"""
252259
# we fiddle the scores to prevent double root arcs
253260
# we therefore copy the array so it doesn't get messed up at the source

0 commit comments

Comments
 (0)