Skip to content

Commit

Permalink
Keep vocab mapping stable
Browse files Browse the repository at this point in the history
Keep vocab mapping stable
  • Loading branch information
vertexcite committed Jul 4, 2017
1 parent a2f687f commit fe45987
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion intro-to-rnns/Anna_KaRNNa.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"source": [
"with open('anna.txt', 'r') as f:\n",
" text=f.read()\n",
"vocab = set(text)\n",
"vocab = sorted(set(text))\n",
"vocab_to_int = {c: i for i, c in enumerate(vocab)}\n",
"int_to_vocab = dict(enumerate(vocab))\n",
"encoded = np.array([vocab_to_int[c] for c in text], dtype=np.int32)"
Expand Down
2 changes: 1 addition & 1 deletion intro-to-rnns/Anna_KaRNNa_Exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"source": [
"with open('anna.txt', 'r') as f:\n",
" text=f.read()\n",
"vocab = set(text)\n",
"vocab = sorted(set(text))\n",
"vocab_to_int = {c: i for i, c in enumerate(vocab)}\n",
"int_to_vocab = dict(enumerate(vocab))\n",
"encoded = np.array([vocab_to_int[c] for c in text], dtype=np.int32)"
Expand Down

0 comments on commit fe45987

Please sign in to comment.