You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a list of sentences / texts, this function performs paraphrase mining. It compares all sentences against all
107
+
other sentences and returns a list with the pairs that have the highest cosine similarity score.
108
+
109
+
:param embeddings: A tensor with the embeddings
110
+
:param query_chunk_size: Search for most similar pairs for #query_chunk_size at the same time. Decrease, to lower memory footprint (increases run-time).
111
+
:param corpus_chunk_size: Compare a sentence simultaneously against #corpus_chunk_size other sentences. Decrease, to lower memory footprint (increases run-time).
112
+
:param max_pairs: Maximal number of text pairs returned.
113
+
:param top_k: For each sentence, we retrieve up to top_k other sentences
114
+
:param score_function: Funtion for computing scores. By default, cosine similarity.
115
+
:return: Returns a list of triplets with the format [score, id1, id2]
116
+
"""
117
+
118
+
top_k+=1# A sentence has the highest similarity to itself. Increase +1 as we are interest in distinct pairs
0 commit comments