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
commiteb3ea4fd5dff1c94b237af792c9f7bf421d79d96 (patch)
tree2acd7674f36e6dc6e815c5856519fdea1a2d6bf8 /python/src/mteval.pxd
parente816274e337a066df1b1e86ef00136a021a17caf (diff)
parent193d137056c3c4f73d66f8db84691d63307de894 (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,