diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-08-01 17:32:37 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-08-01 17:32:37 +0200 |
commit | eb3ea4fd5dff1c94b237af792c9f7bf421d79d96 (patch) | |
tree | 2acd7674f36e6dc6e815c5856519fdea1a2d6bf8 /python/src/mteval.pxd | |
parent | e816274e337a066df1b1e86ef00136a021a17caf (diff) | |
parent | 193d137056c3c4f73d66f8db84691d63307de894 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python/src/mteval.pxd')
-rw-r--r-- | python/src/mteval.pxd | 19 |
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, |