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 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] ", diff --git a/scorer.pl b/scorer.pl old mode 100755 new mode 100644 index 07b48d8..5a7b4e2 --- 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,18 +41,22 @@ 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') { +if ( grep( /^all&/, split(/\+/,$metric)) ) { foreach my $m ('muc', 'bcub', 'ceafm', 'ceafe', 'blanc') { print "\nMETRIC $m:\n"; &CorScorer::Score($m, @ARGV); } } else { - &CorScorer::Score($metric, @ARGV); + foreach my $m (split(/\+/,$metric)){ + print "\nMETRIC $m:\n"; + &CorScorer::Score($m, @ARGV); + } } -