Package org.fnlp.app.tc

Examples of org.fnlp.app.tc.TextClassifier.classify()


    tc.train(reader, modelFile);
    /**
     * 分类器使用
     */
    String str = "韦德:不拿冠军就是失败 詹皇:没拿也不意味失败";
    String label = (String) tc.classify(str).getLabel(0);
    System.out.println("类别:"+ label);
   
    System.out.println("读入模型");
    tc = null;
    tc = new TextClassifier(modelFile);
View Full Code Here


    System.out.println("类别:"+ label);
   
    System.out.println("读入模型");
    tc = null;
    tc = new TextClassifier(modelFile);
    label = (String) tc.classify(str).getLabel(0);
    System.out.println("预测类别:"+ label);
   
   
    //清除模型文件
    (new File(modelFile)).deleteOnExit();
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.