Mosestokenizer问题:[WinError 2]系统找不到指定的文件

3

无法理解为什么会出现这个问题。

Original Answer翻译成"最初的回答"。
from mosestokenizer import MosesDetokenizer

with MosesDetokenizer('en') as detokenize:
    print(detokenize(["hi", 'my', 'name', 'is', 'artem']))

这是我得到的内容:最初的回答。
stdbuf was not found; communication with perl may hang due to stdio buffering.
Traceback (most recent call last):
  File "C:\Users\ArtemLaptiev\Documents\GitHub\temp\foo.py", line 3, in <module>
    with MosesDetokenizer('en') as detokenize:
  File "C:\ProgramFiles\Anaconda\lib\site-packages\mosestokenizer\detokenizer.py", line 47, in __init__
    super().__init__(argv)
  File "C:\ProgramFiles\Anaconda\lib\site-packages\toolwrapper.py", line 52, in __init__
    self.start()
  File "C:\ProgramFiles\Anaconda\lib\site-packages\toolwrapper.py", line 92, in start
    cwd=self.cwd
  File "C:\ProgramFiles\Anaconda\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "C:\ProgramFiles\Anaconda\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

Thank you for help!


请使用 https://github.com/alvations/sacremoses 替代。 - alvas
1个回答

2
使用 sacremoses 代替 moses
pip install -U sacremoses

并且

from sacremoses import MosesTokenizer, MosesDetokenizer
with MosesDetokenizer() as detokenize:
    print(detokenize(["hi", 'my', 'name', 'is', 'artem']))

完整详情请参见 sacremoses


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接