gpt4 book ai didi

python - 在 python 中使用 FST 库

转载 作者:太空狗 更新时间:2023-10-30 01:22:09 31 4
gpt4 key购买 nike

如何安装 OpenFST ?

我一直这样做:

wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.4.1.tar.gz
tar -zxvf openfst-1.4.1.tar.gz
cd openfst-1.4.1
./configure
make
make install

还有其他安装方法吗?

实际上我最终想要的是在 python 中使用 OpenFST,我一直在使用这个包装器:https://github.com/vchahun/pyfst

安装OpenFST后,在安装pyfst时,我遇到了以下问题。任何人都知道如何解决这个问题?:

$ sudo pip install pyfst
....

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pyfst/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-O7BSyr-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pyfst
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.5', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.5-py2.7.egg/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.5-py2.7.egg/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)

但是是否有 OpenFST 的纯 python 端口?

最佳答案

自 OpenFST 1.5 发布以来,它现在包含一个 Python 包装器。在 1.5.3 中,包装器比少数独立的 OpenFST Python 包装器功能更全面。我不知道任何纯 python FST 实现。目前肯定没有任何知名的。

关于python - 在 python 中使用 FST 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25763425/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com