@Override public void process(JCas cas) throws AnalysisEngineProcessException { // Return early if no Constituent is present if (!JCasUtil.exists(cas, Constituent.class)) return; // Lazy loading if (this.classifier == null) { init(); } String tree = ts.serializeTree(RichTree.getConstituencyTree(cas), this.parameterList); String example = "|BT| " + tree + " |ET|"; String questionClass = this.classifier.getMostConfidentModel(example); addQuestionClassAnnotation(cas, questionClass); }