@@ -316,7 +316,9 @@ else if (config.getConsolidateCitations() == 2)
316
316
.filter (f -> !f .isCompleteForTEI ())
317
317
.collect (Collectors .toList ());
318
318
319
- LOGGER .info ("Number of figures badly formatted or incomplete we identified: " + badFigures .size ());
319
+ if (CollectionUtils .isEmpty (badFigures )) {
320
+ LOGGER .info ("Number of figures badly formatted or incomplete we identified: " + badFigures .size ());
321
+ }
320
322
bodyResults = revertResultsForBadItems (badFigures , bodyResults , !(figures .size () > numberFiguresFulltextModel ));
321
323
322
324
figures = figures .stream ()
@@ -338,7 +340,9 @@ else if (config.getConsolidateCitations() == 2)
338
340
.filter (t -> !(t .isCompleteForTEI () && t .validateTable ()))
339
341
.collect (Collectors .toList ());
340
342
341
- LOGGER .info ("Number of tables badly formatted or incomplete we identified: " + badTables .size ());
343
+ if (CollectionUtils .isEmpty (badFigures )) {
344
+ LOGGER .info ("Number of tables badly formatted or incomplete we identified: " + badTables .size ());
345
+ }
342
346
bodyResults = revertResultsForBadItems (badTables , bodyResults , !(tables .size () > numberTablesFulltextModel ));
343
347
344
348
tables = tables .stream ()
@@ -438,7 +442,7 @@ static String revertResultsForBadItems(List<? extends Figure> badFiguresOrTables
438
442
List <Integer > candidateIndexes = findCandidateIndex (layoutTokenItem , labelledResultsAsList ,
439
443
itemLabel , strict );
440
444
if (candidateIndexes .isEmpty ()) {
441
- LOGGER .info ("Cannot find the candidate index for fixing the tables." );
445
+ LOGGER .info ("Cannot find the candidate index for fixing the figures/ tables. Tokens: " + LayoutTokensUtil . toText ( layoutTokenItem ) );
442
446
continue ;
443
447
}
444
448
@@ -470,7 +474,7 @@ static String revertResultsForBadItems(List<? extends Figure> badFiguresOrTables
470
474
line .set (line .size () - 1 , label .replace (itemLabel , TaggingLabels .PARAGRAPH_LABEL ));
471
475
}
472
476
} else {
473
- LOGGER .warn ("Cannot find the result index candidate." );
477
+ LOGGER .warn ("Cannot find the result index candidate for fixing the figure/table. Tokens: " + LayoutTokensUtil . toText ( layoutTokenItem ) );
474
478
}
475
479
}
476
480
@@ -498,7 +502,7 @@ static String revertDiscardedTokensInMainResults(List<List<LayoutToken>> layoutT
498
502
// Find the index of the first layoutToken of the table in the tokenization
499
503
List <Integer > candidateIndexes = findCandidateIndex (tokens , labelledResultsAsList , itemLabel , strict );
500
504
if (candidateIndexes .isEmpty ()) {
501
- LOGGER .info ("Cannot find the candidate index for fixing the results." );
505
+ LOGGER .info ("Cannot find the candidate index for fixing the results. Tokens: " + LayoutTokensUtil . toText ( tokens ) );
502
506
continue ;
503
507
}
504
508
@@ -534,7 +538,7 @@ static String revertDiscardedTokensInMainResults(List<List<LayoutToken>> layoutT
534
538
line .set (line .size () - 1 , label .replace (itemLabel , TaggingLabels .PARAGRAPH_LABEL ));
535
539
}
536
540
} else {
537
- LOGGER .warn ("Cannot find the result index candidate." );
541
+ LOGGER .warn ("Cannot find the result index candidate for fixing the results. Tokens " + LayoutTokensUtil . toText ( tokens ) );
538
542
}
539
543
}
540
544
0 commit comments