stanfordnlp/CoreNLP · warning

Empty top speakers list for

Error message

  Empty top speakers list for: ${quote.toShorterString()} [no candidate top speakers found – just ignore!

What it means

In the quote attribution pipeline, BaselineTopSpeakerSieve.topSpeakerInRange assembles candidate top speakers for a quote from co-occurring mentions. If the resulting list is empty (no candidates from either forward or backward passes), there is no speaker to attribute, so a warning is logged with the quote text and the quote is skipped.

Solutions

  1. Check the upstream NER/coreference annotations — missing Person mentions are the usual root cause; run a stronger NER model.
  2. Ignore the warning: the quote is intentionally skipped and remains unattributed.
  3. Tune sieve options (e.g. gender filters, mention distance) to widen the candidate pool.
  4. Inspect the specific quote via the logged toShorterString() to see why no candidates were found.
Defensive patterns

Strategy: fallback

Validate before calling

if (topSpeakers == null || topSpeakers.isEmpty()) { log.debug("no candidate speakers for quote: " + quote.toShorterString()); return null; }

Type guard

if (topSpeakers == null || topSpeakers.isEmpty()) return null;

Try / catch

List<Person> topSpeakers = sieve.topSpeakerInRange(...);
if (topSpeakers == null || topSpeakers.isEmpty()) { /* leave quote unattributed or try another sieve */ }

Prevention

When it happens

Trigger: doMentionToSpeaker processes a quote whose surrounding mentions yield an empty candidate set from getTopSpeakers — e.g. no nearby animate/person mentions and no gender-filtered candidates.

Common situations: Documents with sparse mention density (dialogue-heavy or fragmented text); quotes in paragraphs without detected person entities; coreference chains that never reach the quote's vicinity.

Understand the failure class

Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.

Related errors


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/9dde63f1c2af1cae. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/quoteattribution/Sieves/MSSieves/BaselineTopSpeakerSieve.java:102

        // if none found, try again with bigger window
        if (topSpeakers.isEmpty()) {
          if (backSpanStart > 0) {
            backSpanStart = Math.max(0, quoteRun.first - BACKWARD_WINDOW_BIG);
            closestMentionsBackward = findClosestMentionsInSpanBackward(new Pair<>(backSpanStart, quoteRun.first - 1));
            // log.info("  Found big backward mentions in [" + backSpanStart + "," + (quoteRun.first - 1) + "]: " +
            //         closestMentionsBackward);
          }
          if (forwardSpanEnd < toks.size() - 1) {
            forwardSpanEnd = Math.min(quoteRun.second + FORWARD_WINDOW_BIG, toks.size() - 1);
            closestMentions = findClosestMentionsInSpanForward(new Pair<>(quoteRun.second + 1, forwardSpanEnd));
            // log.info("  Found big forward mentions in [" + (quoteRun.second + 1) + "," + forwardSpanEnd + "]: " +
            //         closestMentions);
          }
          topSpeakers = Counters.toSortedList(getTopSpeakers(closestMentions, closestMentionsBackward, gender,
                  quote, true));
        }
        if (topSpeakers.isEmpty()) {
          log.warn("  Empty top speakers list for: " + quote.toShorterString() +
                  " [no candidate top speakers found – just ignore!");
          continue;
        }
        topSpeakers = removeQuoteNames(topSpeakers, quote);
        String topSpeaker = topSpeakers.get(0);

        Pair<String, String> nextPrediction = getConversationalNextPrediction(quotes, quote_idx, gender);
        boolean set = updatePredictions(quote, nextPrediction);
        if (set) {
          continue;
        }

        Pair<String, String> prevPrediction = getConversationalPreviousPrediction(quotes, quote_idx, gender);
        set = updatePredictions(quote, prevPrediction);
        if (set) {
          continue;
        }

View on GitHub (pinned to 1b7edd19c4)