similarity
Calculate pairwise cosine similarity between two text sets, returning a 2D matrix of scores to measure semantic relatedness.
Instructions
Cosine similarity matrix between two sets of texts.
Args: texts_a: First set of strings (rows of the result matrix). texts_b: Second set of strings (columns of the result matrix). dim: Matryoshka truncation dimension; one of 512, 256, 128, 64, 32.
Returns a dict with a 2D similarity matrix of shape (len(a), len(b)).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dim | No | ||
| texts_a | Yes | ||
| texts_b | Yes |