stanfordnlp/CoreNLP · warning

Failed to get attributes from

Error message

Failed to get attributes from 

What it means

This is not a thrown exception but a logged warning in SUTime's toCoreMaps: when converting a matched time expression into CoreMap attributes, any Exception thrown by the attribute-building code is caught and, if options.verbose is on, logged as 'Failed to get attributes from <text>, timeIndex <n>'. The offending time expression is then skipped (continue), so the token range simply gets no Timex annotation. It signals the SUTime rules produced a temporal expression whose attributes could not be computed.

Solutions

  1. Enable options.verbose (or read the logged exception) to see the underlying exception and the offending text
  2. Fix or remove the problematic SUTime rule in your rules/defs files that produces the malformed temporal
  3. Update to a newer Stanford CoreNLP version; many SUTime parsing edge cases have been patched
  4. If the text is known-bad, pre-clean or skip those segments; the extractor already continues past them

Example fix

// before
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner");
// verbose off hides the root cause
// after
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner");
props.setProperty("sutime.verbose", "true"); // surface the underlying exception
// then fix/patch the SUTime rule identified by the logged stack trace
Defensive patterns

Strategy: validation

Validate before calling

// ensure options.verbose is on during development so failures are visible
Properties props = new Properties();
props.setProperty("sutime.verbose", "true");
// and pre-check that your input text is well-formed for temporal parsing
boolean sane = text != null && !text.isEmpty() && text.length() < 10_000;

Prevention

When it happens

Trigger: Running TimeExpressionExtractorImpl.extractTimeExpressionCoreMaps (e.g. via annotator 'sutime' in StanfordCoreNLP) when the per-expression attribute extraction throws — for instance a rule-generated temporal whose toCoreMaps conversion fails on unexpected input, or NumberNormalizer/parsing edge cases inside the matched expression.

Common situations: Unusual date/time text in corpora (malformed dates, partial times), custom SUTime rule files (defs.xml / sutime rules) with buggy expressions, or running with options.verbose=true while annotating noisy text; users notice missing TIMEX3 tags on some tokens rather than a crash.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at src/edu/stanford/nlp/time/TimeExpressionExtractorImpl.java:151

        String origText = annotation.get(CoreAnnotations.TextAnnotation.class);
        String text = cm.get(CoreAnnotations.TextAnnotation.class);
        if (origText != null) {
          // Make sure the text is from original (and not from concatenated tokens)
          ChunkAnnotationUtils.annotateChunkText(cm, annotation);
          text = cm.get(CoreAnnotations.TextAnnotation.class);
        }
        Map<String,String> timexAttributes;
        try {
          timexAttributes = temporal.getTimexAttributes(timeIndex);
          if (options.includeRange) {
            SUTime.Temporal rangeTemporal = temporal.getRange();
            if (rangeTemporal != null) {
              timexAttributes.put("range", rangeTemporal.toString());
            }
          }
        } catch (Exception e) {
          if (options.verbose) {
            logger.warn("Failed to get attributes from " + text + ", timeIndex " + timeIndex);
            logger.warn(e);
          }
          continue;
        }
        Timex timex;
        try {
          timex = Timex.fromMap(text, timexAttributes);
        } catch (Exception e) {
          if (options.verbose) {
            logger.warn("Failed to process timex " + text + " with attributes " + timexAttributes);
            logger.warn(e);
          }
          continue;
        }
        assert timex != null;  // Timex.fromMap never returns null and if it exceptions, we've already done a continue
        cm.set(TimeAnnotations.TimexAnnotation.class, timex);
        coreMaps.add(cm);
      }

View on GitHub (pinned to 1b7edd19c4)