Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mybricks/cosine-similarity-vector

Package Overview
Dependencies
Maintainers
8
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mybricks/cosine-similarity-vector

cosine similarity for words vector lib

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

cosine-similarity-vector

cosine similarity for words vector lib

快速上手

import CosSimer from '@mybricks/cosine-similarity-vector'

const cosSimer = new CosSimer({ // 初始化
  vectorLibs: [ // type: any[]
    {
      keyWord: '添加表单',
      content: `{ type: 'add', namespace: 'mybricks.normal-pc.form-container'}`,
    },
    {
      keyWord: '删除表单',
      content: `{ type: 'del', namespace: 'mybricks.normal-pc.form-container'}`,
    },
    {
      keyWord: '添加表格',
      content: `{ type: 'add', namespace: 'mybricks.normal-pc.table'}`,
    },
  ]
})

// 返回最相似记录 cosSimer.getMaxSimilarity(query: string): object
cosSimer.getMaxSimilarity('添加一个表单')

// 查询并返回 cosSimer.search(query: string, length?: number): array<any>
cosSimer.search('添加一个表单', 2)

// 增加向量库条目 cosSimer.addVectors(vectors: any[]): void
cosSimer.addVectors([{}, {}])

FAQs

Package last updated on 06 Apr 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc