Skip to content

Commit

Permalink
target map fix for alignment (#2311)
Browse files Browse the repository at this point in the history
Co-authored-by: Ehsan Jahanbakhsh <[email protected]>
  • Loading branch information
Ehsan-Jahanbakhsh and Ehsan-Jahanbakhsh authored Feb 13, 2023
1 parent 62c96cc commit 5e92f95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onmt/utils/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def to_word_align(src, tgt, subword_align, m_src='joiner', m_tgt='joiner'):
src_map = (subword_map_by_spacer(src) if m_src == 'spacer'
else subword_map_by_joiner(src))

tgt_map = (subword_map_by_spacer(src) if m_tgt == 'spacer'
else subword_map_by_joiner(src))
tgt_map = (subword_map_by_spacer(tgt) if m_tgt == 'spacer'
else subword_map_by_joiner(tgt))

word_align = list({"{}-{}".format(src_map[a], tgt_map[b])
for a, b in subword_align})
Expand Down

0 comments on commit 5e92f95

Please sign in to comment.