Package org.terrier.matching.models.normalisation

Examples of org.terrier.matching.models.normalisation.Normalisation


    try
    {     
      for(int fi=0;fi<fieldCount;fi++)
      {
        fieldWeights[fi] = Double.parseDouble(ApplicationSetup.getProperty("w."+ fi, ""+1.0));
        Normalisation nf = this.fieldNormalisations[fi] = normClass.newInstance();
        final double param = Double.parseDouble(ApplicationSetup.getProperty("c."+ fi, ""+1.0));
        nf.setParameter(param);
        nf.setNumberOfDocuments(_cs.getNumberOfDocuments());
        final long tokensf = _cs.getFieldTokens()[fi];
        nf.setNumberOfTokens(tokensf);
        nf.setAverageDocumentLength(_cs.getAverageFieldLengths()[fi]);       
     
    } catch (Exception e) {
      throw new IllegalStateException(e);     
    }
  }
View Full Code Here


    this.fieldNormalisations = new Normalisation[fieldCount];
    try{
      for(int fi=0;fi<fieldCount;fi++)
      {
        fieldWeights[fi] = Double.parseDouble(ApplicationSetup.getProperty("w."+ fi, ""+1.0));
        final Normalisation nf = normClass.newInstance();
        this.fieldNormalisations[fi] = nf;
        final double param = Double.parseDouble(ApplicationSetup.getProperty("c."+ fi, ""+1.0));
        nf.setParameter(param);
        nf.setNumberOfDocuments(_cs.getNumberOfDocuments());
        final long tokensf = _cs.getFieldTokens()[fi];
        nf.setNumberOfTokens(tokensf);
        nf.setAverageDocumentLength(_cs.getAverageFieldLengths()[fi]);
        p[fi] = 1.0d / ((double)fieldCount * super.numberOfDocuments);
        p[fi] = p[fi] / Double.parseDouble( ApplicationSetup.getProperty("p." + fi, "1.0d"));
      }
   
    } catch (Exception e) {
View Full Code Here

    p = new double[fieldCount];
    this.fieldNormalisations = new Normalisation[fieldCount];
    try{   
      for(int fi=0;fi<fieldCount;fi++)
      {
        final Normalisation nf = this.fieldNormalisations[fi] = normClass.newInstance();
        final double param = Double.parseDouble(ApplicationSetup.getProperty("c."+ fi, ""+1.0));
        nf.setParameter(param);
        nf.setNumberOfDocuments(_cs.getNumberOfDocuments());
        final long tokensf = _cs.getFieldTokens()[fi];
        nf.setNumberOfTokens(tokensf);
        nf.setAverageDocumentLength(_cs.getAverageFieldLengths()[fi])
        p[fi] = 1.0d / ((double)fieldCount * super.numberOfDocuments);
        p[fi] = p[fi] / (fieldWeights[fi] = Double.parseDouble( ApplicationSetup.getProperty("p." + fi, "1.0d")));
      }
   
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.terrier.matching.models.normalisation.Normalisation

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.