Following <cite>Mullenbach et al. (2018)</cite> , we employed the perlabel attention mechanism to make each ICD code attend to different parts of the document representation H. The attention layer is formalized as: where U ∈ R (m×d p )×l represents the parameter matrix of the attention layer, A ∈ R n×l represents the attention weights for each pair of an ICD code and a word, V ∈ R l×(m×d p ) represents the output of the attention layer.