Kernelized Sorting for Natural Language Processing