{"record":{"id":"cddb37e3780ee0cb","repo":"stanfordnlp/CoreNLP","slug":"not-enough-information-provided-via-command-line-p","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/process/stattok/StatTokSentTrainer.java","lineNumber":496,"sourceCode":"    }\n\n    logger.info(\"Creating classifier...\");\n\n    // Build the ColumnDataClassifier and train it on the temporary training file (or test it).\n    ColumnDataClassifier cdc = new ColumnDataClassifier(classifierProps);\n\n    String testFile \t\t\t= properties.getProperty(\"testFile\", null);\n    String serializeTo \t\t\t= properties.getProperty(\"serializeTo\", null);\n    String crossValidationFoldsStr \t= properties.getProperty(\"crossValidationFolds\", null);\n    int crossValidationFolds \t\t= 0;\n    if (crossValidationFoldsStr != null){\n      crossValidationFolds = Integer.parseInt(crossValidationFoldsStr);\n    }\n    String loadClassifier\t\t= properties.getProperty(\"loadClassifier\", null); \n\n    if ((testFile == null && serializeTo == null && crossValidationFolds < 2) ||\n        (trainFileIOB == null && loadClassifier == null)) { \n      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.\");\n      return;\n    }\n\n    if (loadClassifier == null) {\n      if (!cdc.trainClassifier(trainFileIOB.getPath())) {\n        logger.err(\"Training of the CDC failed!  Unable to build StatTokSent model\");\n        return;\n      }\n      serialize(serializeTo, cdc, windowSize);\n    }\n\n    if (testFile != null) {\n      cdc.testClassifier(testFile);\n    }\n  }\n}\n","sourceCodeStart":478,"sourceCodeEnd":513,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/process/stattok/StatTokSentTrainer.java#L478-L513","documentation":"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.","triggerScenarios":"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)`.","commonSituations":"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.","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."],"exampleFix":"// before: trains but nowhere to put the model\njava -cp ... StatTokSentTrainer -trainFileIOB train.iob\n// after\njava -cp ... StatTokSentTrainer -trainFileIOB train.iob -serializeTo stattok.model","handlingStrategy":"validation","validationCode":"boolean use = testFile != null || serializeTo != null || folds >= 2;\nboolean source = trainFileIOB != null || loadClassifier != null;\nif (!(use && source)) {\n    throw new IllegalArgumentException(\"Need (testFile|serializeTo|folds>=2) AND (trainFileIOB|loadClassifier)\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["java","cli","configuration","training"],"backgroundTag":"missing-required-config","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}