Learnable Similarity Functions And Their Application To Record Linkage And Clustering