{"record":{"id":"d30339b6726ac06a","repo":"stanfordnlp/CoreNLP","slug":"no-gold-info","errorCode":null,"errorMessage":"No gold info","messagePattern":"No gold info","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/coref/data/DocumentPreprocessor.java","lineNumber":100,"sourceCode":"        if(g.hasTwin) foundGoldCount++;\n      }\n      Redwood.log(\"debug-md\", \"# of found gold mentions: \"+ foundGoldCount +\n          \" / # of gold mentions: \"+ doc.goldMentionsByID.size());\n\n    }\n\n    // assign mention numbers\n    assignMentionNumbers(doc);\n  }\n\n  /** Extract gold coref cluster information. */\n  public static void extractGoldClusters(Document doc){\n    doc.goldCorefClusters = Generics.newHashMap();\n    for (List<Mention> mentions : doc.goldMentions) {\n      for (Mention m : mentions) {\n        int id = m.goldCorefClusterID;\n        if (id == -1) {\n          throw new RuntimeException(\"No gold info\");\n        }\n        CorefCluster c = doc.goldCorefClusters.get(id);\n        if (c == null) {\n          c = new CorefCluster(id);\n          doc.goldCorefClusters.put(id, c);\n        }\n        c.corefMentions.add(m);\n      }\n    }\n  }\n\n  private static void assignMentionNumbers(Document document) {\n    List<Mention> mentionsList = CorefUtils.getSortedMentions(document);\n    for (int i = 0; i < mentionsList.size(); i++) {\n      mentionsList.get(i).mentionNum = i;\n    }\n  }\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/coref/data/DocumentPreprocessor.java#L82-L118","documentation":"DocumentPreprocessor.extractGoldClusters throws RuntimeException(\"No gold info\") when a gold Mention has goldCorefClusterID == -1, meaning the mention was never assigned to a gold coreference cluster. The document's gold annotations are incomplete.","triggerScenarios":"extractGoldClusters (via preprocess) iterating doc.goldMentions where some Mention lacks a valid goldCorefClusterID (-1) — gold cluster assignment was skipped or lost before preprocessing.","commonSituations":"Running the coref system on documents without gold mention/cluster annotation while expecting gold clusters; custom Mention construction not setting goldCorefClusterID; loading gold data with an incompatible reader version.","solutions":["Ensure gold annotations are fully loaded and goldCorefClusterID is assigned for every mention before preprocessing","If you don't need gold clusters, use a code path that doesn't call extractGoldClusters (plain annotate, not CoNLL scoring runs)","Validate gold files: every mention must belong to a coref chain","Regenerate gold data with the matching CoreNLP version's preprocessing tools"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for (List<Mention> ms : doc.goldMentions)\n  for (Mention m : ms)\n    if (m.goldCorefClusterID == -1)\n      throw new IllegalStateException(\"Mention without gold cluster: \" + m);","typeGuard":null,"tryCatchPattern":"try {\n  preprocessor.preprocess(props, doc);\n} catch (RuntimeException e) {\n  if (\"No gold info\".equals(e.getMessage())) {\n    logger.severe(\"Gold cluster IDs missing; gold annotation required for this run\");\n  } else throw e;\n}","preventionTips":["Only run CoNLL-style evaluation paths on documents with complete gold annotations","Use the plain annotate() path when gold data is not needed","When constructing Mentions manually, always assign goldCorefClusterID from the source corpus","Validate gold coverage before preprocessing"],"tags":["coref","gold-data","missing-annotation","data-consistency"],"backgroundTag":"missing-required-argument","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"}