summaryrefslogtreecommitdiff
path: root/extractor/features/target_given_source_coherent.cc
blob: 748413c3d63fcab6db41c7412a49cde659d77e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "target_given_source_coherent.h"

#include <cmath>

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

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