public int getNumTrainInst(String trainPRName, List<String> annotation_types, int fold_number) {
      NumDocsAndTrainInst entry = train_inst_stats.get(new PrNameAndFold(trainPRName, fold_number));

      if (entry == null) return -1;

      int ret = 0;
      MultiSet<String> insts = entry.instanceClassTypes;
      for (String ann_type : annotation_types) {
        ret += insts.get(ann_type);
      }
      return ret;
    }
Ejemplo n.º 2
0
 public void addMultiSet(MultiSet<T> ms) {
   for (Entry<T, Integer> e : ms.asMap().entrySet()) {
     add(e.getKey(), e.getValue());
   }
 }