stanfordnlp/CoreNLP · error · ScorerMissingException

edu.stanford.nlp.coref.CorefScorer.ScorerMissingException

Error message

edu.stanford.nlp.coref.CorefScorer.ScorerMissingException

What it means

CorefScorer.getEvalSummary throws ScorerMissingException when the external coref scoring script (e.g. the official CoNLL scorer executable) does not exist at the path given by evalScript. This library shells out to a Perl/reference scorer to compute MUC, B^3, CEAFe etc., so it must be present on disk before evaluation runs.

Solutions

  1. Download/install the official coref scoring script and place it at the path configured in evalScript
  2. Fix the evalScript path in your properties to point to the actual scorer file (use an absolute path)
  3. Verify the file exists with new File(path).exists() and that it is executable before running evaluation
  4. If using the CoreNLP demo/default properties, set the dcoref scorer or score.executable property correctly

Example fix

// before
String summary = CorefScorer.getEvalSummary("scripts/scorer.pl", goldFile, predFile);
// after
File scorer = new File("/opt/coref/scorer.pl");
if (!scorer.exists()) throw new IllegalStateException("scorer not found: " + scorer);
String summary = CorefScorer.getEvalSummary(scorer.getAbsolutePath(), goldFile, predFile);
Defensive patterns

Strategy: validation

Validate before calling

File scorer = new File(evalScript);
if (!scorer.exists() || !scorer.canExecute()) {
  throw new IllegalStateException("Coref scorer missing or not executable: " + evalScript);
}

Try / catch

try {
  String summary = CorefScorer.getEvalSummary(evalScript, goldFile, predFile);
} catch (edu.stanford.nlp.coref.CorefScorer.ScorerMissingException e) {
  logger.severe("Scorer script not found: " + e.getMessage());
}

Prevention

When it happens

Trigger: Calling CorefScorer.getEvalSummary(evalScript, goldFile, predictFile) with a path to a scorer script that does not exist on the filesystem (evalFile.exists() is false).

Common situations: Users forget to download/build the reference coref scorer; the scorer path property points to a wrong or relative directory; running on a machine/container where the scorer was not copied in; path typos or missing execute permissions treated as missing file by scripts.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at src/edu/stanford/nlp/coref/CorefScorer.java:32

/**
 * Utilities for running coref evaluation scripts and printing the results
 * @author Heeyoung Lee
 * @author Kevin Clark
 */
public class CorefScorer {
  public static class ScorerMissingException extends RuntimeException {
    private static final long serialVersionUID = 13589668547630427L;

    public ScorerMissingException(String s) {
      super(s);
    }
  }

  public static String getEvalSummary(String evalScript, String goldFile, String predictFile) throws IOException {
    File evalFile = new File(evalScript);
    if (!evalFile.exists()) {
      throw new ScorerMissingException(evalScript);
    }
    ProcessBuilder process = new ProcessBuilder(evalScript, "all", goldFile, predictFile, "none");
    StringOutputStream errSos = new StringOutputStream();
    StringOutputStream outSos = new StringOutputStream();
    PrintWriter out = new PrintWriter(outSos);
    PrintWriter err = new PrintWriter(errSos);
    SystemUtils.run(process, out, err);
    out.close();
    err.close();
    String summary = outSos.toString();
    String errStr = errSos.toString();
    if ( ! errStr.isEmpty()) {
      summary += "\nERROR: " + errStr;
    }
    Pattern pattern = Pattern.compile("\\d+\\.\\d\\d\\d+");
    DecimalFormat df = new DecimalFormat("#.##");
    Matcher matcher = pattern.matcher(summary);
    while(matcher.find()) {

View on GitHub (pinned to 1b7edd19c4)