sentence-similarity
Advanced tools
Comparing version
{ | ||
"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 @@ | ||
[](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. |
88257
0.9%108
13.68%12
-7.69%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated