classifier 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/classifier/lsi/content_node.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5bbc7714c3f1b5b6bf2b81484e071eb34c5510455d9520f8bd743ffe25a3bb6
|
4
|
+
data.tar.gz: f9236a1e0c086e1bda93645d94ea21f6634b76acbb4c99e62709e1b011311509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79596fac37a6591587859335d4dbb280f038c1504a6fba9a48f7f3d5c83c50bee959887a827588d7418503ff141bff81401125604ddc104af35863dd84842e28
|
7
|
+
data.tar.gz: 5cd28357e92c65e10630700a65097350030e401f16d4aacaaf9407e8bd8dd2d200739965bab52d547054a90bfe25ab53935e6544f06ebe3f61d356cc972d8ead
|
@@ -45,10 +45,11 @@ module Classifier
|
|
45
45
|
|
46
46
|
# Perform the scaling transform
|
47
47
|
total_words = $GSL ? vec.sum : vec.sum_with_identity
|
48
|
+
total_unique_words = vec.count { |word| word != 0 }
|
48
49
|
|
49
50
|
# Perform first-order association transform if this vector has more
|
50
51
|
# than one word in it.
|
51
|
-
if total_words > 1.0
|
52
|
+
if total_words > 1.0 && total_unique_words > 1
|
52
53
|
weighted_total = 0.0
|
53
54
|
|
54
55
|
vec.each do |term|
|