redpony / cdec

Decoder, aligner, and model optimizer for statistical machine translation and other structured prediction models based on (mostly) context-free formalisms
http://cdec-decoder.org/
Apache License 2.0
183 stars 77 forks source link

PyCdec lattice edge weights/features broken #67

Open armatthews opened 9 years ago

armatthews commented 9 years ago

We updated cdec to allow a sparse vector of features rather than a single cost on each edge. PyCdec relies on storing edges in tuples, and while a double was fine in a tuple, a FastSparseVector is a C++ object and thus cannot go in a tuple, which is a python object.

The solution is probably to use a dictionary in the tuple, then have a function that converts a python dict to a FastSparseVector before throwing it back over the fence to the C++ side.

ghost commented 9 years ago

This renders the whole Python module broken. It is not possible to build a realtime system as described by [http://www.cs.cmu.edu/~mdenkows/cdec-realtime.html], as the module won't build and thus not install.