90e5b974a7173ab0bba0990a690e32f25f5b725a,tools/embeddings_to_torch.py,,get_vocabs,#Any#,13
Before Change
enc_vocab = vocab[1]
if vocab[0] == "tgt":
dec_vocab = vocab[1]
assert enc_vocab is not None and dec_vocab is not None
logger.info("From: %s" % dict_file)
logger.info("\t* source vocab: %d words" % len(enc_vocab))
logger.info("\t* target vocab: %d words" % len(dec_vocab))
After Change
if old_style_vocab(fields):
enc_vocab = next((v for n, v in fields if n == "src"), None)
dec_vocab = next((v for n, v in fields if n == "tgt"), None)
else:
enc_vocab = fields["src"][0][1].vocab
dec_vocab = fields["tgt"][0][1].vocab
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 3
Instances
Project Name: OpenNMT/OpenNMT-py
Commit Name: 90e5b974a7173ab0bba0990a690e32f25f5b725a
Time: 2019-01-14
Author: benzurdopeters@gmail.com
File Name: tools/embeddings_to_torch.py
Class Name:
Method Name: get_vocabs
Project Name: OpenNMT/OpenNMT-py
Commit Name: 594f66417cf0a2abaead1ce6e5f15a2100441682
Time: 2017-09-21
Author: srush@seas.harvard.edu
File Name: onmt/IO.py
Class Name: ONMTDataset
Method Name: __init__
Project Name: NifTK/NiftyNet
Commit Name: 10bc0692e66d8f4e66c69a868870eaaff801942b
Time: 2017-08-28
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_training_update
Project Name: NifTK/NiftyNet
Commit Name: 10bc0692e66d8f4e66c69a868870eaaff801942b
Time: 2017-08-28
Author: wenqi.li@ucl.ac.uk
File Name: tests/application_driver_test.py
Class Name: ApplicationDriverTest
Method Name: test_app_stop
Project Name: Hironsan/anago
Commit Name: e1209a057354bdb521afe37b878e27a77f227427
Time: 2018-05-31
Author: hiroki.nakayama.py@gmail.com
File Name: tests/test_utils.py
Class Name: TestUtils
Method Name: test_batch_iter