Package com.digitalpebble.classification

Examples of com.digitalpebble.classification.TextClassifier.createDocument()


        // load classifier
        TextClassifier classifier = TextClassifier
            .getClassifier(new File(resourceDir));
        // create a document from a String
        String[] tokens = Tokenizer.tokenize(text.toString(), true);
        Document doc = classifier.createDocument(tokens);
        // classify
        double[] scores = classifier.classify(doc);
        // get best label
        String label = classifier.getBestLabel(scores);
        System.out.println("Classified as : "+label);
View Full Code Here


        // load classifier
        TextClassifier classifier = TextClassifier
            .getClassifier(new File(resourceDir));
        // create a document from a String
        String[] tokens = Tokenizer.tokenize(text.toString(), true);
        Document doc = classifier.createDocument(tokens);
        // classify
        double[] scores = classifier.classify(doc);
        // get best label
        String label = classifier.getBestLabel(scores);
        System.out.println("Classified as : " + label);
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.