mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-20 15:48:05 +03:00
.. | ||
binpt | ||
examples | ||
example.py | ||
README.md | ||
setup.py |
Python interface to Moses
The idea is to have some of Moses' internals exposed to Python (inspired on pycdec).
What's been interfaced?
-
Binary phrase table:
Moses::PhraseDictionaryTree.h
Building
-
Build the python extension
python setup.py build_ext -i [--with-cmph]
-
Check the example code
echo "casa" | python example.py examples/phrase-table 5 1 echo "essa casa" | python example.py examples/phrase-table 5 1
Changing the code
If you want to add your changes you are going to have to recompile the cython code.
-
Compile the cython code (use Cython 0.16): this will generate binpt/binpt.cpp
cython --cplus binpt/binpt.pyx