Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def create_vocabulary(vocabulary_path, data_path, max_vocabulary_size,
tokens = tokenizer(line) if tokenizer else basic_tokenizer(line)
for w in tokens:
word = re.sub(_DIGIT_RE, b"0", w) if normalize_digits else w
if word in vocab:
vocab[word] += 1
else:
if word not in vocab:
vocab[word] = 1
else:
vocab[word] += 1
vocab_list = _START_VOCAB + sorted(vocab, key=vocab.get, reverse=True)
print('>> Full Vocabulary Size :',len(vocab_list))
if len(vocab_list) > max_vocabulary_size:
Expand Down
1 change: 1 addition & 0 deletions seq2seq_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import random

from tqdm import tqdm
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
Expand Down