@Override public void setClassLabel( IdentifiedAnnotation entityOrEventMention, Instance<String> instance ) throws AnalysisEngineProcessException { if ( this.isTraining() ) { String subj = entityOrEventMention.getSubject(); // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling if ( "patient".equals( subj ) && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample ) { return; } instance.setOutcome( subj ); logger.log( Level.DEBUG, String.format( "[%s] expected: ''; actual: ''; features: %s", this.getClass().getSimpleName(), instance.toString() ) ); } else { String label = this.classifier.classify( instance.getFeatures() ); entityOrEventMention.setSubject( label ); logger.log( Level.DEBUG, "SUBJECT is being set on an IdentifiedAnnotation: " + label + " " + entityOrEventMention.getSubject() ); } }
@Override public void setClassLabel(IdentifiedAnnotation entityOrEventMention, Instance<String> instance) throws AnalysisEngineProcessException { if (this.isTraining()) { String subj = entityOrEventMention.getSubject(); // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling if ("patient".equals(subj) && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample) { return; } instance.setOutcome(subj); logger.log(Level.DEBUG, String.format("[%s] expected: ''; actual: ''; features: %s", this.getClass().getSimpleName(), instance.toString() )); } else { String label = this.classifier.classify(instance.getFeatures()); entityOrEventMention.setSubject(label); logger.log(Level.DEBUG, "SUBJECT is being set on an IdentifiedAnnotation: "+label+" "+entityOrEventMention.getSubject()); } } public static FeatureSelection<String> createFeatureSelection(double threshold) {
@Override public void setClassLabel(IdentifiedAnnotation entityOrEventMention, Instance<String> instance) throws AnalysisEngineProcessException { if (this.isTraining()) { String subj = entityOrEventMention.getSubject(); // downsampling. initialize probabilityOfKeepingADefaultExample to 1.0 for no downsampling if ("patient".equals(subj) && coin.nextDouble() >= this.probabilityOfKeepingADefaultExample) { return; } instance.setOutcome(subj); logger.log(Level.DEBUG, String.format("[%s] expected: ''; actual: ''; features: %s", this.getClass().getSimpleName(), instance.toString() )); } else { String label = this.classifier.classify(instance.getFeatures()); entityOrEventMention.setSubject(label); logger.log(Level.DEBUG, "SUBJECT is being set on an IdentifiedAnnotation: "+label+" "+entityOrEventMention.getSubject()); } } public static FeatureSelection<String> createFeatureSelection(double threshold) {