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
- Read the logged stack trace (this log entry) to identify the real exception type and cause
- Reproduce with the offending sentence in a small CoreNLP pipeline test
- Patch the SUTime rules or upgrade CoreNLP to fix the underlying parse failure
- 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
- Always log the exception object, not just a message
- Correlate the second warn line with the first to find the root cause
- Keep regression tests for sentences that historically failed
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)