Soul model for language translation with neuronal network

how to implement the SOUL (stucture output layer) model, using word clustering for machine translation at the output layer of a neural network.
As explain according to this short article .
Please can someone help me with a source code for Pytorch framework, or a link that shows how to implement it, it will be very nice.