stanfordnlp/CoreNLP · error

Error: coref.algorithm=hybrid is not supported for English…

Error message

Error: coref.algorithm=hybrid is not supported for English, please change coref.algorithm or coref.language

What it means

CorefAnnotator's constructor rejects the combination coref.algorithm=hybrid with coref.language=ENGLISH because the hybrid coreference algorithm is not implemented for English. It logs the message and throws a RuntimeException (no message) during annotator initialization.

Solutions

  1. Change coref.algorithm to a supported English algorithm, e.g. "statistical" or "neural".
  2. Alternatively change coref.language to a locale where hybrid is supported.
  3. Remove the coref.algorithm property entirely to use the default for the language.

Example fix

// before
props.setProperty("coref.algorithm", "hybrid");
// after
props.setProperty("coref.algorithm", "statistical");
Defensive patterns

Strategy: validation

Validate before calling

if ("hybrid".equalsIgnoreCase(props.getProperty("coref.algorithm", "")) && "ENGLISH".equalsIgnoreCase(props.getProperty("coref.language", "ENGLISH"))) { props.setProperty("coref.algorithm", "statistical"); }

Try / catch

try { pipeline = new StanfordCoreNLP(props); } catch (RuntimeException e) { if (e.getMessage() == null && props.getProperty("coref.algorithm", "").equalsIgnoreCase("hybrid")) { props.setProperty("coref.algorithm", "statistical"); pipeline = new StanfordCoreNLP(props); } else { throw e; } }

Prevention

When it happens

Trigger: Setting properties "coref.algorithm"="hybrid" (deterministic + statistical) together with English coref language, e.g. props.setProperty("coref.algorithm", "hybrid") in a standard English pipeline containing 'coref'.

Common situations: Copying config templates that use hybrid (common for other languages, e.g. Chinese) into an English pipeline; leaving a default algorithm value that resolves to HYBRID while language stays English.

Related errors


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

Appendix: source

Thrown at src/edu/stanford/nlp/pipeline/CorefAnnotator.java:65

  private static final Redwood.RedwoodChannels log = Redwood.channels(CorefAnnotator.class);

  private final CorefSystem corefSystem;

  private boolean performMentionDetection;
  private CorefMentionAnnotator mentionAnnotator;

  private final Properties props;

  public CorefAnnotator(Properties props) {
    this.props = props;
    try {
      // if user tries to run with coref.language = ENGLISH and coref.algorithm = hybrid, throw Exception
      // we do not support those settings at this time
      if (CorefProperties.algorithm(props).equals(CorefProperties.CorefAlgorithmType.HYBRID) &&
          CorefProperties.getLanguage(props).equals(Locale.ENGLISH)) {
        log.error("Error: coref.algorithm=hybrid is not supported for English, " +
            "please change coref.algorithm or coref.language");
        throw new RuntimeException();
      }
      // suppress
      props.setProperty("coref.printConLLLoadingMessage","false");
      corefSystem = new CorefSystem(props);
      props.remove("coref.printConLLLoadingMessage");
    } catch (Exception e) {
      log.error("Error creating CorefAnnotator...terminating pipeline construction!");
      log.error(e);
      throw new RuntimeException(e);
    }
    // unless custom mention detection is set, just use the default coref mention detector
    performMentionDetection = !PropertiesUtils.getBool(props, "coref.useCustomMentionDetection", false);
    if (performMentionDetection)
      mentionAnnotator = new CorefMentionAnnotator(props);
  }

  // flip which granularity of ner tag is primary
  private static void setNamedEntityTagGranularity(Annotation annotation, String granularity) {

View on GitHub (pinned to 1b7edd19c4)