mirror of
https://github.com/rsennrich/subword-nmt.git
synced 2024-11-22 23:30:16 +03:00
recommend subword_nmt.py as alternative to pip install in README
This commit is contained in:
parent
bbf885decb
commit
748377374e
@ -34,6 +34,9 @@ The original segmentation can be restored with a simple replacement:
|
||||
|
||||
sed -r 's/(@@ )|(@@ ?$)//g'
|
||||
|
||||
If you cloned the repository and did not install a package, you can also run `subword_nmt.py` as a script:
|
||||
|
||||
./subword-nmt/subword_nmt.py learn-bpe -s {num_operations} < {train_file} > {codes_file}
|
||||
|
||||
BEST PRACTICE ADVICE FOR BYTE PAIR ENCODING IN NMT
|
||||
--------------------------------------------------
|
||||
|
2
setup.py
2
setup.py
@ -19,7 +19,7 @@ setup(
|
||||
test_suite='setup.test_suite',
|
||||
packages=find_packages(),
|
||||
entry_points={
|
||||
'console_scripts': ['subword-nmt=subword_nmt.command_line:main'],
|
||||
'console_scripts': ['subword-nmt=subword_nmt.subword_nmt:main'],
|
||||
},
|
||||
include_package_data=True
|
||||
)
|
||||
|
@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import io
|
||||
import sys
|
||||
import codecs
|
||||
import argparse
|
||||
|
||||
from subword_nmt.learn_bpe import learn_bpe
|
||||
from subword_nmt.apply_bpe import BPE, read_vocabulary
|
||||
from subword_nmt.get_vocab import get_vocab
|
||||
from subword_nmt.learn_joint_bpe_and_vocab import learn_joint_bpe_and_vocab
|
||||
from learn_bpe import learn_bpe
|
||||
from apply_bpe import BPE, read_vocabulary
|
||||
from get_vocab import get_vocab
|
||||
from learn_joint_bpe_and_vocab import learn_joint_bpe_and_vocab
|
||||
|
||||
from subword_nmt.learn_bpe import create_parser as create_learn_bpe_parser
|
||||
from subword_nmt.apply_bpe import create_parser as create_apply_bpe_parser
|
||||
from subword_nmt.get_vocab import create_parser as create_get_vocab_parser
|
||||
from subword_nmt.learn_joint_bpe_and_vocab import create_parser as create_learn_joint_bpe_and_vocab_parser
|
||||
from learn_bpe import create_parser as create_learn_bpe_parser
|
||||
from apply_bpe import create_parser as create_apply_bpe_parser
|
||||
from get_vocab import create_parser as create_get_vocab_parser
|
||||
from learn_joint_bpe_and_vocab import create_parser as create_learn_joint_bpe_and_vocab_parser
|
||||
|
||||
# hack for python2/3 compatibility
|
||||
argparse.open = io.open
|
Loading…
Reference in New Issue
Block a user