/** * Returns the weight of a term with the given * term identifier, computed by the specified * query expansion model. * @param termId int the term identifier to set the weight for. * @param model QueryExpansionModel the used query expansion model. * @return double the weight of the specified term. */ public double getExpansionWeight(int termId, QueryExpansionModel model){ double score = 0; ExpansionTerm o = terms.get(termId); if (o != null) { double TF = 0; //double Nt = 0; Map.Entry<String, LexiconEntry> lee = lexicon.getLexiconEntry(termId); TF = lee.getValue().getFrequency(); //Nt = lee.getValue().getDocumentFrequency(); score = model.score(o.getWithinDocumentFrequency(), TF, this.totalDocumentLength, this.numberOfTokens, this.averageDocumentLength ); } return score; }
allTerms[i].getWithinDocumentFrequency(), TF QEModel.setMaxTermFrequency(allTerms[posMaxWeight].getWithinDocumentFrequency()); normaliser = QEModel.parameterFreeNormaliser(); if(logger.isDebugEnabled()){
/** * Returns the weight of a term with the given * term identifier, computed by the specified * query expansion model. * @param termId int the term identifier to set the weight for. * @param model QueryExpansionModel the used query expansion model. * @return double the weight of the specified term. */ public double getExpansionWeight(int termId, QueryExpansionModel model){ double score = 0; ExpansionTerm o = terms.get(termId); if (o != null) { double TF = 0; //double Nt = 0; Map.Entry<String, LexiconEntry> lee = lexicon.getLexiconEntry(termId); TF = lee.getValue().getFrequency(); //Nt = lee.getValue().getDocumentFrequency(); score = model.score(o.getWithinDocumentFrequency(), TF, this.totalDocumentLength, this.numberOfTokens, this.averageDocumentLength ); } return score; }
allTerms[i].getWithinDocumentFrequency(), TF QEModel.setMaxTermFrequency(allTerms[posMaxWeight].getWithinDocumentFrequency()); normaliser = QEModel.parameterFreeNormaliser(); if(logger.isDebugEnabled()){
/** * Returns the frequency of a given term in the top-ranked documents. * @param termId int the id of the term to get the frequency for. * @return double the frequency of the specified term in the top-ranked documents. */ public double getFrequency(int termId){ ExpansionTerm o = terms.get(termId); if (o == null) return 0; return o.getWithinDocumentFrequency(); }
/** * Returns the frequency of a given term in the top-ranked documents. * @param termId int the id of the term to get the frequency for. * @return double the frequency of the specified term in the top-ranked documents. */ public double getFrequency(int termId){ ExpansionTerm o = terms.get(termId); if (o == null) return 0; return o.getWithinDocumentFrequency(); }