-
Notifications
You must be signed in to change notification settings - Fork 520
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 ofn
strings. -
keys
: a string or a list ofm
strings. -
device
:cuda
orcpu
.
Outputs
- A float if
queries
andkeys
are both single sentence. Otherwise the function returns a numpy array of sizen * m
.