Measure how similar two sentences are for applications like duplicate question detection, paraphrase detection, and text clustering.

Quickstart

Compare Sentence Similarity

Send sentences to a model to generate embeddings and compare their similarity.

import Bytez from "bytez.js";

const client = new Bytez("YOUR_BYTEZ_KEY_HERE");
const model = client.model("sentence-transformers/all-MiniLM-L6-v2");

const sentences = [
  "What is the weather like today?",
  "Is it sunny today?",
  "The e39 BMW M5 was one of the best production sport sedans ever produced."
];

const { error, output } = await model.run(sentences);

if (error) {
  console.error("Error:", error);
} else {
  console.log("Embeddings:", output);
}

Demo