Skip to content

Commit

Permalink
dict
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjun committed May 13, 2019
1 parent 1f6ad3f commit 42e17cd
Show file tree
Hide file tree
Showing 12 changed files with 20,843 additions and 210 deletions.
Binary file modified .DS_Store
Binary file not shown.

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions code/10.word2vec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2174,22 +2174,26 @@
},
{
"cell_type": "code",
"execution_count": 116,
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2019-04-07T07:25:09.157658Z",
"start_time": "2019-04-07T07:25:08.968246Z"
"end_time": "2019-04-23T03:59:03.438346Z",
"start_time": "2019-04-23T03:59:03.263853Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/datalab/Applications/anaconda/lib/python3.5/site-packages/ipykernel/__main__.py:5: DeprecationWarning: Call to deprecated `__getitem__` (Method will be removed in 4.0.0, use self.wv.__getitem__() instead).\n"
"ename": "NameError",
"evalue": "name 'model' is not defined",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-1-05a54a135a3e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mrawWordVec\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mword2ind\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwv\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvocab\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5\u001b[0m \u001b[0mrawWordVec\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mw\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m \u001b[0mword2ind\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mw\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'model' is not defined"
]
}
],
Expand All @@ -2213,7 +2217,6 @@
"start_time": "2019-04-07T07:26:14.643527Z"
},
"code_folding": [
0,
10
],
"slideshow": {
Expand Down
Loading

0 comments on commit 42e17cd

Please sign in to comment.