{"record":{"id":"4a72634a2a259ebd","repo":"stanfordnlp/CoreNLP","slug":"must-load-a-classifier-when-creating-a-column-data","errorCode":null,"errorMessage":"Must load a classifier when creating a column data classifier annotator","messagePattern":"Must load a classifier when creating a column data classifier annotator","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/pipeline/AnnotatorImplementations.java","lineNumber":251,"sourceCode":"  }\n\n  /**\n   * Annotate for sentiment in sentences\n   */\n  public Annotator sentiment(Properties properties, String name) {\n    return new SentimentAnnotator(name, properties);\n  }\n\n\n  /**\n   * Annotate with the column data classifier.\n   */\n  public Annotator columnData(Properties properties) {\n    if (properties.containsKey(\"classify.loadClassifier\")) {\n      properties.setProperty(\"loadClassifier\", properties.getProperty(\"classify.loadClassifier\"));\n    }\n    if (!properties.containsKey(\"loadClassifier\")) {\n      throw new RuntimeException(\"Must load a classifier when creating a column data classifier annotator\");\n    }\n    return new ColumnDataClassifierAnnotator(properties);\n  }\n\n  /**\n   * Annotate dependency relations in sentences\n   */\n  public Annotator dependencies(Properties properties) {\n    Properties relevantProperties = PropertiesUtils.extractPrefixedProperties(properties,\n        Annotator.STANFORD_DEPENDENCIES + '.');\n    if (!relevantProperties.containsKey(\"nthreads\") &&\n        properties.containsKey(\"nthreads\")) {\n      relevantProperties.setProperty(\"nthreads\", properties.getProperty(\"nthreads\"));\n    }\n\n    return new DependencyParseAnnotator(relevantProperties);\n  }\n","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/AnnotatorImplementations.java#L233-L269","documentation":"Stanford CoreNLP's columnData annotator wraps ColumnDataClassifier, which can only run if a trained classifier model is supplied. AnnotatorImplementations.columnData() requires a 'loadClassifier' property; if absent it throws this RuntimeException before creating the annotator.","triggerScenarios":"Calling AnnotatorFactory/StanfordCoreNLP with annotator 'classify' (column data) while the Properties contain neither 'loadClassifier' nor 'classify.loadClassifier'.","commonSituations":"Users configure 'annotators=classify' but forget to point at a trained ColumnDataClassifier model file; copying a properties template that omits the model path; renaming the property key so it no longer matches.","solutions":["Set 'classify.loadClassifier' (or 'loadClassifier') to the path of your trained classifier model in the Properties before creating the pipeline","Verify the model file exists and is readable at that path","If you meant generic classification, check you are using the right annotator name and its documented properties"],"exampleFix":"// before\nprops.setProperty(\"annotators\", \"classify\");\n// after\nprops.setProperty(\"annotators\", \"classify\");\nprops.setProperty(\"classify.loadClassifier\", \"models/my-column-classifier.txt\");","handlingStrategy":"validation","validationCode":"Properties props = ...;\nif (!props.containsKey(\"loadClassifier\") && !props.containsKey(\"classify.loadClassifier\")) {\n  throw new IllegalArgumentException(\"classify annotator requires classify.loadClassifier\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  Annotator a = impl.columnData(props);\n} catch (RuntimeException e) {\n  if (e.getMessage().contains(\"Must load a classifier\")) {\n    // prompt user for classify.loadClassifier\n  } else throw e;\n}","preventionTips":["Always set classify.loadClassifier when using the classify annotator","Check model file existence with File.exists() before building the pipeline","Reuse a validated properties template"],"tags":["stanford-corenlp","configuration","missing-property","nlp"],"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"}