public NERCombinerAnnotator(boolean verbose, String... classifiers) throws IOException, ClassNotFoundException { this(new NERClassifierCombiner(classifiers), verbose); }
output = this.ner.classifySentenceWithGlobalInformation(tokens, annotation, sentence); } catch (RuntimeInterruptedException e) {
@Override public List<CoreLabel> classify(List<CoreLabel> tokens) { return classifyWithGlobalInformation(tokens, null, null); }
if (ner.usesSUTime() || ner.appliesNumericClassifiers()) { return Collections.unmodifiableSet(new HashSet<>(Arrays.asList( CoreAnnotations.TextAnnotation.class,
recognizeNumberSequences(output, document, sentence); } catch (RuntimeInterruptedException e) { throw e; copyAnswerFieldsToNERField(output); copyAnswerFieldsToNERField(output);
this.ner.finalizeAnnotation(annotation);
recognizeNumberSequences(output, document, sentence); copyAnswerFieldsToNERField(output); copyAnswerFieldsToNERField(output);
@Override public Set<Requirement> requires() { // TODO: we could check the models to see which ones use lemmas // and which ones use pos tags if (ner.usesSUTime() || ner.appliesNumericClassifiers()) { return TOKENIZE_SSPLIT_POS_LEMMA; } else { return TOKENIZE_AND_SSPLIT; } }
public void annotate(Annotation annotation) { timerStart("Adding NER Combiner annotation..."); if (annotation.containsKey(CoreAnnotations.SentencesAnnotation.class)) { // classify tokens for each sentence for (CoreMap sentence: annotation.get(CoreAnnotations.SentencesAnnotation.class)) { doOneSentence(annotation, sentence); } this.ner.finalizeAnnotation(annotation); } else { throw new RuntimeException("unable to find sentences in: " + annotation); } //timerStop("done."); }
public static NERClassifierCombiner getClassifier(ObjectInputStream ois, Properties props) throws IOException, ClassNotFoundException, ClassCastException { return new NERClassifierCombiner(ois, props); }
recognizeNumberSequences(output, document, sentence); } catch (Exception e) { System.err.println("Ignored an exception in NumberSequenceClassifier: (result is that some numbers were not classified)"); copyAnswerFieldsToNERField(output); copyAnswerFieldsToNERField(output);
if (ner.usesSUTime() || ner.appliesNumericClassifiers()) { return Collections.unmodifiableSet(new HashSet<>(Arrays.asList( CoreAnnotations.TextAnnotation.class,
@Override public List<CoreLabel> classify(List<CoreLabel> tokens) { return classifyWithGlobalInformation(tokens, null, null); }
public CoreMap doOneSentence(Annotation annotation, CoreMap sentence) { List<CoreLabel> tokens = sentence.get(CoreAnnotations.TokensAnnotation.class); List<CoreLabel> output = this.ner.classifySentenceWithGlobalInformation(tokens, annotation, sentence); if (VERBOSE) { boolean first = true;
this.ner.finalizeAnnotation(annotation);
public NERCombinerAnnotator(boolean verbose) throws IOException, ClassNotFoundException { this(new NERClassifierCombiner(new Properties()), verbose); }
recognizeNumberSequences(output, document, sentence); } catch (RuntimeInterruptedException e) { throw e; copyAnswerFieldsToNERField(output); copyAnswerFieldsToNERField(output);
@Override public List<CoreLabel> classify(List<CoreLabel> tokens) { return classifyWithGlobalInformation(tokens, null, null); }
List<CoreLabel> output = this.ner.classifySentenceWithGlobalInformation(tokens, annotation, sentence); if (VERBOSE) { boolean first = true;
nerCombiner = new NERClassifierCombiner(applyNumericClassifiers, nerLanguage, useSUTime, combinerProperties, models); } catch (IOException e) {