w2v-server.pl: add perplexity and epsilon parameters
diff --git a/w2v-server.pl b/w2v-server.pl
index 2cd708c..65058a2 100644
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -14,6 +14,9 @@
my $word=$c->param('word');
my $no_nbs=$c->param('n') || 100;
my $no_iterations=$c->param('N') || 2000;
+ my $perplexity=$c->param('perplexity') || 25;
+ my $epsilon=$c->param('epsilon') || 5;
+
my @lists;
if(defined($word) && $word !~ /^\s*$/) {
$c->inactivity_timeout(300);
@@ -24,7 +27,7 @@
}
}
$word =~ s/ *\| */ | /g;
- $c->render(template=>"index", word=>$word, no_nbs=>$no_nbs, no_iterations => $no_iterations, lists=> \@lists);
+ $c->render(template=>"index", word=>$word, no_nbs=>$no_nbs, no_iterations => $no_iterations, epsilon=> $epsilon, perplexity=> $perplexity, lists=> \@lists);
};
app->start;
@@ -354,7 +357,7 @@
</style>
<script>
-var opt = {epsilon: 1, perplexity: 20},
+var opt = {epsilon: <%= $epsilon %>, perplexity: <%= $perplexity %>},
mapWidth = 800, // width map
mapHeight = 800,
jitterRadius = 7;