We approach this by training the similarity function in a data-dependent manner.
we train an encoder that encodes spans into vectors such that vectors of similar spans will have a small Euclidean distance between them.