stanfordnlp/CoreNLP · warning
Number in types column for
Error message
Number in types column for ${key} is probably priority: ${split[iOverwrite]} What it means
When reading a TokensRegexNER mapping file, the annotator checks the 'types' (overwritable types) column. If the value there is a pure number, it is almost certainly a misplaced priority value (priority belongs in its own column), so this warning is logged. The value is still split as types, likely producing a bogus numeric type.
Solutions
- Move the numeric priority into the priority column (last column) of the mapping file
- Leave the types column empty or list actual NER types (e.g. PERSON,ORGANIZATION) that may be overwritten
- Compare your file against the sample mapping format in the CoreNLP distribution
- Count tab-separated columns per line to ensure they match the expected schema
Example fix
// before (mapping line) Barack 1.0 0.0 // after Barack PERSON 0.0 1.0
Defensive patterns
Strategy: validation
Validate before calling
String[] cols = line.split("\t", -1);
for (String col : cols) {
if (col.matches("\\d+(\\.\d+)?"))
throw new IllegalArgumentException("Numeric value in non-numeric column: " + line);
} Prevention
- Follow the documented mapping-file column order exactly
- Put priorities only in the priority (last) column
- Validate column count and content with a pre-deployment lint script
- Compare against sample mapping files shipped with CoreNLP
When it happens
Trigger: A mapping file row whose priority number was written into the types column (wrong column count), e.g. 'word 1.0' where 1.0 is the priority but sits where types are expected.
Common situations: Hand-edited rules files with columns transposed or missing; copy-paste from spreadsheets dropping a column; format changes between CoreNLP versions (4-column vs 5-column mapping files).
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- : Unknown field: cannot find suitable annotation class
- : Entry has multiple types for : . Taking type to be
- : Replacing duplicate entry (higher priority): old= , new=
- : Ignoring duplicate entry: , old type = , new type =
- : Entry doesn't have overwriteable types , but entry type…
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/0fc4d618164e4358.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/pipeline/TokensRegexNERAnnotator.java:758
String[] key = (regexes != null)? regexes: new String[] { tokensRegex };
if (ignoreCase) {
String[] norm = new String[key.length];
for (int i = 0; i < key.length; i++) {
norm[i] = key[i].toLowerCase();
}
key = norm;
}
String[] types = new String[annotationCols.length];
for (int i = 0; i < annotationCols.length; i++) {
types[i] = split[annotationCols[i]].trim();
}
final Set<String> overwritableTypes;
double priority = 0.0;
if (iOverwrite >= 0 && split.length > iOverwrite) {
if (NUMBER_PATTERN.matcher(split[iOverwrite].trim()).matches()) {
logger.warn("Number in types column for " + Arrays.toString(key) +
" is probably priority: " + split[iOverwrite]);
}
String[] tempOTs = COMMA_DELIMITERS_PATTERN.split(split[iOverwrite].trim());
if (tempOTs.length == 0) {
overwritableTypes = Collections.emptySet();
} else if (tempOTs.length == 1) {
overwritableTypes = Collections.singleton(tempOTs[0]);
} else {
overwritableTypes = new HashSet<>(Arrays.asList(tempOTs));
}
} else {
overwritableTypes = Collections.emptySet();
}
if (iPriority >= 0 && split.length > iPriority) {
try {
priority = Double.parseDouble(split[iPriority].trim());
} catch (NumberFormatException e) {
throw new IllegalArgumentException("TokensRegexNERAnnotator " + annotatorNameView on GitHub (pinned to 1b7edd19c4)