rsennrich / multidomain_smt

GNU General Public License v2.0
1 stars 0 forks source link

No such file or directory: 'ngram-count': 'ngram-count' #1

Open sueyeontwigfarm opened 4 years ago

sueyeontwigfarm commented 4 years ago

As I set the paths for Moses and GIZA++ and execute main.py, I get the error message as below,

ngram-count -interpolate -kndiscount -order 4 -unk -lm demo/demo_results/train1.lm -text demo/train1.de
Traceback (most recent call last):
  File "/Users/sueyeon/PycharmProjects/multidomain_smt/main.py", line 133, in <module>
    LMs.append(cluster.SRILM_interface(lm_name, order=LM_ORDER, text=textfile))
  File "/Users/sueyeon/PycharmProjects/multidomain_smt/cluster.py", line 276, in __init__
    self.train(text)
  File "/Users/sueyeon/PycharmProjects/multidomain_smt/cluster.py", line 283, in train
    p = Popen(cmd)
  File "/Users/sueyeon/anaconda3/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/Users/sueyeon/anaconda3/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ngram-count': 'ngram-count'

I have no idea where to find the ngram-count file in the project. Can you clue me in on this issue?

rsennrich commented 4 years ago

ngram-count comes from SRILM: http://www.speech.sri.com/projects/srilm/

However, you can also replace this command with lmplz, which is included in Moses:

lmplz -o 4 < demo/train1.de > demo/demo_results/train1.lm

which will give (almost) the same results and be more efficient.