Package cc.mallet.pipe.tsf

Examples of cc.mallet.pipe.tsf.SequencePrintingPipe.instanceFrom()


    StringWriter sw = new StringWriter ();
    PrintWriter w = new PrintWriter (sw);
    Pipe p = new SequencePrintingPipe (w);

    // pipe the instance
    p.instanceFrom(new Instance (fvs, lbls, null, null));

    // Do a second one
    FeatureVectorSequence fvs2 = new FeatureVectorSequence (new FeatureVector[] {
      new FeatureVector (dict, new int[] { 1 }),
      new FeatureVector (dict, new int[] { 0 }),
View Full Code Here


    FeatureVectorSequence fvs2 = new FeatureVectorSequence (new FeatureVector[] {
      new FeatureVector (dict, new int[] { 1 }),
      new FeatureVector (dict, new int[] { 0 }),
    });
    LabelSequence lbls2 = new LabelSequence (ld, new int[] { 2, 1 });
    p.instanceFrom(new Instance (fvs2, lbls2, null, null));

    w.close();

    assertEquals ("LABEL0 feature0 feature1\n" +
            "LABEL2 feature0 feature2\n" +
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.