Contrastive representations of high-dimensional, structured treatments