New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sentence-similarity

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentence-similarity - npm Package Compare versions

Comparing version

to
1.0.8

4

package.json
{
"name": "sentence-similarity",
"version": "1.0.7",
"version": "1.0.8",
"description": "Sentence similarity algorithm.",

@@ -24,3 +24,3 @@ "main": "index.js",

"helper-clockmaker": "^1.0.0",
"natural": "^0.5.1"
"natural": "^0.6.3"
},

@@ -27,0 +27,0 @@ "keywords": [

@@ -0,1 +1,3 @@

[![Build Status](https://travis-ci.org/jloveric/SentenceSimilarity.svg?branch=master)](https://travis-ci.org/jloveric/SentenceSimilarity)
# SentenceSimilarity

@@ -7,3 +9,4 @@ Javascript/Nodejs sentence similarity.

the words in the two sentences. 'size' is the score determined by comparing the number of words to match to the number of
words that exist in the compared sentence.
words that exist in the compared sentence. The matches between words are unique so no word in sentence 1 is matched with more than one word in sentence 2. If the same word exists twice in sentence 2, but not sentence 1 then preference is given to the
left most word during matching.

@@ -46,2 +49,11 @@ By multiplying score\*order\*size or exact\*order\*size, one will get a score between 0 and 1. In addition, the user can

```
"matched" tells you which index of s2 best matches the corresponding word in s1. And matchScore give you the corresponding score for the matches determined in "matched". In this case, the algorithm suggests that
0. 'how=not' with score (0.277)
1. 'close=close' with score (1)
2. 'is=' doesn't have a match, score(0)
3. 'this=these' with score (0.91)
4. 'to=two' with score (0.325)
5. 'that=that' with score (1.0)
The third parameter (opts) to the similarity(s1,s2,opts) call is an object containing the similarity measure for comparing words in a sentence as well as a option object which can be used to define additional parameters. someFunc should return a value between 0 and 1

@@ -97,2 +109,2 @@ defining how similar the two "words" are, where 1 means they are exactly the same and 0 means the are not at all the same. I often use a threshold parameter that sets the similarity to 0 if the similarity is below that threshold.

in s2, so it may be a slot value. We've developed a slot filler that uses this sentence similarity and it is in
the npm module slot-filler.
the npm module slot-filler.