Example usage for edu.stanford.nlp.ie NERClassifierCombiner classify

List of usage examples for edu.stanford.nlp.ie NERClassifierCombiner classify

Introduction

In this page you can find the example usage for edu.stanford.nlp.ie NERClassifierCombiner classify.

Prototype

@Override
    public List<CoreLabel> classify(List<CoreLabel> tokens) 

Source Link

Usage

From source file:lv.lumii.ner.analysis.ClassifierComparator.java

License:Open Source License

void classify(List<CoreLabel> document) {
    this.document = document;

    // initialize AnswersAnnotation
    for (CoreLabel c : document) {
        c.set(AnswersAnnotation.class, new ArrayList<String>());
    }/*from ww w.  j  a  va2  s .com*/

    for (NERClassifierCombiner ncc : classifiers) {
        ncc.classify(document);
        for (CoreLabel c : document) {
            List<String> a = c.get(AnswersAnnotation.class);
            a.add(c.get(AnswerAnnotation.class));
            c.set(AnswerAnnotation.class, null);
            c.set(AnswersAnnotation.class, a);
        }
    }
}