stanfordnlp/CoreNLP · error · RuntimeException
no sieve type specified
Error message
no sieve type specified
What it means
Sieve.loadSieve switches on the sieve type parsed from the sieves property string. The switch's default branch throws RuntimeException("no sieve type specified") when the name does not match any known sieve type enum, meaning the configured sieve name is unrecognized or empty.
Solutions
- Check the sieves property against the valid SieveType enum values in the current CoreNLP version
- Fix typos/case in the sieve names, e.g. use "exact"/"strict"/"head" style names as documented
- Remove unknown sieve names from the comma-separated list and rerun
- If the name existed in an older version, consult the changelog for renamed sieves
Example fix
// before
props.setProperty("coref.sieves", "exact, exat, pronoun"); // typo
// after
props.setProperty("coref.sieves", "exact, strict, pronoun"); Defensive patterns
Strategy: validation
Validate before calling
Set<String> valid = Set.of("exact","strict","head","pronoun","discordant","speaker","documentproxy"); // match current SieveType enum
for (String s : props.getProperty("coref.sieves","").split(",")) { String n = s.trim(); if (!n.isEmpty() && !valid.contains(n.toLowerCase())) throw new IllegalStateException("Unknown sieve: " + n); } Try / catch
try { sieves = Sieve.loadSieves(props); } catch (RuntimeException e) { if (e.getMessage().contains("no sieve type specified")) { throw new IllegalArgumentException("Bad coref.sieves value: " + props.getProperty("coref.sieves"), e); } throw e; } Prevention
- Copy sieve lists from the official demo configs, not old blog posts
- Trim and lowercase sieve names before use
- Keep sieve names in a shared constant file
- Validate the sieves property at config load time
When it happens
Trigger: Setting the hybrid coref sieves property (e.g. coref.md.sieves or sieves list) to a sieve name that maps to no known SieveType — misspelled names like "exat" instead of "exact", an empty string, or a sieve name removed in a newer/older CoreNLP version.
Common situations: Copying sieve strings from old tutorials/blogs into a new CoreNLP version where sieve names changed; typos or wrong case in the sieves list; leaving the property empty so the parsed type is blank.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/92fbbd0932bf4c94.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/coref/hybrid/sieve/Sieve.java:130
DeterministicCorefSieve sieve = (DeterministicCorefSieve) Class.forName("edu.stanford.nlp.coref.hybrid.sieve."+sievename).getConstructor().newInstance();
sieve.props = props;
sieve.lang = HybridCorefProperties.getLanguage(props);
return sieve;
case RF:
log.info("Loading sieve: " + sievename + " from " + HybridCorefProperties.getPathModel(props, sievename) + " ... ");
RFSieve rfsieve = IOUtils.readObjectFromURLOrClasspathOrFileSystem(HybridCorefProperties.getPathModel(props, sievename));
rfsieve.thresMerge = HybridCorefProperties.getMergeThreshold(props, sievename);
log.info("done. Merging threshold: " + rfsieve.thresMerge);
return rfsieve;
case ORACLE:
OracleSieve oracleSieve = new OracleSieve(props, sievename);
oracleSieve.props = props;
return oracleSieve;
default:
throw new RuntimeException("no sieve type specified");
}
}
public static List<Sieve> loadSieves(Properties props) throws Exception {
List<Sieve> sieves = new ArrayList<>();
String sieveProp = HybridCorefProperties.getSieves(props);
String currentSieveForTrain = HybridCorefProperties.getCurrentSieveForTrain(props);
String[] sievenames = (currentSieveForTrain==null)?
sieveProp.trim().split(",\\s*") : sieveProp.split(currentSieveForTrain)[0].trim().split(",\\s*");
for(String sievename : sievenames) {
Sieve sieve = loadSieve(props, sievename);
sieves.add(sieve);
}
return sieves;
}
public static boolean hasThat(List<CoreLabel> words) {View on GitHub (pinned to 1b7edd19c4)