Package org.terrier.querying.parser

Examples of org.terrier.querying.parser.SingleTermQuery


    logger.debug("Selecting "+numberOfTermsToReweight + " from " + expansionTerms.getNumberOfUniqueTerms());
   
    expansionTerms.setOriginalQueryTerms(query);
    SingleTermQuery[] expandedTerms = expansionTerms.getExpandedTerms(numberOfTermsToReweight);
    for (int i = 0; i < expandedTerms.length; i++){
      SingleTermQuery expandedTerm = expandedTerms[i];
      query.addTermPropertyWeight(expandedTerm.getTerm(), expandedTerm.getWeight());
      if(logger.isDebugEnabled()){
        logger.debug("term " + expandedTerms[i].getTerm()
           + " appears in expanded query with normalised weight: "
          + Rounding.toString(query.getTermWeight(expandedTerms[i].getTerm()), 4));
      }
View Full Code Here


      results = new SingleTermQuery[numberOfExpandedTerms];
      //logger.info("First weight = "+termEntries[0].getWeightExpansion() + " last weight="+termEntries[termEntries.length-1].getWeightExpansion());
      for (int i = 0; i < numberOfExpandedTerms; i++)
      {
        Map.Entry<String,LexiconEntry> lee = lexicon.getLexiconEntry(termEntries[i].getTermID());
        results[i] = new SingleTermQuery(lee.getKey());
        results[i].setWeight(termEntries[i].getWeightExpansion());
      }   
    } else { //numberOfExpandedTerms=0, Conservative"QE"
   
      results = new SingleTermQuery[originalTermids.size()];
      int i=0;
      for(int termId : originalTermids.keys())
      {
        results[i] = new SingleTermQuery(originalTermids.get(termId));
        results[i].setWeight(terms.get(termId).getWeightExpansion());
        //if (!QEModel.PARAMETER_FREE)
        //  results[i].setWeight(results[i].getWeight()*QEModel.ROCCHIO_BETA);
      }
    }
 
View Full Code Here

        r.obtainAllOf(SingleTermQuery.class, terms);
    }
    HashSet<String> rtr = new HashSet<String>(terms.size());
    for(Query g : terms)
    {
      SingleTermQuery queryTerm = (SingleTermQuery)g;
      rtr.add(queryTerm.getTerm());
      if(logger.isDebugEnabled()){
        logger.debug("-"+queryTerm.getTerm());
      }
    }
    return rtr;
  }
View Full Code Here

TOP

Related Classes of org.terrier.querying.parser.SingleTermQuery

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.