stanfordnlp/CoreNLP · info

e

Error message

e

What it means

Companion log line for the catch at TimeExpressionExtractorImpl.java:151: after 'Failed to get attributes from ...' the caught exception object itself is logged via logger.warn(e). The 'message' being merely 'e' reflects that this entry corresponds to the exception variable being emitted, carrying the real underlying cause (e.g. a NumberFormatException or ClassCastException from SUTime conversion).

Solutions

  1. Read the logged stack trace (this log entry) to identify the real exception type and cause
  2. Reproduce with the offending sentence in a small CoreNLP pipeline test
  3. Patch the SUTime rules or upgrade CoreNLP to fix the underlying parse failure
  4. Keep sutime.verbose on in CI over your corpus to catch regressions early
Defensive patterns

Strategy: try-catch

Try / catch

// CoreNLP already catches internally; if calling toCoreMaps-like logic yourself:
try {
  List<CoreMap> cms = extractor.extractTimeExpressionCoreMaps(annotation, docDate);
} catch (Exception e) {
  log.warn("SUTime attribute extraction failed", e); // preserve stack trace
}

Prevention

When it happens

Trigger: Same path as 1620: extractTimeExpressionCoreMaps -> toCoreMaps catches an Exception while building attributes for a matched time expression, with options.verbose enabled, and logs the exception object.

Common situations: Debugging why certain time strings produce no TIMEX3 output; the second warn line with the stack trace is what actually identifies the failing rule or parser branch.

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/8a85f9b50a1822e1. Report an issue: GitHub.

Appendix: source

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

        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)