瀏覽代碼

Fix vocabulary naming (input/output vocabulary no longer has same name) (#946)

Justas Zemgulys 8 年之前
父節點
當前提交
efa4a6cfaa
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      tutorials/rnn/translate/data_utils.py

+ 2 - 2
tutorials/rnn/translate/data_utils.py

@@ -300,8 +300,8 @@ def prepare_data(data_dir, from_train_path, to_train_path, from_dev_path, to_dev
         (6) path to the "to language" vocabulary file.
     """
   # Create vocabularies of the appropriate sizes.
-  to_vocab_path = os.path.join(data_dir, "vocab%d" % to_vocabulary_size)
-  from_vocab_path = os.path.join(data_dir, "vocab%d" % from_vocabulary_size)
+  to_vocab_path = os.path.join(data_dir, "vocab%d.to" % to_vocabulary_size)
+  from_vocab_path = os.path.join(data_dir, "vocab%d.from" % from_vocabulary_size)
   create_vocabulary(to_vocab_path, to_train_path , to_vocabulary_size, tokenizer)
   create_vocabulary(from_vocab_path, from_train_path , from_vocabulary_size, tokenizer)