summaryrefslogtreecommitdiff
path: root/extractor/features/target_given_source_coherent.cc
blob: c4551d883eaff59144e135eaf8cf5650ef86826c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "target_given_source_coherent.h"

#include <cmath>

namespace extractor {
namespace features {

double TargetGivenSourceCoherent::Score(const FeatureContext& context) const {
  double prob = (double) context.pair_count / context.num_samples;
  return prob > 0 ? -log10(prob) : MAX_SCORE;
}

string TargetGivenSourceCoherent::GetName() const {
  return "EgivenFCoherent";
}

} // namespace features
} // namespace extractor