vector-cosine-similarity
TypeScript icon, indicating that this package has built-in type declarations

1.8.0 • Public • Published

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

Package Sidebar

Install

npm i vector-cosine-similarity

Weekly Downloads

15

Version

1.8.0

License

ISC

Unpacked Size

14.8 kB

Total Files

7

Last publish

Collaborators

  • shawn.schneider