Examples of toFeatureVector()


Examples of cc.mallet.types.AugmentableFeatureVector.toFeatureVector()

    this(fieldAlph, valueAlph);
    for (int i = 0; i < vals.length; i++) {
      AugmentableFeatureVector afv = new AugmentableFeatureVector(valueAlph, false);
      for (int j = 1; j < vals[i].length; j++)
        afv.add(valueAlph.lookupIndex(vals[i][j]), 1.0);
      field2values.put(fieldAlph.lookupIndex(vals[i][0]), afv.toFeatureVector());
    }
  }
 
  public FeatureVector values (String field) {
    return values(fieldAlph.lookupIndex(field));
View Full Code Here

Examples of cc.mallet.types.FeatureCounter.toFeatureVector()

    }
   
    for(int ti = 0; ti < numTopics; ti++){
      pw.println("Topic\t" + ti);
      FeatureCounter counter = wordCountsPerTopic[ti];
      FeatureVector fv = counter.toFeatureVector();
      for(int pos = 0; pos < fv.numLocations(); pos++){
        int fi = fv.indexAtLocation(pos);
        String word = (String) alphabet.lookupObject(fi);
        int count = (int) fv.valueAtLocation(pos);
        double prob;
View Full Code Here

Examples of cc.mallet.types.Token.toFeatureVector()

    t.setFeatureValue ("length", 3);
    t.setFeatureValue ("containsVowel", 1);
    t.setFeatureValue ("in /usr/dict/words", 0);

    Alphabet dict = new Alphabet();
    FeatureVector fv = t.toFeatureVector (dict, false);
    assertTrue (fv.numLocations() == 2);
    assertTrue (fv.value (dict.lookupIndex("length")) == 3);
  }

  public void testTwo ()
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.