Skip to content

Commit d57eba1

Browse files
authored
Internet-free MXNet SST2 sentiment analysis (aws#2762)
1 parent 20d3ff4 commit d57eba1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

sagemaker-python-sdk/mxnet_gluon_sentiment/mxnet_sentiment_analysis_with_gluon.ipynb

+13-10
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@
2626
"metadata": {},
2727
"outputs": [],
2828
"source": [
29-
"%%bash\n",
30-
"mkdir data\n",
29+
"!mkdir data\n",
3130
"\n",
32-
"curl https://raw.githubusercontent.com/saurabh3949/Text-Classification-Datasets/master/stsa.binary.phrases.train > data/train\n",
33-
"curl https://raw.githubusercontent.com/saurabh3949/Text-Classification-Datasets/master/stsa.binary.test > data/test "
31+
"import boto3\n",
32+
"\n",
33+
"s3 = boto3.client(\"s3\")\n",
34+
"\n",
35+
"s3.download_file(\"sagemaker-sample-files\", \"datasets/text/SST2/sst2.train\", \"data/train\")\n",
36+
"s3.download_file(\"sagemaker-sample-files\", \"datasets/text/SST2/sst2.test\", \"data/test\")"
3437
]
3538
},
3639
{
@@ -97,11 +100,11 @@
97100
"m = MXNet(\n",
98101
" \"sentiment.py\",\n",
99102
" role=get_execution_role(),\n",
100-
" train_instance_count=1,\n",
101-
" train_instance_type=\"ml.c4.xlarge\",\n",
102-
" framework_version=\"1.6.0\",\n",
103-
" py_version=\"py3\",\n",
104-
" distributions={\"parameter_server\": {\"enabled\": True}},\n",
103+
" instance_count=1,\n",
104+
" instance_type=\"ml.c4.xlarge\",\n",
105+
" framework_version=\"1.8.0\",\n",
106+
" py_version=\"py37\",\n",
107+
" distribution={\"parameter_server\": {\"enabled\": True}},\n",
105108
" hyperparameters={\n",
106109
" \"batch-size\": 8,\n",
107110
" \"epochs\": 2,\n",
@@ -212,7 +215,7 @@
212215
"name": "python",
213216
"nbconvert_exporter": "python",
214217
"pygments_lexer": "ipython3",
215-
"version": "3.6.5"
218+
"version": "3.6.13"
216219
},
217220
"notice": "Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."
218221
},

0 commit comments

Comments
 (0)