From 230cf27272cc7c15ebf7370b9aa8808b5b282426 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Thu, 26 Apr 2012 21:19:56 -0400 Subject: working rampion, gimpel&smith (2012) --- rampion/rampion.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rampion/rampion.pl') diff --git a/rampion/rampion.pl b/rampion/rampion.pl index fda2bac2..d29c02b3 100755 --- a/rampion/rampion.pl +++ b/rampion/rampion.pl @@ -301,10 +301,13 @@ while (1){ my $score = 0; my $icc = 0; my $inweights="$dir/weights.$im1"; + my $outweights="$dir/weights.$iteration"; $cmd="$MAPINPUT $dir/hgs > $dir/agenda.$im1"; print STDERR "COMMAND:\n$cmd\n"; check_call($cmd); - die "PLEASE IMPL"; + $cmd="$MAPPER $refs_comma_sep -m $metric -i $dir/agenda.$im1 -w $inweights > $outweights"; + check_call($cmd); + $lastWeightsFile = $outweights; $iteration++; print STDERR "\n==========\n"; } -- cgit v1.2.3 From c5f69888943623e80478b6ba9247acc85758bedf Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Fri, 27 Apr 2012 00:24:21 -0400 Subject: make rampion match pseudocode exactly --- rampion/rampion.pl | 1 + rampion/rampion_cccp.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'rampion/rampion.pl') diff --git a/rampion/rampion.pl b/rampion/rampion.pl index d29c02b3..9884f453 100755 --- a/rampion/rampion.pl +++ b/rampion/rampion.pl @@ -309,6 +309,7 @@ while (1){ check_call($cmd); $lastWeightsFile = $outweights; $iteration++; + `rm hgs/*.gz`; print STDERR "\n==========\n"; } diff --git a/rampion/rampion_cccp.cc b/rampion/rampion_cccp.cc index a04da831..7a6f1f0c 100644 --- a/rampion/rampion_cccp.cc +++ b/rampion/rampion_cccp.cc @@ -58,7 +58,7 @@ struct HypInfo { SufficientStats ss; scorer.Evaluate(hyp, &ss); g = metric->ComputeScore(ss); - if (metric->IsErrorMetric()) g = 1 - g; + if (!metric->IsErrorMetric()) g = 1 - g; } vector hyp; @@ -91,7 +91,7 @@ int main(int argc, char** argv) { EvaluationMetric* metric = EvaluationMetric::Instance(evaluation_metric); DocumentScorer ds(metric, conf["reference"].as >()); cerr << "Loaded " << ds.size() << " references for scoring with " << evaluation_metric << endl; - double goodsign = 1; + double goodsign = -1; double badsign = -goodsign; Hypergraph hg; -- cgit v1.2.3