For the former we use cosine similarity and for the latter we use the metric of<cite> Vendrov et al. (2016)</cite> which is useful for learning embeddings that maintain an order, e.g., dog and cat are more closer to pet than animal while being distinct.