Package ivory.cascade.model

Examples of ivory.cascade.model.CascadeClique


        cliqueNodes.add(termNode);

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);

        cliques.add(c);
      }

      // Update last term node.
View Full Code Here


        }

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);
        cliques.add(c);
      } else if (!ordered && !singleTerm && !contiguous) {
        cliqueNodes = Lists.newArrayList();
        if (docDependent) {
          cliqueNodes.add(docNode);
        }
        for (int j = 0; j < binary.length(); j++) {
          if (binary.charAt(j) == '1') {
            TermNode termNode = new TermNode(queryTerms[j]);
            cliqueNodes.add(termNode);
          }
        }

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);
        cliques.add(c);
      }
    }

    return cliques;
View Full Code Here

    }

    int totalCnt = mMRF.getCliques().size();
    Map<Integer, Set<CascadeClique>> cascadeStages = Maps.newHashMap();
    for (Clique c : mMRF.getCliques()) {
      CascadeClique cc = (CascadeClique) c;
      int stage = cc.getCascadeStage();
      if ( cascadeStages.containsKey(stage)) {
        cascadeStages.get(stage).add(cc);
      } else {
        cascadeStages.put(stage, Sets.newHashSet(cc));
      }
View Full Code Here

      int[][] termPositions = new int[cliques.size()][];
      int doclen = -1;

      for (int i = 0; i < cliques.size(); i++) {
        // Current clique that we're scoring.
        CascadeClique c = (CascadeClique) cliques.get(i);

        if (firstTime) {
          termToCliqueNumber.put(c.getConcept().trim().toLowerCase(), i);
          cf.put(c.getConcept().trim().toLowerCase(), c.termCollectionCF());
          df.put(c.getConcept().trim().toLowerCase(), c.termCollectionDF());
        }

        if (score + docMaxScore <= scoreThreshold) {
          // Advance postings readers (but don't score).
          for (int j = i; j < cliques.size(); j++) {
            cliques.get(j).setNextCandidate(docno + 1);
          }
          skipped = true;

          break;
        }

        // Document independent cliques do not affect the ranking.
        if (!c.isDocDependent()) {
          continue;
        }

        // Update document score.
        float cliqueScore = c.getPotential();
        score += c.getWeight() * cliqueScore;

        // Update the max score for the rest of the cliques.
        docMaxScore -= c.getMaxScore();

        // stuff needed for document evaluation in the next stage
        int[] p = c.getPositions();

        if (p != null) {
          termPositions[i] = Arrays.copyOf(p, p.length);
          doclen = c.getDocLen();
        }
      }

      firstTime = false;

View Full Code Here

      cliqueNodes.add(termNode);

      // Get the potential function.
      PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

      Clique c = new CascadeClique(cliqueNodes, potential, termParameter, cascadeStage, pruner_and_params);
      addClique(c);
    }
  }
View Full Code Here

        cliqueNodes.add(termNode);

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);

        cliques.add(c);
      }

      // Update last term node.
View Full Code Here

        }

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);
        cliques.add(c);
      } else if (!ordered && !singleTerm && !contiguous) {
        cliqueNodes = Lists.newArrayList();
        if (docDependent) {
          cliqueNodes.add(docNode);
        }
        for (int j = 0; j < binary.length(); j++) {
          if (binary.charAt(j) == '1') {
            TermNode termNode = new TermNode(queryTerms[j]);
            cliqueNodes.add(termNode);
          }
        }

        // Get the potential function.
        PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

        c = new CascadeClique(cliqueNodes, potential, parameter, cascadeStage, pruner_and_params);
        cliques.add(c);
      }
    }

    return cliques;
View Full Code Here

      cliqueNodes.add(termNode);

      // Get the potential function.
      PotentialFunction potential = PotentialFunction.create(env, potentialType, domNode);

      Clique c = new CascadeClique(cliqueNodes, potential, termParameter, cascadeStage, pruner_and_params);
      addClique(c);
    }
  }
View Full Code Here

    }

    int totalCnt = mMRF.getCliques().size();
    Map<Integer, Set<CascadeClique>> cascadeStages = Maps.newHashMap();
    for (Clique c : mMRF.getCliques()) {
      CascadeClique cc = (CascadeClique) c;
      int stage = cc.getCascadeStage();
      if ( cascadeStages.containsKey(stage)) {
        cascadeStages.get(stage).add(cc);
      } else {
        cascadeStages.put(stage, Sets.newHashSet(cc));
      }
View Full Code Here

      int[][] termPositions = new int[cliques.size()][];
      int doclen = -1;

      for (int i = 0; i < cliques.size(); i++) {
        // Current clique that we're scoring.
        CascadeClique c = (CascadeClique) cliques.get(i);

        if (firstTime) {
          termToCliqueNumber.put(c.getConcept().trim().toLowerCase(), i);
          cf.put(c.getConcept().trim().toLowerCase(), c.termCollectionCF());
          df.put(c.getConcept().trim().toLowerCase(), c.termCollectionDF());
        }

        if (score + docMaxScore <= scoreThreshold) {
          // Advance postings readers (but don't score).
          for (int j = i; j < cliques.size(); j++) {
            cliques.get(j).setNextCandidate(docno + 1);
          }
          skipped = true;

          break;
        }

        // Document independent cliques do not affect the ranking.
        if (!c.isDocDependent()) {
          continue;
        }

        // Update document score.
        float cliqueScore = c.getPotential();
        score += c.getWeight() * cliqueScore;

        // Update the max score for the rest of the cliques.
        docMaxScore -= c.getMaxScore();

        // stuff needed for document evaluation in the next stage
        int[] p = c.getPositions();

        if (p != null) {
          termPositions[i] = Arrays.copyOf(p, p.length);
          doclen = c.getDocLen();
        }
      }

      firstTime = false;

View Full Code Here

TOP

Related Classes of ivory.cascade.model.CascadeClique

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.