Learning with Pairwise Constraints