code: public double calculateScore(int first, int second) {
          //Score is -log P(out|in)
          double prob = calculateProb(first, second);
          return -FastMath.log(prob);
      }
docs: Calculate score. -log P(v_second | v_first)