w2v-server: improve heat depiction
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 7e5fb95..d34f174 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -49,14 +49,14 @@
function changeCharColor(txt, heat) {
var newText = "";
for (var i=0, l=txt.length; i<l; i++) {
- newText += '<span style="background-color:'+getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span>';
+ newText += (i == 5 ? txt.charAt(i) : '<span style="background-color:'+getHeatColor(heat[i]/maxHeat)+'">'+txt.charAt(i)+'</span>');
}
return newText;
}
function getHeatColor(value) {
var hue=((1-value)*120).toString(10);
- return ["hsl(",hue,",100%,50%)"].join("");
+ return ["hsl(",hue,",90%,70%)"].join("");
}
function bitvec2window(n, heat) {
diff --git a/w2v-server.pl b/w2v-server.pl
index 35b0295..4aff19d 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -849,8 +849,8 @@
word_activation_sum += syn_nbs[a]->best[b].activation;
if(syn_nbs[a]->best[b].activation > best[i].max_activation)
best[i].max_activation = syn_nbs[a]->best[b].activation;
- if(syn_nbs[a]->best[b].cprobability > best[i].heat[wpos])
- best[i].heat[wpos] = syn_nbs[a]->best[b].cprobability;
+ if(best[i].heat[wpos] == 0 )
+ best[i].heat[wpos] = syn_nbs[a]->best[b].activation;
}
}
}