Skip to content

Commit

Permalink
Add missing import
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Sep 26, 2017
1 parent 31cdc0f commit df70860
Showing 1 changed file with 39 additions and 22 deletions.
61 changes: 39 additions & 22 deletions lstm_word2vec_archive.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using CNTK backend\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"import os\n",
Expand All @@ -37,7 +29,7 @@
"os.environ['KERAS_BACKEND']='cntk'\n",
"from keras.preprocessing import sequence\n",
"from keras.preprocessing.text import Tokenizer, text_to_word_sequence\n",
"from keras.models import Sequential\n",
"from keras.models import Sequential, load_model\n",
"from keras import regularizers\n",
"from keras.optimizers import SGD\n",
"from keras.layers import Dense, Dropout, Embedding, LSTM, Bidirectional\n",
Expand Down Expand Up @@ -96,7 +88,9 @@
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -107,7 +101,9 @@
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -117,7 +113,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Extract scores and review texts from file "
]
Expand All @@ -126,7 +125,9 @@
"cell_type": "code",
"execution_count": 60,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -140,7 +141,9 @@
"cell_type": "code",
"execution_count": 74,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -151,7 +154,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Remove medium rating and convert to binary classification (high vs. low rating). "
]
Expand All @@ -160,7 +166,9 @@
"cell_type": "code",
"execution_count": 80,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [],
"source": [
Expand All @@ -183,7 +191,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"deletable": true,
"editable": true
},
"source": [
"Extract a balanced subsample and split into training and test sets."
]
Expand All @@ -208,7 +219,9 @@
"cell_type": "code",
"execution_count": 124,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
Expand All @@ -232,7 +245,9 @@
"cell_type": "code",
"execution_count": 118,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
Expand Down Expand Up @@ -667,7 +682,9 @@
"cell_type": "code",
"execution_count": 152,
"metadata": {
"collapsed": false
"collapsed": false,
"deletable": true,
"editable": true
},
"outputs": [
{
Expand Down

0 comments on commit df70860

Please sign in to comment.