From 3cca0c3ec397fbcb4c0ff0f51487e29338f53614 Mon Sep 17 00:00:00 2001 From: Felix Hieber Date: Wed, 19 Sep 2018 18:52:08 +0200 Subject: [PATCH] Renamed contrib to sockeye_contrib (#537) * Renamed contrib to sockeye_contrib * Typo fix. --- .travis.yml | 2 +- CHANGELOG.md | 4 +++ MANIFEST.in | 4 +-- README.md | 2 +- sockeye/__init__.py | 2 +- sockeye/evaluate.py | 2 +- sockeye/lexicon.py | 4 +-- sockeye/rerank.py | 2 +- {contrib => sockeye_contrib}/__init__.py | 0 .../autopilot/README.md | 4 +-- .../autopilot/__init__.py | 8 ++--- .../autopilot/autopilot.py | 30 +++++++++---------- .../autopilot/models.py | 0 .../autopilot/tasks.py | 0 .../autopilot/test.py | 18 +++++------ .../autopilot/third_party.py | 0 .../fast_align/Dockerfile | 0 .../fast_align/README.md | 0 .../fast_align/build.sh | 0 .../fast_align/lex_table.sh | 0 {contrib => sockeye_contrib}/rouge.py | 0 .../sacrebleu/CHANGELOG.md | 0 .../sacrebleu/README.md | 2 +- .../sacrebleu/__init__.py | 2 +- .../sacrebleu/sacrebleu.py | 0 .../sacrebleu/setup.cfg | 0 .../sacrebleu/setup.py | 0 .../sacrebleu/test.sh | 0 .../vistools/README.md | 4 +-- .../vistools/generate_graphs.py | 0 .../vistools/pytest.ini | 0 .../vistools/requirements.txt | 0 .../vistools/templates/tree.css | 0 .../vistools/templates/tree.js | 0 .../vistools/test/__init__.py | 0 .../vistools/test/resources/beams.json | 0 .../test/resources/output/000000.html | 0 .../test/resources/output/000001.html | 0 .../test/resources/output/000002.html | 0 .../test/resources/output/000003.html | 0 .../test/resources/output/000004.html | 0 .../test/resources/output/000005.html | 0 .../test/resources/output/000006.html | 0 .../test/resources/output/000007.html | 0 .../test/resources/output/000008.html | 0 .../test/resources/output/000009.html | 0 .../vistools/test/resources/output/tree.css | 0 .../vistools/test/resources/output/tree.js | 0 .../vistools/test/test_integration.py | 0 test/unit/test_bleu.py | 2 +- test/unit/test_chrf.py | 2 +- test/unit/test_rouge.py | 2 +- 52 files changed, 50 insertions(+), 46 deletions(-) rename {contrib => sockeye_contrib}/__init__.py (100%) rename {contrib => sockeye_contrib}/autopilot/README.md (96%) rename {contrib => sockeye_contrib}/autopilot/__init__.py (75%) rename {contrib => sockeye_contrib}/autopilot/autopilot.py (97%) rename {contrib => sockeye_contrib}/autopilot/models.py (100%) rename {contrib => sockeye_contrib}/autopilot/tasks.py (100%) rename {contrib => sockeye_contrib}/autopilot/test.py (94%) rename {contrib => sockeye_contrib}/autopilot/third_party.py (100%) rename {contrib => sockeye_contrib}/fast_align/Dockerfile (100%) rename {contrib => sockeye_contrib}/fast_align/README.md (100%) rename {contrib => sockeye_contrib}/fast_align/build.sh (100%) rename {contrib => sockeye_contrib}/fast_align/lex_table.sh (100%) rename {contrib => sockeye_contrib}/rouge.py (100%) rename {contrib => sockeye_contrib}/sacrebleu/CHANGELOG.md (100%) rename {contrib => sockeye_contrib}/sacrebleu/README.md (98%) rename {contrib => sockeye_contrib}/sacrebleu/__init__.py (79%) rename {contrib => sockeye_contrib}/sacrebleu/sacrebleu.py (100%) rename {contrib => sockeye_contrib}/sacrebleu/setup.cfg (100%) rename {contrib => sockeye_contrib}/sacrebleu/setup.py (100%) rename {contrib => sockeye_contrib}/sacrebleu/test.sh (100%) rename {contrib => sockeye_contrib}/vistools/README.md (90%) rename {contrib => sockeye_contrib}/vistools/generate_graphs.py (100%) rename {contrib => sockeye_contrib}/vistools/pytest.ini (100%) rename {contrib => sockeye_contrib}/vistools/requirements.txt (100%) rename {contrib => sockeye_contrib}/vistools/templates/tree.css (100%) rename {contrib => sockeye_contrib}/vistools/templates/tree.js (100%) rename {contrib => sockeye_contrib}/vistools/test/__init__.py (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/beams.json (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000000.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000001.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000002.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000003.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000004.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000005.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000006.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000007.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000008.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/000009.html (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/tree.css (100%) rename {contrib => sockeye_contrib}/vistools/test/resources/output/tree.js (100%) rename {contrib => sockeye_contrib}/vistools/test/test_integration.py (100%) diff --git a/.travis.yml b/.travis.yml index d60b51810..3704e87e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ script: - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then python -m pytest -k "Copy:transformer:transformer" --maxfail=1 test/system; fi - if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then python -m pytest -k "Copy:cnn:cnn" --maxfail=1 test/system; fi - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then python -m pytest --maxfail=1 test/system; fi - - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then python -m contrib.autopilot.test; fi + - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then python -m sockeye_contrib.autopilot.test; fi # Deploy all tagged versions to PyPI deploy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9333033ba..987749068 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Note that Sockeye has checks in place to not translate with an old model that wa Each version section may have have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_. +## [1.18.55] +### Changed +- Renamed `contrib` to less-generic `sockeye_contrib` + ## [1.18.54] ### Added - `--source-factor-vocabs` can be set to provide source factor vocabularies. diff --git a/MANIFEST.in b/MANIFEST.in index 1623ccf82..3b1e7497d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,8 +10,8 @@ include sockeye/git_version.py recursive-include .github * include CONTRIBUTING.md exclude *.sh -exclude contrib -recursive-exclude contrib * +exclude sockeye_contrib +recursive-exclude sockeye_contrib * include pytest.ini recursive-include test *.py recursive-include test *.ini diff --git a/README.md b/README.md index ac4183e39..d7299d1be 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ For example *sockeye-train* can also be invoked as ## First Steps -For easily training popular model types on known data sets, see the [Sockeye Autopilot documentation](https://github.com/awslabs/sockeye/tree/master/contrib/autopilot). +For easily training popular model types on known data sets, see the [Sockeye Autopilot documentation](https://github.com/awslabs/sockeye/tree/master/sockeye_contrib/autopilot). For manually training and running translation models on your data, read on. ### Train diff --git a/sockeye/__init__.py b/sockeye/__init__.py index 81ba22787..65009d094 100644 --- a/sockeye/__init__.py +++ b/sockeye/__init__.py @@ -11,4 +11,4 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -__version__ = '1.18.54' +__version__ = '1.18.55' diff --git a/sockeye/evaluate.py b/sockeye/evaluate.py index 1a4a105b7..a6dfb4ca3 100644 --- a/sockeye/evaluate.py +++ b/sockeye/evaluate.py @@ -23,7 +23,7 @@ import numpy as np -from contrib import sacrebleu, rouge +from sockeye_contrib import sacrebleu, rouge from . import arguments from . import constants as C from . import data_io diff --git a/sockeye/lexicon.py b/sockeye/lexicon.py index 788e0e997..9d90d2e95 100644 --- a/sockeye/lexicon.py +++ b/sockeye/lexicon.py @@ -241,8 +241,8 @@ def main(): subparams = params.add_subparsers(title="Commands") params_create = subparams.add_parser('create', description="Create top-k lexicon for use during decoding. " - "See contrib/fast_align/README.md for information " - "on creating input lexical tables.") + "See sockeye_contrib/fast_align/README.md " + "for information on creating input lexical tables.") arguments.add_lexicon_args(params_create) arguments.add_lexicon_create_args(params_create) arguments.add_logging_args(params_create) diff --git a/sockeye/rerank.py b/sockeye/rerank.py index a2f13af06..9820fa917 100644 --- a/sockeye/rerank.py +++ b/sockeye/rerank.py @@ -26,7 +26,7 @@ from . import utils from . import arguments from . import constants as C -from contrib import sacrebleu +from sockeye_contrib import sacrebleu logger = log.setup_main_logger(__name__, console=True, file_logging=False) diff --git a/contrib/__init__.py b/sockeye_contrib/__init__.py similarity index 100% rename from contrib/__init__.py rename to sockeye_contrib/__init__.py diff --git a/contrib/autopilot/README.md b/sockeye_contrib/autopilot/README.md similarity index 96% rename from contrib/autopilot/README.md rename to sockeye_contrib/autopilot/README.md index 4cb1a2639..ea3887aeb 100644 --- a/contrib/autopilot/README.md +++ b/sockeye_contrib/autopilot/README.md @@ -15,7 +15,7 @@ If Sockeye is installed via pip or source, Autopilot can be run directly: This is equivalent to: ```bash -> python -m contrib.autopilot.autopilot +> python -m sockeye_contrib.autopilot.autopilot ``` With a single command, Autopilot can download and pre-process training data, then train and evaluate a translation model. @@ -129,4 +129,4 @@ Provide the following outputs to the user under "results": - test.N.MODEL.SETTINGS.bpe.bleu: BLEU score of raw decoder output against byte-pair encoded references - test.N.MODEL.SETTINGS.tok.bleu: BLEU score of word-level decoder output against tokenized references -- test.N.MODEL.SETTINGS.detok.sacrebleu: BLEU score of detokenized decoder output against raw references using [SacreBLEU](https://github.com/awslabs/sockeye/tree/master/contrib/sacrebleu). These scores are directly comparable to those reported in WMT evaluations. +- test.N.MODEL.SETTINGS.detok.sacrebleu: BLEU score of detokenized decoder output against raw references using [SacreBLEU](https://github.com/awslabs/sockeye/tree/master/sockeye_contrib/sacrebleu). These scores are directly comparable to those reported in WMT evaluations. diff --git a/contrib/autopilot/__init__.py b/sockeye_contrib/autopilot/__init__.py similarity index 75% rename from contrib/autopilot/__init__.py rename to sockeye_contrib/autopilot/__init__.py index 39ab3bfd1..b5f16042a 100644 --- a/contrib/autopilot/__init__.py +++ b/sockeye_contrib/autopilot/__init__.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -from contrib.autopilot import autopilot -from contrib.autopilot import tasks -from contrib.autopilot import models -from contrib.autopilot import third_party +from sockeye_contrib.autopilot import autopilot +from sockeye_contrib.autopilot import tasks +from sockeye_contrib.autopilot import models +from sockeye_contrib.autopilot import third_party diff --git a/contrib/autopilot/autopilot.py b/sockeye_contrib/autopilot/autopilot.py similarity index 97% rename from contrib/autopilot/autopilot.py rename to sockeye_contrib/autopilot/autopilot.py index 48bab29a5..4992c2344 100644 --- a/contrib/autopilot/autopilot.py +++ b/sockeye_contrib/autopilot/autopilot.py @@ -37,15 +37,15 @@ raise RuntimeError("Please install the sockeye module or add the sockeye root directory to your Python path. Ex: export PYTHONPATH=%s" % SOCKEYE_ROOT) -from contrib.autopilot.tasks import ARCHIVE_NONE, ARCHIVE_TAR, ARCHIVE_ZIP -from contrib.autopilot.tasks import TEXT_UTF8_RAW, TEXT_UTF8_RAW_SGML, TEXT_UTF8_RAW_BITEXT -from contrib.autopilot.tasks import TEXT_UTF8_RAW_BITEXT_REVERSE, TEXT_REQUIRES_TOKENIZATION -from contrib.autopilot.tasks import TEXT_UTF8_TOKENIZED -from contrib.autopilot.tasks import RAW_FILES -from contrib.autopilot.tasks import Task, TASKS -from contrib.autopilot.models import MODELS, MODEL_NONE, MODEL_GNMT, MODEL_TEST_ARGS -from contrib.autopilot.models import DECODE_ARGS, DECODE_STANDARD, DECODE_GNMT -from contrib.autopilot import third_party +from sockeye_contrib.autopilot.tasks import ARCHIVE_NONE, ARCHIVE_TAR, ARCHIVE_ZIP +from sockeye_contrib.autopilot.tasks import TEXT_UTF8_RAW, TEXT_UTF8_RAW_SGML, TEXT_UTF8_RAW_BITEXT +from sockeye_contrib.autopilot.tasks import TEXT_UTF8_RAW_BITEXT_REVERSE, TEXT_REQUIRES_TOKENIZATION +from sockeye_contrib.autopilot.tasks import TEXT_UTF8_TOKENIZED +from sockeye_contrib.autopilot.tasks import RAW_FILES +from sockeye_contrib.autopilot.tasks import Task, TASKS +from sockeye_contrib.autopilot.models import MODELS, MODEL_NONE, MODEL_GNMT, MODEL_TEST_ARGS +from sockeye_contrib.autopilot.models import DECODE_ARGS, DECODE_STANDARD, DECODE_GNMT +from sockeye_contrib.autopilot import third_party # Formats for custom files @@ -457,7 +457,7 @@ def call_sockeye_translate(args: List[str], def call_sacrebleu(input_fname: str, ref_fname: str, output_fname: str, log_fname: str, tokenized: bool = False): """ - Call contrib.sacrebleu.sacrebleu on tokenized or detokenized inputs. + Call sockeye_contrib.sacrebleu.sacrebleu on tokenized or detokenized inputs. :param input_fname: Input translation file. :param ref_fname: Reference translation file. @@ -468,7 +468,7 @@ def call_sacrebleu(input_fname: str, ref_fname: str, output_fname: str, log_fnam # Assemble command command = [sys.executable, "-m", - "contrib.sacrebleu.sacrebleu", + "sockeye_contrib.sacrebleu.sacrebleu", "--score-only", "--input={}".format(input_fname), ref_fname] @@ -477,7 +477,7 @@ def call_sacrebleu(input_fname: str, ref_fname: str, output_fname: str, log_fnam command.append("--tokenize=none") # Call sacrebleu with open(log_fname, "wb") as log: - logging.info("contrib.sacrebleu.sacrebleu: %s -> %s", input_fname, output_fname) + logging.info("sockeye_contrib.sacrebleu.sacrebleu: %s -> %s", input_fname, output_fname) logging.info("Log: %s", log_fname) score = subprocess.check_output(command, stderr=log) # Record successful score @@ -796,7 +796,7 @@ def report_data(file_sets): else: fname_log = os.path.join(args.workspace, DIR_LOGS, - "contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, + "sockeye_contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, args.model, fname_base + SUFFIX_BPE, os.getpid())) @@ -817,7 +817,7 @@ def report_data(file_sets): third_party.merge_bpe(input_fname=fname_bpe, output_fname=fname_tok) fname_log = os.path.join(args.workspace, DIR_LOGS, - "contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, + "sockeye_contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, args.model, fname_base + SUFFIX_TOK, os.getpid())) @@ -844,7 +844,7 @@ def report_data(file_sets): lang_code=lang_code) fname_log = os.path.join(args.workspace, DIR_LOGS, - "contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, + "sockeye_contrib.sacrebleu.sacrebleu.{}.{}.{}.{}.log".format(task_name, args.model, fname_base + SUFFIX_DETOK, os.getpid())) diff --git a/contrib/autopilot/models.py b/sockeye_contrib/autopilot/models.py similarity index 100% rename from contrib/autopilot/models.py rename to sockeye_contrib/autopilot/models.py diff --git a/contrib/autopilot/tasks.py b/sockeye_contrib/autopilot/tasks.py similarity index 100% rename from contrib/autopilot/tasks.py rename to sockeye_contrib/autopilot/tasks.py diff --git a/contrib/autopilot/test.py b/sockeye_contrib/autopilot/test.py similarity index 94% rename from contrib/autopilot/test.py rename to sockeye_contrib/autopilot/test.py index 63df40268..ca2fe2ab6 100644 --- a/contrib/autopilot/test.py +++ b/sockeye_contrib/autopilot/test.py @@ -23,7 +23,7 @@ # Make sure the version of sockeye being tested is first on the system path try: - import contrib.autopilot.autopilot as autopilot + import sockeye_contrib.autopilot.autopilot as autopilot except ImportError: SOCKEYE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) PYTHONPATH = "PYTHONPATH" @@ -32,7 +32,7 @@ else: os.environ[PYTHONPATH] = SOCKEYE_ROOT sys.path.append(SOCKEYE_ROOT) - import contrib.autopilot.autopilot as autopilot + import sockeye_contrib.autopilot.autopilot as autopilot # Test-specific constants @@ -84,7 +84,7 @@ def main(): # WMT task with raw data (Transformer) command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--task={}".format(WMT_TASK), "--model=transformer", "--gpus=0", @@ -94,7 +94,7 @@ def main(): # WMT task with raw data (GNMT) command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--task={}".format(WMT_TASK), "--model=gnmt_like", "--decode-settings=gnmt_like", @@ -107,7 +107,7 @@ def main(): # WNMT task with pre-tokenized data (Transformer) # command = [sys.executable, # "-m", - # "contrib.autopilot.autopilot", + # "sockeye_contrib.autopilot.autopilot", # "--task={}".format(WNMT_TASK), # "--model=transformer", # "--gpus=0", @@ -117,7 +117,7 @@ def main(): # WMT task, prepare data only command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--task={}".format(DATA_ONLY_TASK), "--model=none", "--gpus=0", @@ -127,7 +127,7 @@ def main(): # Custom task (raw data, Transformer) command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--custom-task=custom_raw", "--custom-train", os.path.join(work_dir, autopilot.DIR_SYSTEMS, WMT_TASK + autopilot.SUFFIX_TEST, autopilot.DIR_DATA, @@ -156,7 +156,7 @@ def main(): # Custom task (tokenized data, Transformer) command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--custom-task=custom_tok", "--custom-train", os.path.join(work_dir, autopilot.DIR_SYSTEMS, WMT_TASK + autopilot.SUFFIX_TEST, autopilot.DIR_DATA, @@ -183,7 +183,7 @@ def main(): # Custom task (byte-pair encoded data, Transformer) command = [sys.executable, "-m", - "contrib.autopilot.autopilot", + "sockeye_contrib.autopilot.autopilot", "--custom-task=custom_bpe", "--custom-train", os.path.join(work_dir, autopilot.DIR_SYSTEMS, WMT_TASK + autopilot.SUFFIX_TEST, autopilot.DIR_DATA, diff --git a/contrib/autopilot/third_party.py b/sockeye_contrib/autopilot/third_party.py similarity index 100% rename from contrib/autopilot/third_party.py rename to sockeye_contrib/autopilot/third_party.py diff --git a/contrib/fast_align/Dockerfile b/sockeye_contrib/fast_align/Dockerfile similarity index 100% rename from contrib/fast_align/Dockerfile rename to sockeye_contrib/fast_align/Dockerfile diff --git a/contrib/fast_align/README.md b/sockeye_contrib/fast_align/README.md similarity index 100% rename from contrib/fast_align/README.md rename to sockeye_contrib/fast_align/README.md diff --git a/contrib/fast_align/build.sh b/sockeye_contrib/fast_align/build.sh similarity index 100% rename from contrib/fast_align/build.sh rename to sockeye_contrib/fast_align/build.sh diff --git a/contrib/fast_align/lex_table.sh b/sockeye_contrib/fast_align/lex_table.sh similarity index 100% rename from contrib/fast_align/lex_table.sh rename to sockeye_contrib/fast_align/lex_table.sh diff --git a/contrib/rouge.py b/sockeye_contrib/rouge.py similarity index 100% rename from contrib/rouge.py rename to sockeye_contrib/rouge.py diff --git a/contrib/sacrebleu/CHANGELOG.md b/sockeye_contrib/sacrebleu/CHANGELOG.md similarity index 100% rename from contrib/sacrebleu/CHANGELOG.md rename to sockeye_contrib/sacrebleu/CHANGELOG.md diff --git a/contrib/sacrebleu/README.md b/sockeye_contrib/sacrebleu/README.md similarity index 98% rename from contrib/sacrebleu/README.md rename to sockeye_contrib/sacrebleu/README.md index 3f4623794..657b94cac 100644 --- a/contrib/sacrebleu/README.md +++ b/sockeye_contrib/sacrebleu/README.md @@ -73,4 +73,4 @@ SacreBLEU is licensed under the Apache 2.0 License. This was all Rico Sennrich's idea. Originally written by Matt Post. -The official version can be found at https://github.com/awslabs/sockeye/tree/master/contrib/sacrebleu. +The official version can be found at https://github.com/awslabs/sockeye/tree/master/sockeye_contrib/sacrebleu. diff --git a/contrib/sacrebleu/__init__.py b/sockeye_contrib/sacrebleu/__init__.py similarity index 79% rename from contrib/sacrebleu/__init__.py rename to sockeye_contrib/sacrebleu/__init__.py index 6edca9828..357c64dac 100644 --- a/contrib/sacrebleu/__init__.py +++ b/sockeye_contrib/sacrebleu/__init__.py @@ -11,4 +11,4 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -from contrib.sacrebleu.sacrebleu import raw_corpus_bleu, compute_bleu, corpus_chrf, CHRF_ORDER, CHRF_BETA, sentence_bleu, sentence_chrf \ No newline at end of file +from sockeye_contrib.sacrebleu.sacrebleu import raw_corpus_bleu, compute_bleu, corpus_chrf, CHRF_ORDER, CHRF_BETA, sentence_bleu, sentence_chrf \ No newline at end of file diff --git a/contrib/sacrebleu/sacrebleu.py b/sockeye_contrib/sacrebleu/sacrebleu.py similarity index 100% rename from contrib/sacrebleu/sacrebleu.py rename to sockeye_contrib/sacrebleu/sacrebleu.py diff --git a/contrib/sacrebleu/setup.cfg b/sockeye_contrib/sacrebleu/setup.cfg similarity index 100% rename from contrib/sacrebleu/setup.cfg rename to sockeye_contrib/sacrebleu/setup.cfg diff --git a/contrib/sacrebleu/setup.py b/sockeye_contrib/sacrebleu/setup.py similarity index 100% rename from contrib/sacrebleu/setup.py rename to sockeye_contrib/sacrebleu/setup.py diff --git a/contrib/sacrebleu/test.sh b/sockeye_contrib/sacrebleu/test.sh similarity index 100% rename from contrib/sacrebleu/test.sh rename to sockeye_contrib/sacrebleu/test.sh diff --git a/contrib/vistools/README.md b/sockeye_contrib/vistools/README.md similarity index 90% rename from contrib/vistools/README.md rename to sockeye_contrib/vistools/README.md index 8445b7e53..5fe0d4906 100644 --- a/contrib/vistools/README.md +++ b/sockeye_contrib/vistools/README.md @@ -7,7 +7,7 @@ This package generates javascript-based graphs of the beam search performed by s First, install the dependencies required for the visualizations: ```sh -pip install -r contrib/vistools/requirements.txt +pip install -r sockeye_contrib/vistools/requirements.txt ``` ### Store the beam histories @@ -27,7 +27,7 @@ python3 -m sockeye.translate --models model \ After inference, the graphs can be generated with: ``` -python3 contrib/vistools/generate_graphs.py -d beams.json -o generated_graphs +python3 sockeye_contrib/vistools/generate_graphs.py -d beams.json -o generated_graphs ``` The `generated_graphs/` folder will contain one `html` file per sentence. Opening it in your browser will show the interactive graph. diff --git a/contrib/vistools/generate_graphs.py b/sockeye_contrib/vistools/generate_graphs.py similarity index 100% rename from contrib/vistools/generate_graphs.py rename to sockeye_contrib/vistools/generate_graphs.py diff --git a/contrib/vistools/pytest.ini b/sockeye_contrib/vistools/pytest.ini similarity index 100% rename from contrib/vistools/pytest.ini rename to sockeye_contrib/vistools/pytest.ini diff --git a/contrib/vistools/requirements.txt b/sockeye_contrib/vistools/requirements.txt similarity index 100% rename from contrib/vistools/requirements.txt rename to sockeye_contrib/vistools/requirements.txt diff --git a/contrib/vistools/templates/tree.css b/sockeye_contrib/vistools/templates/tree.css similarity index 100% rename from contrib/vistools/templates/tree.css rename to sockeye_contrib/vistools/templates/tree.css diff --git a/contrib/vistools/templates/tree.js b/sockeye_contrib/vistools/templates/tree.js similarity index 100% rename from contrib/vistools/templates/tree.js rename to sockeye_contrib/vistools/templates/tree.js diff --git a/contrib/vistools/test/__init__.py b/sockeye_contrib/vistools/test/__init__.py similarity index 100% rename from contrib/vistools/test/__init__.py rename to sockeye_contrib/vistools/test/__init__.py diff --git a/contrib/vistools/test/resources/beams.json b/sockeye_contrib/vistools/test/resources/beams.json similarity index 100% rename from contrib/vistools/test/resources/beams.json rename to sockeye_contrib/vistools/test/resources/beams.json diff --git a/contrib/vistools/test/resources/output/000000.html b/sockeye_contrib/vistools/test/resources/output/000000.html similarity index 100% rename from contrib/vistools/test/resources/output/000000.html rename to sockeye_contrib/vistools/test/resources/output/000000.html diff --git a/contrib/vistools/test/resources/output/000001.html b/sockeye_contrib/vistools/test/resources/output/000001.html similarity index 100% rename from contrib/vistools/test/resources/output/000001.html rename to sockeye_contrib/vistools/test/resources/output/000001.html diff --git a/contrib/vistools/test/resources/output/000002.html b/sockeye_contrib/vistools/test/resources/output/000002.html similarity index 100% rename from contrib/vistools/test/resources/output/000002.html rename to sockeye_contrib/vistools/test/resources/output/000002.html diff --git a/contrib/vistools/test/resources/output/000003.html b/sockeye_contrib/vistools/test/resources/output/000003.html similarity index 100% rename from contrib/vistools/test/resources/output/000003.html rename to sockeye_contrib/vistools/test/resources/output/000003.html diff --git a/contrib/vistools/test/resources/output/000004.html b/sockeye_contrib/vistools/test/resources/output/000004.html similarity index 100% rename from contrib/vistools/test/resources/output/000004.html rename to sockeye_contrib/vistools/test/resources/output/000004.html diff --git a/contrib/vistools/test/resources/output/000005.html b/sockeye_contrib/vistools/test/resources/output/000005.html similarity index 100% rename from contrib/vistools/test/resources/output/000005.html rename to sockeye_contrib/vistools/test/resources/output/000005.html diff --git a/contrib/vistools/test/resources/output/000006.html b/sockeye_contrib/vistools/test/resources/output/000006.html similarity index 100% rename from contrib/vistools/test/resources/output/000006.html rename to sockeye_contrib/vistools/test/resources/output/000006.html diff --git a/contrib/vistools/test/resources/output/000007.html b/sockeye_contrib/vistools/test/resources/output/000007.html similarity index 100% rename from contrib/vistools/test/resources/output/000007.html rename to sockeye_contrib/vistools/test/resources/output/000007.html diff --git a/contrib/vistools/test/resources/output/000008.html b/sockeye_contrib/vistools/test/resources/output/000008.html similarity index 100% rename from contrib/vistools/test/resources/output/000008.html rename to sockeye_contrib/vistools/test/resources/output/000008.html diff --git a/contrib/vistools/test/resources/output/000009.html b/sockeye_contrib/vistools/test/resources/output/000009.html similarity index 100% rename from contrib/vistools/test/resources/output/000009.html rename to sockeye_contrib/vistools/test/resources/output/000009.html diff --git a/contrib/vistools/test/resources/output/tree.css b/sockeye_contrib/vistools/test/resources/output/tree.css similarity index 100% rename from contrib/vistools/test/resources/output/tree.css rename to sockeye_contrib/vistools/test/resources/output/tree.css diff --git a/contrib/vistools/test/resources/output/tree.js b/sockeye_contrib/vistools/test/resources/output/tree.js similarity index 100% rename from contrib/vistools/test/resources/output/tree.js rename to sockeye_contrib/vistools/test/resources/output/tree.js diff --git a/contrib/vistools/test/test_integration.py b/sockeye_contrib/vistools/test/test_integration.py similarity index 100% rename from contrib/vistools/test/test_integration.py rename to sockeye_contrib/vistools/test/test_integration.py diff --git a/test/unit/test_bleu.py b/test/unit/test_bleu.py index eb4d8b35f..79acede9a 100644 --- a/test/unit/test_bleu.py +++ b/test/unit/test_bleu.py @@ -15,7 +15,7 @@ import pytest -from contrib import sacrebleu +from sockeye_contrib import sacrebleu EPSILON = 1e-8 diff --git a/test/unit/test_chrf.py b/test/unit/test_chrf.py index 3c043c64c..978741f65 100644 --- a/test/unit/test_chrf.py +++ b/test/unit/test_chrf.py @@ -15,7 +15,7 @@ import pytest -from contrib import sacrebleu +from sockeye_contrib import sacrebleu EPSILON = 1e-8 diff --git a/test/unit/test_rouge.py b/test/unit/test_rouge.py index 91292f223..a44c5810a 100644 --- a/test/unit/test_rouge.py +++ b/test/unit/test_rouge.py @@ -13,7 +13,7 @@ import pytest -from contrib import rouge +from sockeye_contrib import rouge test_cases = [(["this is a test", "another test case"], ["this is a test case", "another test case"], 0.9444444394753087, 0.928571423622449, 0.9338624338620563), (["this is a single test case"], ["this is a single test case"], 0.999999995, 0.999999995, 0.9999999999995),