Package cc.mallet.pipe

Examples of cc.mallet.pipe.SerialPipes


  }


  public static  Pipe makeSpacePredictionPipe ()
  {
    Pipe p = new SerialPipes(new Pipe[]{
      new CharSequence2TokenSequence("."),
      new TokenSequenceLowercase(),
      new TestMEMMTokenSequenceRemoveSpaces(),
      new TokenText(),
      new OffsetConjunctions(true,
View Full Code Here


    doTestSpacePrediction(false, true, false);
  }

  public void disabledtestPrint ()
  {
    Pipe p = new SerialPipes (new Pipe[] {
       new CharSequence2TokenSequence("."),
       new TokenText(),
       new TestMEMM.TestMEMMTokenSequenceRemoveSpaces(),
       new TokenSequence2FeatureVectorSequence(),
       new PrintInputAndTarget(),
View Full Code Here

    Pipe p1 = new StupidPipe ();
    Pipe p2 = new SimpleTaggerSentence2TokenSequence ();
    // initialize p2's dict
    p2.instanceFrom(new Instance (data, null, null, null));

    Pipe serial = new SerialPipes (new Pipe[] { p1, p2 });
    try {
      serial.getDataAlphabet ();
      assertTrue ("Test failed: Should have generated exception.", false);
    } catch (IllegalStateException e) {}
  }
View Full Code Here

  {
    File trainFile = new File (args[0]);
    File testFile = new File (args[1]);
    File crfFile = new File (args[2]);

    Pipe pipe = new SerialPipes (new Pipe[] {
        new GenericAcrfData2TokenSequence (2),
        new TokenSequence2FeatureVectorSequence (true, true),
    });

    InstanceList training = new InstanceList (pipe);
View Full Code Here

    //pipeList.add(new TokenSequenceNGrams(new int[] {2} ));
       
    //convert to feature
    pipeList.add( new TokenSequence2FeatureSequence() );

    InstanceList instances = new InstanceList (new SerialPipes(pipeList));
    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");
       
View Full Code Here

    Pipe instancePipe;

    // Build a new pipe
    ArrayList<Pipe> pipeList = new ArrayList<Pipe>();
    pipeList.add(new SvmLight2FeatureVectorAndLabel());
    instancePipe = new SerialPipes(pipeList);

    InstanceList instances = new InstanceList(instancePipe);
    Reader fileReader;
    if (inputFile.equals("-")) {
      fileReader = new InputStreamReader(System.in);
View Full Code Here

        pipeList.add(new CharSequence2TokenSequence(tokenPattern));
        pipeList.add(new TokenSequenceRemoveStopwords(false, false)); // we should use a real stop word list
        pipeList.add(new TokenSequenceNGramsDelim(sizes, " "));
        pipeList.add(new TokenSequence2FeatureSequence());
        return new SerialPipes(pipeList);
    }
View Full Code Here

        //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

        //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.SerialPipes

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.