Package edu.stanford.nlp.ie

Examples of edu.stanford.nlp.ie.NERClassifierCombiner


    boolean verbose = false;

    String[] loadPaths = models.toArray(new String[models.size()]);

    NERClassifierCombiner nerCombiner = new NERClassifierCombiner(applyNumericClassifiers, useSUTime, properties, loadPaths);

    int nThreads = PropertiesUtils.getInt(properties, "ner.nthreads", PropertiesUtils.getInt(properties, "nthreads", 1));
    long maxTime = PropertiesUtils.getLong(properties, "ner.maxtime", 0);

    return new NERCombinerAnnotator(nerCombiner, verbose, nThreads, maxTime);
View Full Code Here


  }

  public NERCombinerAnnotator(boolean verbose)
    throws IOException, ClassNotFoundException
  {
    this(new NERClassifierCombiner(new Properties()), verbose);
  }
View Full Code Here

  }

  public NERCombinerAnnotator(boolean verbose, String... classifiers)
    throws IOException, ClassNotFoundException
  {
    this(new NERClassifierCombiner(classifiers), verbose);
  }
View Full Code Here

    }
    if (models.isEmpty()) {
      // Allow for no real NER model - can just use numeric classifiers or SUTime
      System.err.println("WARNING: no NER models specified");
    }
    NERClassifierCombiner nerCombiner;
    try {
      // TODO: use constants for part after prefix so we can ensure consistent options
      boolean applyNumericClassifiers =
              PropertiesUtils.getBool(properties,
                      prefix + "applyNumericClassifiers",
                      NERClassifierCombiner.APPLY_NUMERIC_CLASSIFIERS_DEFAULT);
      boolean useSUTime =
              PropertiesUtils.getBool(properties,
                      prefix + "useSUTime",
                      NumberSequenceClassifier.USE_SUTIME_DEFAULT);
      // TODO: properties are passed in as it for number sequence classifiers (don't care about the prefix)
      nerCombiner = new NERClassifierCombiner(applyNumericClassifiers,
              useSUTime, properties,
              models.toArray(new String[models.size()]));
    } catch (FileNotFoundException e) {
      throw new RuntimeIOException(e);
    }
View Full Code Here

        Properties props = new Properties();
        props.setProperty("ner.applyNumericClassifiers", "false");
        props.setProperty("ner.useSUTime", "false");
        props.setProperty("ner.model", NER_3CLASS);
        NERClassifierCombiner ner = NERCombinerAnnotator.createNERClassifierCombiner("ner", props);
        NERCombinerAnnotator threaded4Annotator = new NERCombinerAnnotator(ner, false, 4, -1);

        threaded4Pipeline = new AnnotationPipeline();
        threaded4Pipeline.addAnnotator(new TokenizerAnnotator(false, "en"));
        threaded4Pipeline.addAnnotator(new WordsToSentencesAnnotator(false));
View Full Code Here

      int numClassifiers = 0;
      AbstractSequenceClassifier classifier = null; //CRFClassifier.getClassifierNoExceptions(serializedClassifier);
      for(String classMod : classifierMods) { if(classMod != null) { numClassifiers++; } }
      switch (numClassifiers) {
          case 1:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0]);
        break;
          case 2:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1]);
        break;
          case 3:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2]);
        break;
          case 4:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3]);
        break;
          case 5:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4]);
        break;
          case 6:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4],
                 classifierMods[5]);
        break;
          case 7:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4],
                 classifierMods[5], classifierMods[6]);
        break;
          case 8:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4],
                 classifierMods[5], classifierMods[6], classifierMods[7]);
        break;
          case 9:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4],
                 classifierMods[5], classifierMods[6], classifierMods[7], classifierMods[8]);
        break;
          case 10:
        classifier = new NERClassifierCombiner(true, false, classifierMods[0], classifierMods[1], classifierMods[2], classifierMods[3], classifierMods[4],
                 classifierMods[5], classifierMods[6], classifierMods[7], classifierMods[8], classifierMods[9]);
        break;
          default:
        System.out.println(usageStr);
        System.exit(-1);
View Full Code Here

TOP

Related Classes of edu.stanford.nlp.ie.NERClassifierCombiner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.