stanfordnlp/CoreNLP · error · RuntimeException

No input file specified!

Error message

No input file specified!

What it means

initializeAndRunCoref chooses a MentionExtractor based on which input property is present: a test file (dcoref/conll2012 test properties), ACE input (Constants.ACE_PROP), or CoNLL-2011 input (Constants.CONLL2011_PROP). If none of these input properties is set, there is no data source, so it throws a RuntimeException 'No input file specified!'.

Solutions

  1. Set the appropriate input property in your coref properties file (e.g. dcoref.conll2011=PATH, the ACE property, or the test-file property) before running
  2. Point the property at an existing, correctly formatted input file
  3. Check the exact property keys in edu.stanford.nlp.dcoref.Constants for your CoreNLP version (they changed over releases)
  4. If running coref on raw text, use the coref annotator in the pipeline (annotators=...,coref) rather than SieveCoreferenceSystem.main, which is corpus-oriented

Example fix

// before
coref.props:
  dcoref.sieves = ...
// after
coref.props:
  dcoref.sieves = ...
  dcoref.conll2011 = /data/conll2011/test/path
Defensive patterns

Strategy: validation

Validate before calling

String[] keys = {"dcoref.conll2011", "dcoref.ace", "dcoref.test" /* check Constants for exact names */};
boolean hasInput = false;
for (String k : keys) if (props.containsKey(k)) { hasInput = true; }
if (!hasInput) throw new IllegalArgumentException(
  "Set one of " + Arrays.toString(keys) + " (see Constants.*_PROP) before running coref");

Try / catch

try {
  SieveCoreferenceSystem.initializeAndRunCoref(props);
} catch (RuntimeException e) {
  if (e.getMessage() != null && e.getMessage().contains("No input file specified")) {
    logger.severe("No corpus input configured; set the ACE/CoNLL/test-file property.");
  } else throw e;
}

Prevention

When it happens

Trigger: Running the SieveCoreferenceSystem via main (or initializeAndRunCoref directly) with a properties object that sets neither the MUC/test-file property, nor Constants.ACE_PROP, nor Constants.CONLL2011_PROP.

Common situations: Running coref from the command line with a props file missing the input key; renaming/migrating property keys between CoreNLP versions; building a Properties object programmatically and forgetting the input entry; expecting the system to read plain text when it only accepts MUC/ACE/CoNLL formatted corpora.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at src/edu/stanford/nlp/dcoref/SieveCoreferenceSystem.java:358

    logger.fine(props.toString());
    Constants.printConstants(logger);

    // initialize coref system
    SieveCoreferenceSystem corefSystem = new SieveCoreferenceSystem(props);

    // MentionExtractor extracts MUC, ACE, or CoNLL documents
    MentionExtractor mentionExtractor;
    if (props.containsKey(Constants.MUC_PROP)){
      mentionExtractor = new MUCMentionExtractor(corefSystem.dictionaries, props,
                                                 corefSystem.semantics, corefSystem.singletonPredictor);
    } else if(props.containsKey(Constants.ACE2004_PROP) || props.containsKey(Constants.ACE2005_PROP)) {
      mentionExtractor = new ACEMentionExtractor(corefSystem.dictionaries, props,
                                                 corefSystem.semantics, corefSystem.singletonPredictor);
    } else if (props.containsKey(Constants.CONLL2011_PROP)) {
      mentionExtractor = new CoNLLMentionExtractor(corefSystem.dictionaries, props,
                                                   corefSystem.semantics, corefSystem.singletonPredictor);
    } else {
      throw new RuntimeException("No input file specified!");
    }

    if (!Constants.USE_GOLD_MENTIONS) {
      // Set mention finder
      String mentionFinderClass = props.getProperty(Constants.MENTION_FINDER_PROP);
      if (mentionFinderClass != null) {
        String mentionFinderPropFilename = props.getProperty(Constants.MENTION_FINDER_PROPFILE_PROP);
        CorefMentionFinder mentionFinder;
        if (mentionFinderPropFilename != null) {
          Properties mentionFinderProps = new Properties();
          try (FileInputStream fis = new FileInputStream(mentionFinderPropFilename)) {
            mentionFinderProps.load(fis);
          }
          mentionFinder = (CorefMentionFinder) Class.forName(mentionFinderClass).getConstructor(Properties.class).newInstance(mentionFinderProps);
        } else {
          mentionFinder = (CorefMentionFinder) Class.forName(mentionFinderClass).newInstance();
        }
        mentionExtractor.setMentionFinder(mentionFinder);

View on GitHub (pinned to 1b7edd19c4)