summaryrefslogtreecommitdiff
path: root/python/src/mteval.pxd
diff options
context:
space:
mode:
Diffstat (limited to 'python/src/mteval.pxd')
-rw-r--r--python/src/mteval.pxd13
1 files changed, 10 insertions, 3 deletions
diff --git a/python/src/mteval.pxd b/python/src/mteval.pxd
index 52af6297..27c2808d 100644
--- a/python/src/mteval.pxd
+++ b/python/src/mteval.pxd
@@ -10,6 +10,7 @@ cdef extern from "mteval/ns.h":
unsigned size()
float operator[](unsigned i)
void swap(SufficientStats& other)
+ vector[float] fields
SufficientStats add "operator+" (SufficientStats&, SufficientStats&)
@@ -26,9 +27,15 @@ cdef extern from "mteval/ns.h":
vector[WordID]& refs,
SufficientStats* out)
-cdef extern from "mteval/ns.h" namespace "EvaluationMetric":
- EvaluationMetric* Instance(string& metric_id)
- EvaluationMetric* Instance() # IBM_BLEU
+ cdef EvaluationMetric* MetricInstance "EvaluationMetric::Instance" (string& metric_id)
+
+cdef extern from "py_scorer.h":
+ ctypedef float (*MetricScoreCallback)(void*, SufficientStats* stats)
+ ctypedef void (*MetricStatsCallback)(void*,
+ string* hyp, vector[string]* refs, SufficientStats* out)
+
+ cdef EvaluationMetric* PyMetricInstance "PythonEvaluationMetric::Instance"(
+ string& metric_id, void*, MetricStatsCallback, MetricScoreCallback)
cdef extern from "training/candidate_set.h" namespace "training":
cdef cppclass Candidate "const training::Candidate":