From 34c2c129a376abfc79e76cf2fa1282b89ef605b6 Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Wed, 6 Jun 2012 01:10:49 -0400 Subject: Python - Added hypergraph functionnality - k-best translations - 1-best, k-best structures - sample derivations from the forest - intersect hypergraph and lattice - lattice --- python/src/kbest.pxd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 python/src/kbest.pxd (limited to 'python/src/kbest.pxd') diff --git a/python/src/kbest.pxd b/python/src/kbest.pxd new file mode 100644 index 00000000..e339714a --- /dev/null +++ b/python/src/kbest.pxd @@ -0,0 +1,16 @@ +from libcpp.vector cimport vector +from utils cimport WordID +cimport hypergraph + +cdef extern from "decoder/viterbi.h": + cdef cppclass ESentenceTraversal: + pass + cdef cppclass ETreeTraversal: + pass + +cdef extern from "decoder/kbest.h" namespace "KBest": + cdef cppclass KBestDerivations[T, Traversal]: + cppclass Derivation: + T _yield "yield" + KBestDerivations(hypergraph.Hypergraph hg, unsigned k) + Derivation* LazyKthBest(unsigned v, unsigned k) -- cgit v1.2.3