Locality sensitive hashing with semantic constraints