vector-cosine-similarity
v1.8.0
Published
Lightweight Cosine Similarity Function. Built as an alternative to the compute-cosine-similarity package. Works with high dimension vectors like openAI embeddings
Downloads
144
Maintainers
Readme
vector-cosine-similarity
A lightweight Cosine Similarity Function. Built as an alternative to the compute-cosine-similarity
package. Works with high dimension vectors like openAI embeddings.
Installation
$ npm install vector-cosine-similarity
Usage
As an ES module
import { cosineSimilarity } from 'vector-cosine-similarity';
const similarity = cosineSimilarity(vector1, vector2);
console.log(similarity) // => .78456378