Package cc.mallet.pipe

Examples of cc.mallet.pipe.PrintInputAndTarget


  public void testPrint() {
    Pipe p = new SerialPipes(new Pipe[] {
        new CharSequence2TokenSequence("."), new TokenText(),
        new TestCRFTokenSequenceRemoveSpaces(),
        new TokenSequence2FeatureVectorSequence(),
        new PrintInputAndTarget(), });
    InstanceList one = new InstanceList(p);
    String[] data = new String[] { "ABCDE", };
    one.addThruPipe(new ArrayIterator(data));
    CRF crf = new CRF(p, null);
    crf.addFullyConnectedStatesForThreeQuarterLabels(one);
View Full Code Here


  public void testCopyStatesAndWeights() {
    Pipe p = new SerialPipes(new Pipe[] {
        new CharSequence2TokenSequence("."), new TokenText(),
        new TestCRFTokenSequenceRemoveSpaces(),
        new TokenSequence2FeatureVectorSequence(),
        new PrintInputAndTarget(), });
    InstanceList one = new InstanceList(p);
    String[] data = new String[] { "ABCDE", };
    one.addThruPipe(new ArrayIterator(data));
    CRF crf = new CRF(p, null);
    crf.addFullyConnectedStatesForLabels();
View Full Code Here

        new LineGroupString2TokenSequence(),
        new TokenSequenceMatchDataAndTarget(Pattern
            .compile("^(\\S+) (.*)"), 2, 1),
        new TokenSequenceParseFeatureString(false), new TokenText(),
        new TokenSequence2FeatureVectorSequence(true, false),
        new Target2LabelSequence(), new PrintInputAndTarget(), });

    InstanceList data = new InstanceList(p);
    data.addThruPipe(new LineGroupIterator(new StringReader(toy), Pattern
        .compile("\n"), true));

View Full Code Here

            new RegexMatches ("ampm", Pattern.compile ("[aApP][mM]")),
            new OffsetFeatureConjunction ("time",
                    new String[] { "digits", "ampm" },
                    new int[] { 0, 1 },
                    true),
            new PrintInputAndTarget (),
    });
    Pipe noMtPipe = new SerialPipes (new Pipe[] {
            new SimpleTaggerSentence2TokenSequence (),
            new TokenText (),
            new RegexMatches ("digits", Pattern.compile ("[0-9]+")),
            new RegexMatches ("ampm", Pattern.compile ("[aApP][mM]")),
            new OffsetFeatureConjunction ("time",
                    new String[] { "digits", "ampm" },
                    new int[] { 0, 1 },
                    false),
            new PrintInputAndTarget (),
    });

    InstanceList mtLst = new InstanceList (mtPipe);
    InstanceList noMtLst = new InstanceList (noMtPipe);
View Full Code Here

            new RegexMatches ("ampm", Pattern.compile ("[aApP][mM]")),
            new OffsetFeatureConjunction ("time",
                    new String[] { "digits", "ampm" },
                    new int[] { 0, 1 },
                    true),
            new PrintInputAndTarget (),
    });

    Pipe mtPipe = (Pipe) TestSerializable.cloneViaSerialization (origPipe);
    InstanceList mtLst = new InstanceList (mtPipe);
    mtLst.addThruPipe (new ArrayIterator (doc1));
View Full Code Here

    Pipe p = new SerialPipes (new Pipe[] {
       new CharSequence2TokenSequence("."),
       new TokenText(),
       new TestMEMM.TestMEMMTokenSequenceRemoveSpaces(),
       new TokenSequence2FeatureVectorSequence(),
       new PrintInputAndTarget(),
    });
    InstanceList one = new InstanceList (p);
    String[] data = new String[] { "ABCDE", };
    one.addThruPipe (new ArrayIterator (data));
    MEMM crf = new MEMM (p, null);
View Full Code Here

        //  mapping feature IDs to counts.
        //pipeList.add(new FeatureSequence2FeatureVector());
        //NOTE: Commented out because LDA wanted a FeatureSequence

        // Print out the features and the label
        pipeList.add(new PrintInputAndTarget());

        return new SerialPipes(pipeList);
    }                  
View Full Code Here

        //  mapping feature IDs to counts.
        //pipeList.add(new FeatureSequence2FeatureVector());
        //NOTE: Commented out because LDA wanted a FeatureSequence

        // Print out the features and the label
        pipeList.add(new PrintInputAndTarget());

        return new SerialPipes(pipeList);
    }                  
View Full Code Here

TOP

Related Classes of cc.mallet.pipe.PrintInputAndTarget

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.