Examples of Accumulator


Examples of ivory.smrf.retrieval.Accumulator

        int size = sortedConcepts.size();
        if (size < curFbTerms || sortedConcepts.peek().score < score) {
          if (size == curFbTerms) {
            sortedConcepts.poll(); // Remove worst concept.
          }
          sortedConcepts.add(new Accumulator(conceptID, score));
        }
      }

      // Compute the weights of the expanded terms.
      int numTerms = Math.min(curFbTerms, sortedConcepts.size());
      float totalWt = 0.0f;
      Accumulator[] bestConcepts = new Accumulator[numTerms];
      for (int i = 0; i < numTerms; i++) {
        Accumulator a = sortedConcepts.poll();
        bestConcepts[i] = a;
        totalWt += a.score;
      }

      // Add cliques corresponding to best expansion concepts.
      for (int i = 0; i < numTerms; i++) {
        Accumulator a = bestConcepts[i];

        // Construct the MRF corresponding to this concept.
        String[] concepts = vocab[a.docno].getKey().split(" ");
        MarkovRandomField conceptMRF = curBuilder.buildMRF(concepts);
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

      int size = sortedConcepts.size();
      if (size < numFeedbackTerms || sortedConcepts.peek().score < score) {
        if (size == numFeedbackTerms) {
          sortedConcepts.poll(); // Remove worst concept.
        }
        sortedConcepts.add(new Accumulator(conceptID, score));
      }
    }

    // Compute the weights of the expanded terms.
    int numTerms = Math.min(numFeedbackTerms, sortedConcepts.size());
    float totalWt = 0.0f;
    Accumulator[] bestConcepts = new Accumulator[numTerms];
    for (int i = 0; i < numTerms; i++) {
      Accumulator a = sortedConcepts.poll();
      bestConcepts[i] = a;
      totalWt += a.score;
    }

    // Document node (shared across all expansion cliques).
    DocumentNode docNode = new DocumentNode();

    // Expression generator (shared across all expansion cliques).
    ExpressionGenerator generator = new TermExpressionGenerator();

    // Add cliques corresponding to best expansion concepts.
    for (int i = 0; i < numTerms; i++) {
      Accumulator a = bestConcepts[i];

      // Construct the MRF corresponding to this concept.
      String concept = vocab[a.docno].getKey();

      for (int j = 0; j < scoringFunctionNodes.size(); j++) {
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

          sumSq += score * score;
          i++;
          String originalDocID = lines[i];
          docnoMapping.put(new Integer(docid), originalDocID);
          i++;
          results[j] = new Accumulator(docid, score);
          j++;

        }
        int n = results.length;
        float muo = sum / n;
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

            min = score;
          i++;
          String originalDocID = lines[i];
          docnoMapping.put(new Integer(docid), originalDocID);
          i++;
          results[j] = new Accumulator(docid, score);
          j++;

        }
        float d = max - min;
        for (Accumulator a : results) {
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

          float score = Float.parseFloat(lines[i]);
          i++;
          String originalDocID = lines[i];
          docnoMapping.put(new Integer(docid), originalDocID);
          i++;
          results[j] = new Accumulator(docid, score);
          j++;
        }
        sLogger.info("returning original scores.");
        return results;
      }
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

        }
        continue;
      }
      String[] s = lines[i].split("\t");

      r.add(new Accumulator(Integer.parseInt(s[0]), Float.parseFloat(s[1])));
      docnoMapping.put(Integer.parseInt(s[0]), s[2]);
    }
    Accumulator[] results = new Accumulator[r.size()];
    for (int i = 0; i < r.size(); i++)
      results[i] = r.get(i);
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

        int size = sortedConcepts.size();
        if (size < curFbTerms || sortedConcepts.peek().score < score) {
          if (size == curFbTerms) {
            sortedConcepts.poll(); // Remove worst concept.
          }
          sortedConcepts.add(new Accumulator(conceptID, score));
        }
      }

      // Compute the weights of the expanded terms.
      int numTerms = Math.min(curFbTerms, sortedConcepts.size());
      float totalWt = 0.0f;
      Accumulator[] bestConcepts = new Accumulator[numTerms];
      for (int i = 0; i < numTerms; i++) {
        Accumulator a = sortedConcepts.poll();
        bestConcepts[i] = a;
        totalWt += a.score;
      }

      // Add cliques corresponding to best expansion concepts.
      for (int i = 0; i < numTerms; i++) {
        Accumulator a = bestConcepts[i];

        // Construct the MRF corresponding to this concept.
        String[] concepts = vocab[a.docno].getKey().split(" ");
        MarkovRandomField conceptMRF = curBuilder.buildMRF(concepts);
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

      int size = sortedConcepts.size();
      if (size < numFeedbackTerms || sortedConcepts.peek().score < score) {
        if (size == numFeedbackTerms) {
          sortedConcepts.poll(); // Remove worst concept.
        }
        sortedConcepts.add(new Accumulator(conceptID, score));
      }
    }

    // Compute the weights of the expanded terms.
    int numTerms = Math.min(numFeedbackTerms, sortedConcepts.size());
    float totalWt = 0.0f;
    Accumulator[] bestConcepts = new Accumulator[numTerms];
    for (int i = 0; i < numTerms; i++) {
      Accumulator a = sortedConcepts.poll();
      bestConcepts[i] = a;
      totalWt += a.score;
    }

    // Document node (shared across all expansion cliques).
    DocumentNode docNode = new DocumentNode();

    // Expression generator (shared across all expansion cliques).
    ExpressionGenerator generator = new TermExpressionGenerator();

    // Add cliques corresponding to best expansion concepts.
    for (int i = 0; i < numTerms; i++) {
      Accumulator a = bestConcepts[i];

      // Construct the MRF corresponding to this concept.
      String concept = vocab[a.docno].getKey();

      for (int j = 0; j < scoringFunctionNodes.size(); j++) {
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

          sumSq += score * score;
          i++;
          String originalDocID = lines[i];
          docnoMapping.put(new Integer(docid), originalDocID);
          i++;
          results[j] = new Accumulator(docid, score);
          j++;

        }
        int n = results.length;
        float muo = sum / n;
View Full Code Here

Examples of ivory.smrf.retrieval.Accumulator

            min = score;
          i++;
          String originalDocID = lines[i];
          docnoMapping.put(new Integer(docid), originalDocID);
          i++;
          results[j] = new Accumulator(docid, score);
          j++;

        }
        float d = max - min;
        for (Accumulator a : results) {
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.