{"record":{"id":"a59579371d2f62e0","repo":"stanfordnlp/CoreNLP","slug":"no-gold-info-a59579","errorCode":null,"errorMessage":"No gold info","messagePattern":"No gold info","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/dcoref/Document.java","lineNumber":497,"sourceCode":"    }\n    if(!hasOriginalID){\n      int id = 0;\n      for(List<Mention> l : orderedMentionsBySentence){\n        for(Mention m : l){\n          m.mentionID = id++;\n        }\n      }\n    }\n  }\n\n  /** Extract gold coref cluster information. */\n  public void extractGoldCorefClusters(){\n    goldCorefClusters = Generics.newHashMap();\n    for (List<Mention> mentions : goldOrderedMentionsBySentence) {\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 = goldCorefClusters.get(id);\n        if (c == null) {\n          c = new CorefCluster(id);\n          goldCorefClusters.put(id, c);\n        }\n        c.corefMentions.add(m);\n      }\n    }\n  }\n\n  protected List<Pair<IntTuple, IntTuple>> getGoldLinks() {\n    if(goldLinks==null) this.extractGoldLinks();\n    return goldLinks;\n  }\n\n  /** Extract gold coref link information */\n  protected void extractGoldLinks() {","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/dcoref/Document.java#L479-L515","documentation":"extractGoldCorefClusters builds the gold coreference clusters from goldOrderedMentionsBySentence and throws RuntimeException(\"No gold info\") when any mention has goldCorefClusterID == -1, i.e. no gold annotation exists. dcoref requires a gold-annotated corpus (or gold preprocessing) to score; it cannot build clusters without gold IDs.","triggerScenarios":"Running the coref system in a mode that calls extractGoldCorefClusters (runCorefSystem/runAndScoreCoref/generateFeatureVectors) on a document whose mentions were parsed without gold coref annotations (e.g. plain-text input, no MUC/CoNLL gold key, mentions parsed by SentenceMatchedMentionExtractor without gold data).","commonSituations":"Running on unannotated raw text while using an evaluation/scored pipeline, missing gold key file in properties, or using a mention extractor that does not load gold cluster IDs.","solutions":["Provide a gold key (MUC/CoNLL) file so gold coref cluster IDs get assigned","Run with a mention extractor that reads gold annotations (MUCMentionExtractor/CoNLLMentionExtractor) with gold input configured","If only running on raw text, use the non-scoring coref pipeline path (no gold extraction/scored output)","Check that preprocessed gold mentions set goldCorefClusterID correctly"],"exampleFix":"// before\nprops.setProperty(\"coref.conll.outputDir\", \"out\"); // raw text, no gold key, scoring pipeline\n// after\nprops.setProperty(\"dcoref.score\", \"false\"); // skip gold-based scoring for raw text\n// or supply gold input:\nprops.setProperty(\"coref.doc.conll\", \"test/test.conll\");","handlingStrategy":"validation","validationCode":"// before running a scoring coref pipeline, ensure gold annotations are present\nfor (List<Mention> mentions : document.getGoldOrderedMentionsBySentence()) {\n    for (Mention m : mentions) {\n        if (m.goldCorefClusterID == -1) {\n            throw new IllegalStateException(\"Document lacks gold coref annotations\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    doc.extractGoldCorefClusters();\n} catch (RuntimeException e) {\n    if (\"No gold info\".equals(e.getMessage())) {\n        log.warn(\"No gold annotations; switching to non-scoring pipeline\");\n        return; // run without scoring\n    }\n    throw e;\n}","preventionTips":["Only use gold-based scoring entry points with gold-annotated (MUC/CoNLL) input","Configure a gold key file when you need scores","Use the plain coref pipeline for raw unannotated text","Verify preprocessing preserved goldCorefClusterID values"],"tags":["java","corenlp","gold-annotation","scoring"],"backgroundTag":"missing-required-config-field","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"}