stanfordnlp/CoreNLP · error · RuntimeException

Cannot create coref.evaluate.filter

Error message

Cannot create coref.evaluate.filter 

What it means

RuntimeException from CorefProperties.getCorefMentionFilter when the class named by coref.evaluate.filter cannot be reflectively instantiated (class missing, wrong constructor, or not a Predicate of Pair<CorefChain.CorefMention, List<CoreLabel>>).

Solutions

  1. Check the coref.evaluate.filter class name and classpath
  2. Ensure it implements Predicate<Pair<CorefChain.CorefMention, List<CoreLabel>>> with a no-arg constructor
  3. Remove the property to use the default filter
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/edu/stanford/nlp/coref/CorefProperties.java:208 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/edu/stanford/nlp/coref/CorefProperties.java:208

    return getLanguage(props).getDisplayName().toLowerCase();
  }

  public static HeadFinder getHeadFinder(Properties props) {
    Locale lang = getLanguage(props);
    if (lang == Locale.ENGLISH) return new SemanticHeadFinder();
    else if (lang == Locale.CHINESE) return new ChineseSemanticHeadFinder();
    else {
      throw new RuntimeException("Invalid language setting: cannot load HeadFinder");
    }
  }

  public static Predicate<Pair<CorefChain.CorefMention, List<CoreLabel>>> getCorefMentionFilter(Properties props) {
    String filterCorefChain = props.getProperty("coref.evaluate.filter");
    if (filterCorefChain != null) {
        if ("filterCustomerAbstractPronouns".equals(filterCorefChain)) {
            return CorefUtils.filterCustomerAbstractPronouns;
        } else {
            throw new RuntimeException("Cannot create coref.evaluate.filter " + filterCorefChain);
        }
    } else {
        return null;
    }
  }
}

View on GitHub (pinned to 1b7edd19c4)