Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-05-07 08:20:21 +0400
committerEva Hasler <ehasler@saxnot.inf.ed.ac.uk>2012-05-07 08:20:21 +0400
commit93bb01b2e408a1fbdbbdfec8f4b89ade561759d7 (patch)
tree49748644f449c95c963de067c159841833df3e85 /contrib
parentf14703157636666f862a6ea2f3bea50b10ed0a3b (diff)
some fixes to mosesserver and bleu feature
Diffstat (limited to 'contrib')
-rw-r--r--contrib/server/mosesserver.cpp17
-rwxr-xr-xcontrib/server/sgclient_weightUpdate.perl13
2 files changed, 20 insertions, 10 deletions
diff --git a/contrib/server/mosesserver.cpp b/contrib/server/mosesserver.cpp
index cfa060136..bbd8ec452 100644
--- a/contrib/server/mosesserver.cpp
+++ b/contrib/server/mosesserver.cpp
@@ -180,7 +180,7 @@ public:
}
const TranslationSystem& system = getTranslationSystem(params);
-
+
Sentence sentence;
const vector<FactorType> &inputFactorOrder =
staticData.GetInputFactorOrder();
@@ -307,13 +307,13 @@ public:
}
};
-/*const char* ffNames[] = { "Distortion", "WordPenalty", "!UnknownWordPenalty 1", "LexicalReordering_wbe-msd-bidirectional-fe-allff_1",
+const char* ffNames[] = { "Distortion", "WordPenalty", "!UnknownWordPenalty 1", "LexicalReordering_wbe-msd-bidirectional-fe-allff_1",
"LexicalReordering_wbe-msd-bidirectional-fe-allff_2", "LexicalReordering_wbe-msd-bidirectional-fe-allff_3",
"LexicalReordering_wbe-msd-bidirectional-fe-allff_4", "LexicalReordering_wbe-msd-bidirectional-fe-allff_5",
"LexicalReordering_wbe-msd-bidirectional-fe-allff_6", "LM", "PhraseModel_1", "PhraseModel_2", "PhraseModel_3",
- "PhraseModel_4", "PhraseModel_5" };*/
+ "PhraseModel_4", "PhraseModel_5" };
-const char* ffNames[] = { "Distortion", "WordPenalty", "!UnknownWordPenalty 1", "LM", "PhraseModel_1", "PhraseModel_2" };
+//const char* ffNames[] = { "Distortion", "WordPenalty", "!UnknownWordPenalty 1", "LM", "PhraseModel_1", "PhraseModel_2" };
class WeightUpdater: public xmlrpc_c::method
{
@@ -468,7 +468,16 @@ int main(int argc, char** argv)
++mosesargc;
mosesargv[mosesargc] = strToChar("0");
++mosesargc;
+ mosesargv[mosesargc] = strToChar("-b");
+ ++mosesargc;
+ mosesargv[mosesargc] = strToChar("0");
+ ++mosesargc;
+ cerr << "mosesargs: " << endl;
+ for (int i = 0 ; i < mosesargc ; i++) {
+ cerr << mosesargv[i] << endl;
+ }
+
Parameter* params = new Parameter();
if (!params->LoadParam(mosesargc,mosesargv)) {
params->Explain();
diff --git a/contrib/server/sgclient_weightUpdate.perl b/contrib/server/sgclient_weightUpdate.perl
index ea8138858..a9fe7dc77 100755
--- a/contrib/server/sgclient_weightUpdate.perl
+++ b/contrib/server/sgclient_weightUpdate.perl
@@ -12,9 +12,9 @@ my $server = Frontier::Client->new('url' => $url, 'encoding' => 'UTF-8');
my $verbose=0;
my $translations="translations.out";
-open(TR, ">$translations");
-my $sg_out="seachGraph.out";
-open(SG, ">$sg_out");
+open TR, ">:utf8", $translations;
+my $sg_out="searchGraph.out";
+open SG, ">:utf8", $sg_out;
#for (my $i=0;$i<scalar(@SENTENCE);$i++)
my $i=0;
@@ -25,10 +25,11 @@ while (my $text = <STDIN>)
print "[$date] sentence $i: translate\n" if $verbose;
# update weights
- #my $core_weights = "0.031,-0.138,1.000,0.087,0.035,0.105,0.061,0.052,0.114,0.095,0.064,0.039,0.056,0.043,0.081";
+ my $core_weights = "0.0314787,-0.138354,1,0.0867223,0.0349965,0.104774,0.0607203,0.0516889,0.113694,0.0947218,0.0642702,0.0385324,0.0560749,0.0434684,0.0805031";
+ #my $core_weights = "0.3,-1,1,0.3,0.3,0.3,0.3,0.3,0.3,0.5,0.2,0.2,0.2,0.2,0.2";
#my $core_weights = "0.031,-0.138,1.000,0.095,0.064,0.039";
- my $core_weights = "0.001,-0.001,1.000,1,1,1";
- my $sparse_weights = "pp_europea~European=0.015 pp_es~is=0.03 pp_es,=~is,equal=0.0001";
+ #my $core_weights = "0.001,-0.001,1.000,1,1,1";
+ my $sparse_weights = "pp_dummy~dummy=0.001";
my %param = ("core-weights" => $core_weights, "sparse-weights" => $sparse_weights);
$server->call("updateWeights",(\%param));