cosine-similarity-vector
cosine similarity for words vector lib
快速上手
import CosSimer from '@mybricks/cosine-similarity-vector'
const cosSimer = new CosSimer({
vectorLibs: [
{
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('添加一个表单')
cosSimer.search('添加一个表单', 2)
cosSimer.addVectors([{}, {}])