{"record":{"id":"d47f140a26ca3d8d","repo":"stanfordnlp/CoreNLP","slug":"no-annealing-type-specified","errorCode":null,"errorMessage":"No annealing type specified","messagePattern":"No annealing type specified","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/crf/CRFClassifier.java","lineNumber":1259,"sourceCode":"      TestSequenceModel testSequenceModel = new TestSequenceModel(cliqueTree);\n      ExactBestSequenceFinder tagInference = new ExactBestSequenceFinder();\n      int[] bestSequence = tagInference.bestSequence(testSequenceModel);\n      System.arraycopy(bestSequence, windowSize - 1, sequence, 0, sequence.length);\n    } else {\n      int[] initialSequence = SequenceGibbsSampler.getRandomSequence(model);\n      System.arraycopy(initialSequence, 0, sequence, 0, sequence.length);\n    }\n\n    sampler.verbose = 0;\n\n    if (flags.annealingType.equalsIgnoreCase(\"linear\")) {\n      sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getLinearSchedule(1.0, flags.numSamples),\n          sequence);\n    } else if (flags.annealingType.equalsIgnoreCase(\"exp\") || flags.annealingType.equalsIgnoreCase(\"exponential\")) {\n      sequence = sampler.findBestUsingAnnealing(model, CoolingSchedule.getExponentialSchedule(1.0, flags.annealingRate,\n          flags.numSamples), sequence);\n    } else {\n      throw new RuntimeException(\"No annealing type specified\");\n    }\n\n    if (flags.useReverse) {\n      Collections.reverse(document);\n    }\n\n    for (int j = 0, dsize = newDocument.size(); j < dsize; j++) {\n      IN wi = document.get(j);\n      if (wi == null) throw new RuntimeException(\"\");\n      if (classIndex == null) throw new RuntimeException(\"\");\n      wi.set(CoreAnnotations.AnswerAnnotation.class, classIndex.get(sequence[j]));\n    }\n\n    if (flags.useReverse) {\n      Collections.reverse(document);\n    }\n\n    return document;","sourceCodeStart":1241,"sourceCodeEnd":1277,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/crf/CRFClassifier.java#L1241-L1277","documentation":"When Gibbs sampling uses annealing, CRFClassifier dispatches on flags.annealingType: \"linear\" and \"exp\"/\"exponential\" (case-insensitive) select the corresponding CoolingSchedule. Any other value falls through to this RuntimeException because no cooling schedule implementation exists for it in this version.","triggerScenarios":"Setting annealingType to a misspelled or unsupported value (e.g. \"hyperbolic\", \"exponencial\") while the Gibbs path calls sampler.findBestUsingAnnealing.","commonSituations":"Typos; copying annealing settings from papers/toolkits supporting other schedules; forgetting that only linear and exponential schedules are implemented.","solutions":["Set annealingType to \"linear\", \"exp\", or \"exponential\" (case-insensitive).","Set annealingRate to a sensible value when using the exponential schedule.","If another schedule is required, add a branch constructing the desired CoolingSchedule and recompile.","Or drop annealingType so the sampler uses its non-annealing path."],"exampleFix":"// before\nprops.setProperty(\"annealingType\", \"hyperbolic\");\n// after\nprops.setProperty(\"annealingType\", \"exp\");\nprops.setProperty(\"annealingRate\", \"0.99\");","handlingStrategy":"validation","validationCode":"String at = props.getProperty(\"annealingType\", \"\").toLowerCase(Locale.ROOT);\nif (!at.isEmpty() && !at.equals(\"linear\") && !at.equals(\"exp\") && !at.equals(\"exponential\")) {\n  throw new IllegalArgumentException(\"annealingType must be linear or exp/exponential\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  classifier.classify(docs);\n} catch (RuntimeException e) {\n  if (\"No annealing type specified\".equals(e.getMessage())) {\n    props.setProperty(\"annealingType\", \"exp\");\n    props.setProperty(\"annealingRate\", \"0.99\");\n    // reconfigure and retry\n  } else throw e;\n}","preventionTips":["Use only linear/exp/exponential annealingType values.","Set annealingRate whenever using the exponential schedule.","Keep Gibbs+annealing settings grouped in one reviewed config block."],"tags":["java","config","crf","annealing"],"backgroundTag":"invalid-enum-value","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"}