/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param documentLength The length of the document. * @return the score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ //double f = termFrequency / numberOfDocuments; return keyFrequency * tf * i.idfDFR(documentFrequency); } }
/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param documentLength The length of the document. * @return the score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ //double f = termFrequency / numberOfDocuments; return keyFrequency * tf * i.idfDFR(documentFrequency); } }
/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param keyFrequency The normalised query term frequency. * @param documentLength The length of the document. * @return the score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ return keyFrequency * tf * i.idfDFR(termFrequency); } }
/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param keyFrequency The normalised query term frequency. * @param documentLength The length of the document. * @return the score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ return keyFrequency * tf * i.idfDFR(termFrequency); } }
/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param documentLength The length of the document. * @return The score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ double f = termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return keyFrequency * tf * i.idfDFR(n_exp); } }
/** * Computes the score according to the weighting models In_expC2. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the * given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * Math.log(1d + c * averageDocumentLength / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); double f = termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return TF * i.idfDFR(n_exp) * keyFrequency * NORM; } }
/** * This method computes the score for the implemented weighting model. * @param tf The term frequency in the document * @param documentFrequency The document frequency of the term * @param termFrequency the term frequency in the collection * @param documentLength The length of the document. * @return The score returned by the implemented weighting model. */ public double score( double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength){ double f = termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return keyFrequency * tf * i.idfDFR(n_exp); } }
/** * Computes the score according to the weighting models In_expC2. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the * given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * Math.log(1d + c * averageDocumentLength / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); double f = termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return TF * i.idfDFR(n_exp) * keyFrequency * NORM; } }
/** * This method provides the contract for implementing weighting models. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given tf and * docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); double f = this.termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return TF * i.idfDFR(n_exp) * keyFrequency * NORM; } }
/** * Uses IFB2 to compute a weight for a term in a document. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given * tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); //double f = termFrequency / numberOfDocuments; return TF * keyFrequency * i.idfDFR(termFrequency) * NORM; } }
/** * Computes the score according to the model InL2. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the * given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = 1d / (TF + 1d); return TF * i.idfDFR(documentFrequency) * keyFrequency * NORM; } }
/** * This method provides the contract for implementing weighting models. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); //double f = this.termFrequency / numberOfDocuments; return TF * keyFrequency * i.idfDFR(documentFrequency) * NORM; } }
/** * This method provides the contract for implementing weighting models. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); //double f = this.termFrequency / numberOfDocuments; return TF * keyFrequency * i.idfDFR(documentFrequency) * NORM; } }
/** * Computes the score according to the model InL2. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the * given tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = 1d / (TF + 1d); return TF * i.idfDFR(documentFrequency) * keyFrequency * NORM; } }
/** * Uses IFB2 to compute a weight for a term in a document. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given * tf and docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); //double f = termFrequency / numberOfDocuments; return TF * keyFrequency * i.idfDFR(termFrequency) * NORM; } }
/** * This method provides the contract for implementing weighting models. * @param tf The term frequency in the document * @param docLength the document's length * @return the score assigned to a document with the given tf and * docLength, and other preset parameters */ public final double score(double tf, double docLength) { double TF = tf * WeightingModelLibrary.log(1.0d + (c * averageDocumentLength) / docLength); double NORM = (termFrequency + 1d) / (documentFrequency * (TF + 1d)); double f = this.termFrequency / numberOfDocuments; double n_exp = numberOfDocuments * (1 - Math.exp(-f)); return TF * i.idfDFR(n_exp) * keyFrequency * NORM; } }