stanfordnlp/CoreNLP · error
Not enough information provided via command line properties…
Error message
Not enough information provided via command line properties or properties file. If you want to save a model, please specify -serializeTo. Use -help for other options.
What it means
StatTokSentTrainer.main validates that the invocation is usable: it needs something to do with the model (testFile, serializeTo, or cross-validation with >=2 folds) AND a source of the model (a training IOB file or a loadClassifier). If either side of the conjunction fails, it logs this error and returns. It prevents running an expensive pipeline that would produce or consume nothing.
Solutions
- Add -serializeTo <path> if you intend to train and save a model.
- Add -loadClassifier <path> if you intend to evaluate or re-serialize an existing model.
- Provide -trainFileIOB <path> so there is training data.
- If cross-validating, set -crossValidationFolds to >= 2 and ensure serializeTo/testFile or loadClassifier conditions are satisfied.
Example fix
// before: trains but nowhere to put the model java -cp ... StatTokSentTrainer -trainFileIOB train.iob // after java -cp ... StatTokSentTrainer -trainFileIOB train.iob -serializeTo stattok.model
Defensive patterns
Strategy: validation
Validate before calling
boolean use = testFile != null || serializeTo != null || folds >= 2;
boolean source = trainFileIOB != null || loadClassifier != null;
if (!(use && source)) {
throw new IllegalArgumentException("Need (testFile|serializeTo|folds>=2) AND (trainFileIOB|loadClassifier)");
} Prevention
- Decide train-vs-evaluate mode first, then supply exactly the matching flags.
- Never omit -serializeTo for training runs you intend to keep.
- Use -crossValidationFolds 5 rather than relying on defaults.
When it happens
Trigger: Running the trainer with, e.g., -trainFileIOB but no -serializeTo/-testFile, or with -serializeTo but no -trainFileIOB and no -loadClassifier, matching the guard `(testFile==null && serializeTo==null && folds<2) || (trainFileIOB==null && loadClassifier==null)`.
Common situations: Wanting to train-and-save but forgetting -serializeTo; trying to evaluate an existing model but forgetting -loadClassifier; setting crossValidationFolds to 1 or leaving it unset while also omitting serializeTo/testFile.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- Conflicting properties. Multi-word rules file will be…
- Error: No training file provided in properties or via…
- No multi-word rules provided. No inferMultiWordRules flag…
- No tune treebank path specified...
- args: treebankPath trainNums testNums
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/cddb37e3780ee0cb.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/process/stattok/StatTokSentTrainer.java:496
}
logger.info("Creating classifier...");
// Build the ColumnDataClassifier and train it on the temporary training file (or test it).
ColumnDataClassifier cdc = new ColumnDataClassifier(classifierProps);
String testFile = properties.getProperty("testFile", null);
String serializeTo = properties.getProperty("serializeTo", null);
String crossValidationFoldsStr = properties.getProperty("crossValidationFolds", null);
int crossValidationFolds = 0;
if (crossValidationFoldsStr != null){
crossValidationFolds = Integer.parseInt(crossValidationFoldsStr);
}
String loadClassifier = properties.getProperty("loadClassifier", null);
if ((testFile == null && serializeTo == null && crossValidationFolds < 2) ||
(trainFileIOB == null && loadClassifier == null)) {
logger.err("Not enough information provided via command line properties or properties file. If you want to save a model, please specify -serializeTo. Use -help for other options.");
return;
}
if (loadClassifier == null) {
if (!cdc.trainClassifier(trainFileIOB.getPath())) {
logger.err("Training of the CDC failed! Unable to build StatTokSent model");
return;
}
serialize(serializeTo, cdc, windowSize);
}
if (testFile != null) {
cdc.testClassifier(testFile);
}
}
}
View on GitHub (pinned to 1b7edd19c4)