From ca9b58716214148eeaeaa3076e1a1dc8f8bb5892 Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Mon, 26 Aug 2013 20:12:32 -0400 Subject: Improve the package structure of pycdec This change should not break anything, but now you can run: python setup.py build_ext --inplace and use the cleaner: PYTHONPATH=/path/to/cdec/python python -m ... --- python/src/mteval.pxd | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 python/src/mteval.pxd (limited to 'python/src/mteval.pxd') diff --git a/python/src/mteval.pxd b/python/src/mteval.pxd deleted file mode 100644 index 33a6b7a5..00000000 --- a/python/src/mteval.pxd +++ /dev/null @@ -1,56 +0,0 @@ -from libcpp.vector cimport vector -from libcpp.string cimport string -from utils cimport * -from hypergraph cimport Hypergraph - -cdef extern from "mteval/ns.h": - cdef cppclass SufficientStats: - SufficientStats() - SufficientStats(SufficientStats&) - unsigned size() - float operator[](unsigned i) - void swap(SufficientStats& other) - vector[float] fields - - SufficientStats add "operator+" (SufficientStats&, SufficientStats&) - - cdef cppclass SegmentEvaluator: - void Evaluate(vector[WordID]& hyp, SufficientStats* out) - - cdef cppclass EvaluationMetric: - string& MetricId() - bint IsErrorMetric() - float ComputeScore(SufficientStats& stats) - string DetailedScore(SufficientStats& stats) - shared_ptr[SegmentEvaluator] CreateSegmentEvaluator(vector[vector[WordID]]& refs) - ComputeSufficientStatistics(vector[WordID]& hyp, - vector[WordID]& refs, - SufficientStats* out) - - 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/utils/candidate_set.h" namespace "training": - 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() - const_Candidate& operator[](unsigned i) - void ReadFromFile(string& file) - void WriteToFile(string& file) - void AddKBestCandidates(Hypergraph& hg, - unsigned kbest_size, - SegmentEvaluator* scorer) -- cgit v1.2.3