Package org.terrier.evaluation

Examples of org.terrier.evaluation.Evaluation


        //logger.info("number of tokens: " +  i.getCollectionStatistics().getNumberOfTokens());
        //logger.info("number of pointers: " +  i.getCollectionStatistics().getNumberOfPointers());
      }
      i.close();
    } else if (evaluation) {
      Evaluation te = null;
      if (evaluation_type.equals("adhoc"))
        te = new AdhocEvaluation();
      else if (evaluation_type.equals("named"))
        te = new NamedPageEvaluation();
      String[] nomefile = null;
      if (evaluationFilename == null)
      {
        /* list all the result files and then evaluate them */
        File fresdirectory = new File(ApplicationSetup.TREC_RESULTS);
        nomefile = fresdirectory.list();
      }
      else
      {
        nomefile =new String[]{evaluationFilename};
      }
      for (int i = 0; i < nomefile.length; i++) {
        if (nomefile[i].endsWith(".res")) {
          String resultFilename = ApplicationSetup.TREC_RESULTS+ "/" + nomefile[i];
          if (nomefile[i].indexOf("/") >= 0)
            resultFilename = nomefile[i];
          String evaluationResultFilename =
            resultFilename.substring(
              0,
              resultFilename.lastIndexOf('.'))
              + ".eval";
          te.evaluate(resultFilename);
          if (evaluation_per_query)
            te.writeEvaluationResultOfEachQuery(evaluationResultFilename);
          else
            te.writeEvaluationResult(evaluationResultFilename);
        }
      }
    }
   
    long endTime = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of org.terrier.evaluation.Evaluation

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.