Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb784c0

Browse files
committed
Prevents TypeError:'dict_keys' object does not support indexing
1 parent e2fb51d commit eb784c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

research/skip_thoughts/skip_thoughts/data/preprocess_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ def _build_vocabulary(input_files):
121121

122122
tf.logging.info("Processed %d sentences total", num)
123123

124-
words = wordcount.keys()
125-
freqs = wordcount.values()
124+
words = list(wordcount)
125+
freqs = list(wordcount.values())
126126
sorted_indices = np.argsort(freqs)[::-1]
127127

128128
vocab = collections.OrderedDict()

0 commit comments

Comments
 (0)