mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
.. | ||
binpt | ||
example.py | ||
README.md | ||
setup.py |
Python interface to Moses
The idea is to have some of Moses' internals exposed to Python (inspired by pycdec).
What's been interfaced?
-
Binary phrase table:
Moses::PhraseDictionaryTree.h
Building
-
Compile the cython code
cython --cplus binpt/binpt.pyx
-
Build the python extension
python setup.py build_ext -i
-
Check the example code
echo '! " and "' | python example.py bin-ptable-stem 5 1 echo "casa" | python example.py bin-ptable-stem 5