From 48e0ca7394ecf6bf26275ce7f052b67f81728f0e Mon Sep 17 00:00:00 2001 From: Augustin Voisin-Marras Date: Fri, 13 Apr 2018 10:08:47 +0200 Subject: [PATCH 1/4] Possibility to specify several scorers separated by + --- scorer.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scorer.pl b/scorer.pl index 07b48d8..5ebab09 100755 --- a/scorer.pl +++ b/scorer.pl @@ -19,7 +19,7 @@ BEGIN print q| use: scorer.pl [name] - metric: the metric desired to score the results: + metric: the metrics desired to score the results (separated by +): muc: MUCScorer (Vilain et al, 1995) bcub: B-Cubed (Bagga and Baldwin, 1998) ceafm: CEAF (Luo et al, 2005) using mention-based similarity @@ -41,9 +41,11 @@ BEGIN } my $metric = shift(@ARGV); -if ($metric !~ /^(muc|bcub|ceafm|ceafe|blanc|all)/i) { - print "Invalid metric\n"; - exit; +foreach my $m (split(/\+/,$metric)){ + if ($m !~ /^(muc|bcub|ceafm|ceafe|blanc|all)/i) { + print "Invalid metric: ".$m."\n"; + exit; + } } if ($metric eq 'all') { @@ -53,6 +55,8 @@ BEGIN } } else { - &CorScorer::Score($metric, @ARGV); + foreach my $m (split(/\+/,$metric)){ + print "\nMETRIC $m:\n"; + &CorScorer::Score($m, @ARGV); + } } - From 080b5e63c1b4721b36a310cbe8232fc4bc73f965 Mon Sep 17 00:00:00 2001 From: Augustin Voisin-Marras Date: Fri, 13 Apr 2018 10:23:26 +0200 Subject: [PATCH 2/4] if all contained in metric list, then executing (and only) all target --- scorer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 scorer.pl diff --git a/scorer.pl b/scorer.pl old mode 100755 new mode 100644 index 5ebab09..5a7b4e2 --- a/scorer.pl +++ b/scorer.pl @@ -48,7 +48,7 @@ BEGIN } } -if ($metric eq 'all') { +if ( grep( /^all&/, split(/\+/,$metric)) ) { foreach my $m ('muc', 'bcub', 'ceafm', 'ceafe', 'blanc') { print "\nMETRIC $m:\n"; &CorScorer::Score($m, @ARGV); From 166dc49e8cbe699c217d2fdb6f391883adff152b Mon Sep 17 00:00:00 2001 From: Augustin Voisin-Marras Date: Fri, 13 Apr 2018 10:28:13 +0200 Subject: [PATCH 3/4] turning verbose mode to 1 --- lib/CorScorer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CorScorer.pm b/lib/CorScorer.pm index 550b59a..91e7805 100644 --- a/lib/CorScorer.pm +++ b/lib/CorScorer.pm @@ -68,7 +68,7 @@ print "version: " . $VERSION . " " . Cwd::realpath(__FILE__) . "\n"; # 1.02 Corrected BCUB bug. It fails when the key file does not have any mention # global variables -my $VERBOSE = 2; +my $VERBOSE = 1; my $HEAD_COLUMN = 8; my $RESPONSE_COLUMN = -1; my $KEY_COLUMN = -1; @@ -369,7 +369,7 @@ sub IdentifMentions { my $i = 0; my @remove; - + foreach my $mention (@$entity) { if (defined($map{"$mention->[0],$mention->[1]"})) { print "Repeated mention in the response: $mention->[0], $mention->[1] ", From b329fb5b6d341d4b3ee4b7fcc201c932d56507e3 Mon Sep 17 00:00:00 2001 From: Augustin Voisin-Marras Date: Fri, 13 Apr 2018 10:29:12 +0200 Subject: [PATCH 4/4] adding description of multi-scorers parameters in Readme --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index fd1b52e..f3975cb 100644 --- a/README.rst +++ b/README.rst @@ -45,7 +45,7 @@ USAGE perl scorer.pl [] - : the metric desired to score the results. one of the following values: + : the metrics desired to score the results (separated by +). ones of the following values: muc: MUCScorer (Vilain et al, 1995) bcub: B-Cubed (Bagga and Baldwin, 1998) @@ -57,7 +57,7 @@ USAGE : file with expected coreference chains in CoNLL-2011/2012 format : file with output of coreference system (CoNLL-2011/2012 format) - + : optional. The name of the document to score. If name is not given, all the documents in the dataset will be scored. If given name is "none" then all the documents are scored but only total