Package ivory.ffg.data

Examples of ivory.ffg.data.DocumentVector.decompressPositions()


  public float[][] extract(int[] qterms, int[] docids, Feature[] features) throws Exception {
    float[][] fvalues = new float[docids.length][features.length];

    for(int d = 0; d < docids.length; d++) {
      DocumentVector compDoc = documents.get(docids[d]);
      int[][] positions = compDoc.decompressPositions(qterms);
      computeFeatures(qterms, positions, compDoc.getDocumentLength(), features, fvalues[d]);
    }
    return fvalues;
  }
View Full Code Here


      try {
        for(Feature f: features.keySet()) {
          f.initialize(new TfScoringFunction());

          for(int[] query: features.get(f).keySet()) {
            int[][] positions = dv.decompressPositions(query);
            float fValue = f.
              computeScoreWithMiniIndexes(positions, query, dv.getDocumentLength(), null);
            assertEquals(features.get(f).get(query), fValue, 1e-10);
          }
        }
View Full Code Here

  public float[][] extract(int[] qterms, int[] docids, Feature[] features) throws Exception {
    float[][] fvalues = new float[docids.length][features.length];

    for(int d = 0; d < docids.length; d++) {
      DocumentVector compDoc = documents.get(docids[d]);
      int[][] positions = compDoc.decompressPositions(qterms);
      computeFeatures(qterms, positions, compDoc.getDocumentLength(), features, fvalues[d]);
    }
    return fvalues;
  }
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.