Alignment modeling builds the correlation between the tokens in source and target sequences, which plays an important role in sequence to sequence tasks. In L2M and M2L tasks, previous works usually used greedy alignment mechanisms to handle the correlation between lyric and melody. For example, [1]} used the Needleman-Wunsch algorithm [2]} to count the alignment of lyric and melody. [3]} predicted how many syllables in the predicting word given current note input. However, these greedy alignment strategies cannot provide flexible and global alignments in the sentence level. In other sequence to sequence learning tasks like neural machine translation, [4]}, [5]} introduced attention mechanism to learn the relationship between source and target languages. In this paper, we leverage the attention mechanism to build the global and soft alignment between lyric and melody, and finally design a dynamic programming method to obtain the strict alignment between word/syllable and note.
