summaryrefslogtreecommitdiff
path: root/python/src/mteval.pxd
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
commit3f8e33cfe481a09c121a410e66a6074b5d05683e (patch)
treea41ecaf0bbb69fa91a581623abe89d41219c04f8 /python/src/mteval.pxd
parentc139ce495861bb341e1b86a85ad4559f9ad53c14 (diff)
parent9fe0219562e5db25171cce8776381600ff9a5649 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python/src/mteval.pxd')
-rw-r--r--python/src/mteval.pxd19
1 files changed, 14 insertions, 5 deletions
diff --git a/python/src/mteval.pxd b/python/src/mteval.pxd
index 52af6297..c97c4b34 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,20 +27,28 @@ 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":
+ cdef cppclass Candidate:
vector[WordID] ewords
FastSparseVector[weight_t] fmap
SufficientStats eval_feats
+ ctypedef Candidate const_Candidate "const training::Candidate"
+
cdef cppclass CandidateSet:
CandidateSet()
unsigned size()
- Candidate& operator[](unsigned i)
+ const_Candidate& operator[](unsigned i)
void ReadFromFile(string& file)
void WriteToFile(string& file)
void AddKBestCandidates(Hypergraph& hg,