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

  1. Move the numeric priority into the priority column (last column) of the mapping file
  2. Leave the types column empty or list actual NER types (e.g. PERSON,ORGANIZATION) that may be overwritten
  3. Compare your file against the sample mapping format in the CoreNLP distribution
  4. 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

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


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 " + annotatorName

View on GitHub (pinned to 1b7edd19c4)