Package cc.mallet.pipe.iterator

Examples of cc.mallet.pipe.iterator.CsvIterator


    InstanceList testInstances = new InstanceList (instances.getPipe());
       
    Reader insfileReader = new InputStreamReader(new FileInputStream(new File(inputFileName)), "UTF-8");
    Reader testfileReader = new InputStreamReader(new FileInputStream(new File(testFileName)), "UTF-8");
       
    instances.addThruPipe(new CsvIterator (insfileReader, Pattern.compile("^(\\S*)[\\s,]*(\\S*)[\\s,]*(.*)$"),
                             3, 2, 1)); // data, label, name fields
    testInstances.addThruPipe(new CsvIterator (testfileReader, Pattern.compile("^(\\S*)[\\s,]*(\\S*)[\\s,]*(.*)$"),
           3, 2, 1)); // data, label, name fields
   
    //setup HDP parameters(alpha, beta, gamma, initialTopics)
    HDP hdp = new HDP(1.0, 0.1, 1.0, 10);
    hdp.initialize(instances);
View Full Code Here

TOP

Related Classes of cc.mallet.pipe.iterator.CsvIterator

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.