Hi, Rico:
This may be a newbie question, so apologies in advance.
An undergrad student of mine and I are putting together a Python script that does a bunch of things. It learns a BPE and applies it to some files (Python is a nice way for things to work both in her Windows laptop and in my GNU/Linux machines).
I am currently launching ("subword-nmt apply-bpe" and "subword-nmt learn-bpe") via subprocesses.
Is there a way to import this functionality into a Python script?
I have seen that from a Python shell I can type "from subword_nmt import learn_bpe, apply_bpe", but then if I try something like
infile=open("test.tok.true.es")
outfile=open("/tmp/zzz","w")
learn_bpe(infile,outfile,10000)
I get a "'module' object is not callable" type error.
Thanks a million in advance.
Hi, Rico: This may be a newbie question, so apologies in advance. An undergrad student of mine and I are putting together a Python script that does a bunch of things. It learns a BPE and applies it to some files (Python is a nice way for things to work both in her Windows laptop and in my GNU/Linux machines). I am currently launching ("subword-nmt apply-bpe" and "subword-nmt learn-bpe") via subprocesses. Is there a way to import this functionality into a Python script? I have seen that from a Python shell I can type "from subword_nmt import learn_bpe, apply_bpe", but then if I try something like infile=open("test.tok.true.es") outfile=open("/tmp/zzz","w") learn_bpe(infile,outfile,10000) I get a "'module' object is not callable" type error. Thanks a million in advance.