stanfordnlp/CoreNLP · warning
DocDate mapping file failed to match against
Error message
DocDate mapping file failed to match against ${docID} What it means
DocDateAnnotator resolves a document's date (used by SUTime for temporal grounding) either from a mapping file (docID -> date), a fixed date, or a regex over the doc ID. When useMappingFile is on and the docID has no entry in the mapping, the annotator logs this warning and returns an empty doc date, degrading downstream relative-date resolution.
Solutions
- Ensure the document IDs match the mapping-file keys exactly (check extensions, leading paths, case sensitivity).
- Add the missing docID entries to the mapping file, or regenerate it for the current corpus.
- Configure the sutime/bindir/docid pipeline so the DocIDAnnotator runs before DocDateAnnotator and sets the document ID.
- If an exact per-document date is unavailable, switch to the fixed-date (docdate.fixedDate) or regex-based mode as a fallback.
Example fix
// before: docID 'doc-001.txt' but mapping key is 'doc-001'
props.setProperty("docdate.mapping", "docdates.txt");
// after: normalize the ID before annotation, or add the exact key
props.setProperty("docdate.mapping", "docdates.txt");
// docdates.txt now contains: doc-001.txt 2013-05-14 Defensive patterns
Strategy: fallback
Validate before calling
// Confirm every docID has a mapping entry before annotation
for (String docId : docIds) {
if (!docIdToDocDate.containsKey(docId)) {
log.warn("No docdate mapping for " + docId + "; will fall back to empty date");
}
} Prevention
- Normalize doc IDs (strip extensions/paths) consistently between the mapping file and the corpus
- Regenerate the mapping file whenever new documents are added
- Configure the DocIDAnnotator so doc IDs are always set before DocDateAnnotator runs
- Fall back to sutime's reference date or a fixed date when per-document dates are missing
When it happens
Trigger: annotate() is run on an Annotation whose doc ID (from DocIDAnnotator or the 'docid' key) is absent from the configured docdates mapping file, or the annotation has no doc ID at all (docID becomes empty string and matches nothing).
Common situations: Mapping file not regenerated after new documents were added; doc IDs formatted differently than the mapping keys (extensions, paths, case); the docid annotator not configured so the ID is missing entirely.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- DocDate regex failed to match against
- : Entry doesn't have overwriteable types , but entry type…
- : Ignoring duplicate entry: , old type = , new type =
- : Replacing duplicate entry (higher priority): old= , new=
- Could not parse subnet
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/1a0f7ee687a6ecdc.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/pipeline/DocDateAnnotator.java:103
sb.append("regex=");
sb.append(regex);
} else {
sb.append("no docDate finder");
}
sb.append(']');
description = sb.toString();
}
@Override
public void annotate(Annotation annotation) {
String docID = annotation.get(CoreAnnotations.DocIDAnnotation.class);
if (docID == null)
docID = "";
String foundDocDate;
if (useMappingFile) {
foundDocDate = docIDToDocDate.get(docID);
if (foundDocDate == null) {
log.warn("DocDate mapping file failed to match against " + docID);
foundDocDate = "";
}
} else if (useFixedDate || usePresentDate) {
foundDocDate = fixedDate;
} else if (useRegex) {
Matcher m = fileDocDatePattern.matcher(docID);
if (m.matches()) {
foundDocDate = m.group(1);
if (foundDocDate.length() == 8 && DATE_NO_HYPHENS_PATTERN.matcher(foundDocDate).matches()) {
foundDocDate = addHyphensToDate(foundDocDate);
}
} else {
log.warn("DocDate regex failed to match against " + docID);
foundDocDate = "";
}
} else {
foundDocDate = "";
}View on GitHub (pinned to 1b7edd19c4)