{"record":{"id":"29333db7d9d3899f","repo":"stanfordnlp/CoreNLP","slug":"edu-stanford-nlp-coref-corefscorer-scorermissingex","errorCode":null,"errorMessage":"edu.stanford.nlp.coref.CorefScorer.ScorerMissingException","messagePattern":"edu\\.stanford\\.nlp\\.coref\\.CorefScorer\\.ScorerMissingException","errorType":"exception","errorClass":"ScorerMissingException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/coref/CorefScorer.java","lineNumber":32,"sourceCode":"\n/**\n * Utilities for running coref evaluation scripts and printing the results\n * @author Heeyoung Lee\n * @author Kevin Clark\n */\npublic class CorefScorer {\n  public static class ScorerMissingException extends RuntimeException {\n    private static final long serialVersionUID = 13589668547630427L;\n\n    public ScorerMissingException(String s) {\n      super(s);\n    }\n  }\n\n  public static String getEvalSummary(String evalScript, String goldFile, String predictFile) throws IOException {\n    File evalFile = new File(evalScript);\n    if (!evalFile.exists()) {\n      throw new ScorerMissingException(evalScript);\n    }\n    ProcessBuilder process = new ProcessBuilder(evalScript, \"all\", goldFile, predictFile, \"none\");\n    StringOutputStream errSos = new StringOutputStream();\n    StringOutputStream outSos = new StringOutputStream();\n    PrintWriter out = new PrintWriter(outSos);\n    PrintWriter err = new PrintWriter(errSos);\n    SystemUtils.run(process, out, err);\n    out.close();\n    err.close();\n    String summary = outSos.toString();\n    String errStr = errSos.toString();\n    if ( ! errStr.isEmpty()) {\n      summary += \"\\nERROR: \" + errStr;\n    }\n    Pattern pattern = Pattern.compile(\"\\\\d+\\\\.\\\\d\\\\d\\\\d+\");\n    DecimalFormat df = new DecimalFormat(\"#.##\");\n    Matcher matcher = pattern.matcher(summary);\n    while(matcher.find()) {","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/coref/CorefScorer.java#L14-L50","documentation":"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.","triggerScenarios":"Calling CorefScorer.getEvalSummary(evalScript, goldFile, predictFile) with a path to a scorer script that does not exist on the filesystem (evalFile.exists() is false).","commonSituations":"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.","solutions":["Download/install the official coref scoring script and place it at the path configured in evalScript","Fix the evalScript path in your properties to point to the actual scorer file (use an absolute path)","Verify the file exists with new File(path).exists() and that it is executable before running evaluation","If using the CoreNLP demo/default properties, set the dcoref scorer or score.executable property correctly"],"exampleFix":"// before\nString summary = CorefScorer.getEvalSummary(\"scripts/scorer.pl\", goldFile, predFile);\n// after\nFile scorer = new File(\"/opt/coref/scorer.pl\");\nif (!scorer.exists()) throw new IllegalStateException(\"scorer not found: \" + scorer);\nString summary = CorefScorer.getEvalSummary(scorer.getAbsolutePath(), goldFile, predFile);","handlingStrategy":"validation","validationCode":"File scorer = new File(evalScript);\nif (!scorer.exists() || !scorer.canExecute()) {\n  throw new IllegalStateException(\"Coref scorer missing or not executable: \" + evalScript);\n}","typeGuard":null,"tryCatchPattern":"try {\n  String summary = CorefScorer.getEvalSummary(evalScript, goldFile, predFile);\n} catch (edu.stanford.nlp.coref.CorefScorer.ScorerMissingException e) {\n  logger.severe(\"Scorer script not found: \" + e.getMessage());\n}","preventionTips":["Pin the scorer path with an absolute path in properties","Ship/copy the scorer script into every environment (Docker image, CI worker)","Check file existence and executability during environment setup, before running evaluation"],"tags":["coref","file-not-found","evaluation","configuration"],"backgroundTag":"file-not-found","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}