{"record":{"id":"108e40d6d0034e62","repo":"stanfordnlp/CoreNLP","slug":"error-mr-requires-full-syntactic-analysis","errorCode":null,"errorMessage":"ERROR: MR requires full syntactic analysis!","messagePattern":"ERROR: MR requires full syntactic analysis!","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/ie/machinereading/GenericDataSetReader.java","lineNumber":278,"sourceCode":"      }\n    }\n    /*\n    List<CoreMap> sentences = dataset.get(CoreAnnotations.SentencesAnnotation.class);\n    for(int i = 0; i < sentences.size(); i ++){\n      CoreMap sent = sentences.get(i);\n      List<CoreLabel> tokens = sent.get(CoreAnnotations.TokensAnnotation.class);\n      logger.info(\"Tokens for sentence #\" + i + \": \" + tokens);\n      logger.info(\"Parse tree for sentence #\" + i + \": \" + sent.get(TreeCoreAnnotations.TreeAnnotation.class).pennString());\n    }\n    */\n\n    List<CoreMap> sentences = dataset.get(CoreAnnotations.SentencesAnnotation.class);\n    logger.fine(\"Extracted \" + sentences.size() + \" sentences.\");\n    for (CoreMap sentence : sentences) {\n      List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class);\n      logger.fine(\"Processing sentence \" + tokens);\n      Tree tree = sentence.get(TreeCoreAnnotations.TreeAnnotation.class);\n      if(tree == null) throw new RuntimeException(\"ERROR: MR requires full syntactic analysis!\");\n\n      // convert tree labels to CoreLabel if necessary\n      // we need this because we store additional info in the CoreLabel, such as the spans of each tree\n      convertToCoreLabels(tree);\n\n      // store the tree spans, if not present already\n      CoreLabel l = (CoreLabel) tree.label();\n      if(forceGenerationOfIndexSpans || (! l.containsKey(CoreAnnotations.BeginIndexAnnotation.class) && ! l.containsKey(CoreAnnotations.EndIndexAnnotation.class))){\n        tree.indexSpans(0);\n        logger.fine(\"Index spans were generated.\");\n      } else {\n        logger.fine(\"Index spans were NOT generated.\");\n      }\n      logger.fine(\"Parse tree using CoreLabel:\\n\" + tree.pennString());\n\n      //\n      // now match all entity mentions against the syntactic tree\n      //","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/ie/machinereading/GenericDataSetReader.java#L260-L296","documentation":"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.","triggerScenarios":"Thrown at src/edu/stanford/nlp/ie/machinereading/GenericDataSetReader.java:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}