Package org.fnlp.ml.types.alphabet

Examples of org.fnlp.ml.types.alphabet.StringFeatureAlphabet.lookupIndex()


        maxe[iii]=1;
      }
      float maxen = MyArrays.entropy(maxe);
      if (i==0||vars[i]>varsthresh&&entropy[i]<maxen*0.999) {
        String str = index.get(base);
        int id = newfeat.lookupIndex(str, interv);
        for (int j = 0; j < interv; j++) {
          ww.insert(id + j, weights[base + j]);
        }
      }else{
//                System.out.print("."); 
View Full Code Here


      Set<String> set = FingerPrint.featureset(docs.get(i).content,type);
      features[i] = new TIntHashSet(set.size());
      Iterator<String> it = set.iterator();
      while(it.hasNext()){
        String str = it.next();       
        int idx = fa.lookupIndex(str);
        features[i].add(idx);
      }     
    }
    group();
  }
View Full Code Here

          itt.advance();
          float v = itt.value();
          if(Math.abs(v)<1e-3f)
            continue;
          String fea = index.get(itt.key());
          int newidx = newfeat.lookupIndex(fea);
          ww.put(newidx, v);       
      }
      weights[i] = ww; 
    }
   
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.