About this endpoint
What it does
Computes a cosine similarity score between two input texts using sentence embeddings. It returns the original text1 and text2 values along with a similarity score between 0 and 1.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text1 | String | Yes | The first text to compare. |
| text2 | String | Yes | The second text to compare. |
Response
Returns a JSON object with text1 and text2 string fields, plus a similarity number field. The similarity value is constrained to the range 0 to 1.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| text1 | String | No | The first input text. |
| text2 | String | No | The second input text. |
| similarity | Number | No | The cosine similarity score between the two texts, between 0 and 1. |