Examples of PairOfFloatInt


Examples of edu.umd.cloud9.io.pair.PairOfFloatInt

        if (cs >= threshold) {
          LOG.debug(sampleDocno + "," + fromSample + "\n" + fromSample.length());
          LOG.debug(docno + "," + docvector + "\n" + docvector.length());
          LOG.debug(cs);
          reporter.incrCounter(Pairs.Emitted, 1);
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(cs, docno.get()));
        }
      }
    }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatInt

        reporter.incrCounter(Pairs.Total, 1);
        IntWritable sampleDocno = signatures.get(i).getLeftElement();
        Signature fromSample = signatures.get(i).getRightElement();
        int dist = signature.hammingDistance(fromSample, maxDist);
        if (dist <= maxDist) {
          output.collect(new IntWritable(sampleDocno.get()), new PairOfFloatInt(-dist, docno.get()));
          reporter.incrCounter(Pairs.Emitted, 1);
        }
      }
    }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatInt

    public void reduce(IntWritable key, Iterator<PairOfFloatInt> values,
        OutputCollector<PairOfInts, Text> output, Reporter reporter) throws IOException {
      list.clear();
      while (values.hasNext()) {
        PairOfFloatInt p = values.next();
        if (!list.add(new PairOfFloatInt(p.getLeftElement(), p.getRightElement()))) {
          LOG.debug("Not added: " + p);
        } else {
          LOG.debug("Added: " + p);
        }
        reporter.incrCounter(Pairs.Total, 1);
      }
      LOG.debug(list.size());
      int cntr = 0;
      while (!list.isEmpty() && cntr < numResults) {
        PairOfFloatInt pair = list.pollLast();
        LOG.debug("output " + cntr + "=" + pair);

        keyOut.set(pair.getRightElement(), key.get()); // first english docno, then foreign language
        // docno
        valOut.set(nf.format(pair.getLeftElement()));
        output.collect(keyOut, valOut);
        cntr++;
      }
    }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatInt

      return null;
    }
    PriorityQueue<PairOfFloatInt> eS = f2eProbs.get(f).getTranslationsWithProbs(lexProbThreshold);

    if (!eS.isEmpty()) {
      PairOfFloatInt entry = eS.poll();
      int e = entry.getRightElement();
      String eTerm = eVocab_f2e.get(e);
      return eTerm;
    }
    return token;
  }
View Full Code Here

Examples of edu.umd.cloud9.io.pair.PairOfFloatInt

    float sumProbEF = 0;
    int numTrans = 0;
    //tf(e) = sum_f{tf(f)*prob(e|f)}
    while (numTrans < numTransPerToken && !eS.isEmpty()) {
      PairOfFloatInt entry = eS.poll();
      float probEF = entry.getLeftElement();
      int e = entry.getRightElement();
      String eTerm = eVocab_f2e.get(e);

      //      LOG.info("Pr("+eTerm+"|"+token+")="+probEF);

      if (probEF > 0 && e > 0 && !docLangTokenizer.isStopWord(eTerm) && (translateOnly == null || !translateOnly.equals("indri") || indriPuncPattern.matcher(eTerm).matches()) && (pairsInSCFG == null || pairsInSCFG.contains(new PairOfStrings(token,eTerm)))) {     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.