stanfordnlp/CoreNLP · error · IllegalArgumentException

Please specify at least one of -model or -model1

Error message

Please specify at least one of -model or -model1

What it means

A usage error in TestThreadedTagger.runThreadedTest: no model paths were found among the -model/-model1/-model2... properties, so the threaded test has no taggers to load and aborts with this IllegalArgumentException.

Solutions

  1. Pass -model <path> (or -model1, -model2, ... for comparisons)
  2. Train a tagger first if none exists
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/edu/stanford/nlp/tagger/maxent/TestThreadedTagger.java:169 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10). Data as JSON: /api/errors/3706273a6672310e. Report an issue: GitHub.

Appendix: source

Thrown at src/edu/stanford/nlp/tagger/maxent/TestThreadedTagger.java:169

    } else {
      int taggerNum = 1;
      String taggerName = "model" + taggerNum;
      while (props.getProperty(taggerName) != null) {
        Properties newProps = new Properties();
        newProps.putAll(props);
        newProps.setProperty("model", props.getProperty(taggerName));
        configs.add(newProps);
        taggers.add(new MaxentTagger(configs.get(taggerNum - 1).getProperty("model"),
                                     configs.get(taggerNum - 1)));

        ++taggerNum;
        taggerName = "model" + taggerNum;
      }
    }

    // no models at all => bad
    if (taggers.isEmpty()) {
      throw new IllegalArgumentException("Please specify at least one of " +
                                         "-model or -model1");
    }

    System.out.println();
    System.out.println("Running the baseline results for tagger 1");
    System.out.println();

    // run baseline results for the first tagger model
    TaggerThread baselineThread =
      new TaggerThread(taggers.get(0), "BaseResults-1");
    baselineThread.start();
    baselineThread.join();

    ArrayList<String> baselineResults = new ArrayList<>();
    baselineResults.add(baselineThread.getResultsString());

    System.out.println();
    System.out.println("Running " + numThreads + " threads of tagger 1");

View on GitHub (pinned to 1b7edd19c4)