-
Notifications
You must be signed in to change notification settings - Fork 533
Similarities of Sentence Pairs
Tianyu Gao edited this page May 19, 2021
·
1 revision
Our package also provides a way to easily calculate (cosine) similarities between two sentences:
model.similarity(queries, keys, device=None)Inputs
-
queries: a string or a list ofnstrings. -
keys: a string or a list ofmstrings. -
device:cudaorcpu.
Outputs
- A float if
queriesandkeysare both single sentence. Otherwise the function returns a numpy array of sizen * m.