Package net.bpiwowar.mg4j.extensions.adhoc

Examples of net.bpiwowar.mg4j.extensions.adhoc.TRECJudgments


    return true;
  }

  @Override
  public void init() throws Exception {
    judgments = new TRECJudgments(qrelsFile);

  }
View Full Code Here


    return false;
  }

  @Override
  public void init() throws Exception {
    judgments = new TRECJudgments(qrelsFile);
    initialised = true;
  }
View Full Code Here

            throw new IllegalArgumentException("No topics were present in the XML description file");

        logger.info(String.format("Starting with model [%s] and %d topics", model, querySet.queries().size()));

        // Dicarded documents
    TRECJudgments discarded = discardedQRELFile == null ? null
        : new TRECJudgments(discardedQRELFile);



        // Queries
    Set<String> topicIds = GenericHelper.newHashSet();
    Map<String, ? extends Topic> topics = querySet.queries();
    for (String id : topics.keySet()) {
      logger.debug(new LazyString("Considering topic %s (%b/%b/%b)", id, topics.keySet()
          .contains(id), onlyTopics.isEmpty(), onlyTopics
          .contains(id)));
      if (topics.keySet().contains(id)
          && (onlyTopics.isEmpty() || onlyTopics.contains(id))) {
        topicIds.add(id);
      }
    }

    if (topicIds.isEmpty()) {
      logger.error("No topics to be answered");
      return 1;
    }

    // Iterates on topics
    timer.start();
    TaskTimer.Task task = timer.new Task("Answering topics", "topics",
        topicIds.size());
    PrintStream output = System.out;

    model.init(collection, index);
    int totalRetrieved = 0;
    for (String topicId : topicIds) {
      logger.info(String.format("Answering topic %s", topicId));

      Topic topic = topics.get(topicId);
      ObjectArrayList<DocumentScoreInfo<Reference2ObjectMap<Index, SelectedInterval[]>>> results = new ObjectArrayList<>();

      Set<String> discardedDocuments = null;
      if (discarded != null) {
        Map<String, Integer> map = discarded.get(topicId);
        if (map != null)
          discardedDocuments = map.keySet();

      }
View Full Code Here

TOP

Related Classes of net.bpiwowar.mg4j.extensions.adhoc.TRECJudgments

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.