@@ -87,6 +87,7 @@ my $KEY_COLUMN = -1;
87
87
# F1 = 2 * Recall * Precision / (Recall + Precision)
88
88
sub Score {
89
89
my ($metric , $kFile , $rFile , $name ) = @_ ;
90
+ our $repeated_mentions = 0;
90
91
91
92
if (lc ($metric ) eq ' blanc' ) {
92
93
return ScoreBLANC($kFile , $rFile , $name );
@@ -346,7 +347,7 @@ sub IdentifMentions {
346
347
foreach my $entity (@$keys ) {
347
348
foreach my $mention (@$entity ) {
348
349
if (defined ($id {" $mention ->[0],$mention ->[1]" })) {
349
- print " Repeated mention: $mention ->[0], $mention ->[1] " ,
350
+ print " Repeated mention in the key : $mention ->[0], $mention ->[1] " ,
350
351
$id {" $mention ->[0],$mention ->[1]" }, $idCount , " \n " ;
351
352
}
352
353
$id {" $mention ->[0],$mention ->[1]" } = $idCount ;
@@ -356,24 +357,23 @@ sub IdentifMentions {
356
357
357
358
# correct identification: Exact bound limits
358
359
my $exact = 0;
359
- my $repeats = 0;
360
360
foreach my $entity (@$response ) {
361
361
362
362
my $i = 0;
363
363
my @remove ;
364
364
365
365
foreach my $mention (@$entity ) {
366
366
if (defined ($map {" $mention ->[0],$mention ->[1]" })) {
367
- print " Repeated mention: $mention ->[0], $mention ->[1] " ,
367
+ print " Repeated mention in the response : $mention ->[0], $mention ->[1] " ,
368
368
$map {" $mention ->[0],$mention ->[1]" },
369
369
$id {" $mention ->[0],$mention ->[1]" },
370
370
" \n " ;
371
371
push (@remove , $i );
372
- $repeats ++;
372
+ $main::repeated_mentions ++;
373
373
374
- if ($repeats > 10)
374
+ if ($main::repeated_mentions > 10)
375
375
{
376
- print STDERR " Found too many repeats (> 10) in the response, so refusing to score. Please fix the output.\n " ;
376
+ print STDERR " Found too many repeated mentions (> 10) in the response, so refusing to score. Please fix the output.\n " ;
377
377
exit 1;
378
378
}
379
379
0 commit comments