Package opennlp.tools.doccat

Examples of opennlp.tools.doccat.DocumentCategorizer


      = new BagOfWordsFeatureGenerator();

    InputStream modelStream = //<co id="tmx.modelreader"/>
        new FileInputStream(modelFile);
    DoccatModel model = new DoccatModel(modelStream);
    DocumentCategorizer categorizer //<co id="tmx.categorizer"/>
      = new DocumentCategorizerME(model, nffg, bowfg);
    Tokenizer tokenizer = SimpleTokenizer.INSTANCE;
  
    int catCount = categorizer.getNumberOfCategories();
    Collection<String> categories
      = new ArrayList<String>(catCount);
    for (int i=0; i < catCount; i++) {
      categories.add(categorizer.getCategory(i));
    }
    ResultAnalyzer resultAnalyzer = //<co id="tmx.results"/>
        new ResultAnalyzer(categories, "unknown");
    runTest(inputFiles, categorizer, tokenizer, resultAnalyzer); //<co id="tmx.run"/>
    /*<calloutlist>
 
View Full Code Here

TOP

Related Classes of opennlp.tools.doccat.DocumentCategorizer

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.