{"record":{"id":"f8b79e118d7f7be9","repo":"stanfordnlp/CoreNLP","slug":"resultsprinter-align-gold-standard-sentences-don","errorCode":null,"errorMessage":"ResultsPrinter.align: gold standard sentences don't match extractor output sentences!","messagePattern":"ResultsPrinter\\.align: gold standard sentences don't match extractor output sentences!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/machinereading/ResultsPrinter.java","lineNumber":80,"sourceCode":"        String d2 = sent2.get(CoreAnnotations.DocIDAnnotation.class);\n        if (d1 != null && d2 != null && !d1.equals(d2))\n          return d1.compareTo(d2);\n\n        String t1 = sent1.get(CoreAnnotations.TextAnnotation.class);\n        String t2 = sent2.get(CoreAnnotations.TextAnnotation.class);\n        return t1.compareTo(t2);\n      }\n    }\n    Collections.sort(list1,new CompareSentences());\n    Collections.sort(list2,new CompareSentences());\n\n    for (int i = 0; i < list1.size(); i++) {\n      if (!list1.get(i).get(CoreAnnotations.TextAnnotation.class).equals(list2.get(i).get(CoreAnnotations.TextAnnotation.class)))\n        alignable = false;\n    }\n\n    if (!alignable) {\n      throw new RuntimeException(\"ResultsPrinter.align: gold standard sentences don't match extractor output sentences!\");\n    }\n  }\n\n}\n","sourceCodeStart":62,"sourceCodeEnd":85,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/machinereading/ResultsPrinter.java#L62-L85","documentation":"Thrown by ResultsPrinter.align when, after sorting both lists, the gold-standard sentences and extractor-output sentences differ in text (or count) at some position; evaluation cannot align predictions to gold, usually meaning the extractor read different input than the gold annotation file.","triggerScenarios":"Thrown at src/edu/stanford/nlp/ie/machinereading/ResultsPrinter.java:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify gold and predicted inputs cover the same documents and sentences","Check DocID/TextAnnotation consistency in both datasets","Regenerate extractor output on the exact gold test set"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}