Add new ranking code
Merge branch 'master' into wmt-rank
Revert cast