stanfordnlp/CoreNLP · error · RuntimeException
ERROR: MR requires full syntactic analysis!
Error message
ERROR: MR requires full syntactic analysis!
What it means
RuntimeException from GenericDataSetReader.preProcessSentences when the MachineReading relation-extraction pipeline is configured to use MR-style processing without full syntactic analysis; the reader requires complete parse trees to build grammatical relations, so partial/no parsing is rejected.
Solutions
- Enable full syntactic analysis (set the parser/annotator so parse trees are produced before reading)
- Disable MR-only processing options that skip parsing
- Check pipeline order so parsing precedes relation extraction
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/edu/stanford/nlp/ie/machinereading/GenericDataSetReader.java:278 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of stanfordnlp/CoreNLP@1b7edd19c4 (2026-09-10).
Data as JSON: /api/errors/108e40d6d0034e62.
Report an issue: GitHub.
Appendix: source
Thrown at src/edu/stanford/nlp/ie/machinereading/GenericDataSetReader.java:278
}
}
/*
List<CoreMap> sentences = dataset.get(CoreAnnotations.SentencesAnnotation.class);
for(int i = 0; i < sentences.size(); i ++){
CoreMap sent = sentences.get(i);
List<CoreLabel> tokens = sent.get(CoreAnnotations.TokensAnnotation.class);
logger.info("Tokens for sentence #" + i + ": " + tokens);
logger.info("Parse tree for sentence #" + i + ": " + sent.get(TreeCoreAnnotations.TreeAnnotation.class).pennString());
}
*/
List<CoreMap> sentences = dataset.get(CoreAnnotations.SentencesAnnotation.class);
logger.fine("Extracted " + sentences.size() + " sentences.");
for (CoreMap sentence : sentences) {
List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);
logger.fine("Processing sentence " + tokens);
Tree tree = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);
if(tree == null) throw new RuntimeException("ERROR: MR requires full syntactic analysis!");
// convert tree labels to CoreLabel if necessary
// we need this because we store additional info in the CoreLabel, such as the spans of each tree
convertToCoreLabels(tree);
// store the tree spans, if not present already
CoreLabel l = (CoreLabel) tree.label();
if(forceGenerationOfIndexSpans || (! l.containsKey(CoreAnnotations.BeginIndexAnnotation.class) && ! l.containsKey(CoreAnnotations.EndIndexAnnotation.class))){
tree.indexSpans(0);
logger.fine("Index spans were generated.");
} else {
logger.fine("Index spans were NOT generated.");
}
logger.fine("Parse tree using CoreLabel:\n" + tree.pennString());
//
// now match all entity mentions against the syntactic tree
//View on GitHub (pinned to 1b7edd19c4)