Socket
Socket
Sign inDemoInstall

vector-cosine-similarity

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vector-cosine-similarity

Lightweight Cosine Similarity Function. Built as an alternative to the compute-cosine-similarity package. Works with high dimension vectors like openAI embeddings


Version published
Weekly downloads
135
increased by42.11%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 03 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc