Examples of POSModel


Examples of opennlp.tools.postag.POSModel

    return model;
  }

  @Override
  protected POSModel loadModel(InputStream in) throws IOException {
    return new POSModel(in);
  }
View Full Code Here

Examples of opennlp.tools.postag.POSModel

  private static class POSModelSerializer implements ArtifactSerializer<POSModel> {

    public POSModel create(InputStream in) throws IOException,
        InvalidFormatException {
      return new POSModel(new UncloseableInputStream(in));
    }
View Full Code Here

Examples of opennlp.tools.postag.POSModel

    Dictionary mdict = buildDictionary(parseSamples, rules, mlParams);
   
    parseSamples.reset();
   
    // tag
    POSModel posModel = POSTaggerME.train(languageCode, new PosSampleStream(
        parseSamples), mlParams.getParameters("tagger"), null, null);
   
    parseSamples.reset();
   
    // chunk
View Full Code Here

Examples of opennlp.tools.postag.POSModel

    mergeReportIntoManifest(manifestInfoEntries, buildReportMap, "build");
   
    parseSamples.reset();
   
    // tag
    POSModel posModel = POSTaggerME.train(languageCode, new PosSampleStream(parseSamples),
        mlParams.getParameters("tagger"), null, null);
   
    parseSamples.reset();
   
    // chunk
View Full Code Here

Examples of opennlp.tools.postag.POSModel

  public void collectionProcessComplete(ProcessTrace trace)
      throws ResourceProcessException, IOException {
   
    GIS.PRINT_MESSAGES = false;

    POSModel posTaggerModel = POSTaggerME.train(language,
        ObjectStreamUtils.createObjectStream(mPOSSamples),
        ModelType.MAXENT, tagDictionary, null, 100, 5);
   
    // dereference to allow garbage collection
    mPOSSamples = null;
View Full Code Here

Examples of opennlp.tools.postag.POSModel

    if (this.logger.isLoggable(Level.INFO)) {
      this.logger.log(Level.INFO, "Initializing the OpenNLP "
          + "Part of Speech annotator.");
    }

    POSModel model;

    try {
      POSModelResource modelResource = (POSModelResource) context
          .getResourceObject(UimaUtil.MODEL_PARAMETER);
View Full Code Here

Examples of opennlp.tools.postag.POSModel

   
    File parserModelInFile = new File(args[0]);
    ParserModel parserModel = new ParserModelLoader().load(parserModelInFile);
   
    File taggerModelInFile = new File(args[1]);
    POSModel taggerModel = new POSModelLoader().load(taggerModelInFile);
   
    ParserModel updatedParserModel = parserModel.updateTaggerModel(taggerModel);
   
    CmdLineUtil.writeModel("parser", parserModelInFile, updatedParserModel);
  }
View Full Code Here

Examples of opennlp.tools.postag.POSModel

    if (args.length != 1) {
      System.out.println(getHelp());
      throw new TerminateToolException(1);
    }
   
    POSModel model = new POSModelLoader().load(new File(args[0]));
   
    POSTaggerME tagger = new POSTaggerME(model);
   
    ObjectStream<String> lineStream =
      new PlainTextByLineStream(new InputStreamReader(System.in));
View Full Code Here

Examples of opennlp.tools.postag.POSModel

    File testData = params.getData();
    CmdLineUtil.checkInputFile("Test data", testData);

    Charset encoding = params.getEncoding();

    POSModel model = new POSModelLoader().load(params.getModel());
   
    POSTaggerEvaluationMonitor missclassifiedListener = null;
    if (params.getMisclassified()) {
      missclassifiedListener = new POSEvaluationErrorListener();
    }
View Full Code Here

Examples of opennlp.tools.postag.POSModel

        throw new TerminateToolException(-1);
      }
      System.err.println("done");
    }
   
    POSModel model;
    try {
     
      // TODO: Move to util method ...
      POSDictionary tagdict = null;
      if (params.getDict() != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.