16
16
},
17
17
{
18
18
"cell_type" : " code" ,
19
- "execution_count" : 3 ,
19
+ "execution_count" : 1 ,
20
20
"metadata" : {},
21
- "outputs" : [],
21
+ "outputs" : [
22
+ {
23
+ "name" : " stderr" ,
24
+ "output_type" : " stream" ,
25
+ "text" : [
26
+ " [nltk_data] Downloading package vader_lexicon to\n " ,
27
+ " [nltk_data] /home/ec2-user/nltk_data...\n "
28
+ ]
29
+ }
30
+ ],
22
31
"source" : [
23
32
" import pandas as pd\n " ,
24
33
" import numpy as np\n " ,
25
34
" \n " ,
26
35
" import re\n " ,
27
- " # import nltk\n " ,
28
- " # nltk.download('vader_lexicon')\n " ,
36
+ " import nltk\n " ,
37
+ " nltk.download('vader_lexicon')\n " ,
29
38
" from nltk.sentiment.vader import SentimentIntensityAnalyzer"
30
39
]
31
40
},
32
41
{
33
42
"cell_type" : " code" ,
34
- "execution_count" : 4 ,
43
+ "execution_count" : 2 ,
35
44
"metadata" : {},
36
45
"outputs" : [],
37
46
"source" : [
40
49
},
41
50
{
42
51
"cell_type" : " code" ,
43
- "execution_count" : null ,
52
+ "execution_count" : 4 ,
44
53
"metadata" : {},
45
54
"outputs" : [],
46
55
"source" : [
47
- " data_location = 's3://tweets-hackoff2/tesla_sf.csv'\n " ,
56
+ " from sagemaker import get_execution_role\n " ,
57
+ " \n " ,
58
+ " role = get_execution_role()\n " ,
59
+ " data_location = 's3://tweets-hackoff1/tweets_tesla_sf.csv'\n " ,
48
60
" df = pd.read_csv(data_location)"
49
61
]
50
62
},
51
63
{
52
64
"cell_type" : " code" ,
53
- "execution_count" : 6 ,
65
+ "execution_count" : 5 ,
54
66
"metadata" : {},
55
67
"outputs" : [],
56
68
"source" : [
85
97
},
86
98
{
87
99
"cell_type" : " code" ,
88
- "execution_count" : 7 ,
100
+ "execution_count" : 6 ,
89
101
"metadata" : {},
90
102
"outputs" : [],
91
103
"source" : [
94
106
},
95
107
{
96
108
"cell_type" : " code" ,
97
- "execution_count" : 8 ,
109
+ "execution_count" : 7 ,
98
110
"metadata" : {},
99
111
"outputs" : [
100
112
{
101
- "output_type" : " execute_result" ,
102
113
"data" : {
103
114
"text/plain" : [
104
- " <__main__.SentimentAnalysisTweets at 0x20e6cf84188 >"
115
+ " <__main__.SentimentAnalysisTweets at 0x7f89d4988860 >"
105
116
]
106
117
},
118
+ "execution_count" : 7 ,
107
119
"metadata" : {},
108
- "execution_count " : 8
120
+ "output_type " : " execute_result "
109
121
}
110
122
],
111
123
"source" : [
114
126
},
115
127
{
116
128
"cell_type" : " code" ,
117
- "execution_count" : 14 ,
129
+ "execution_count" : 8 ,
118
130
"metadata" : {},
119
131
"outputs" : [],
120
132
"source" : [
125
137
},
126
138
{
127
139
"cell_type" : " code" ,
128
- "execution_count" : null ,
140
+ "execution_count" : 9 ,
129
141
"metadata" : {},
130
142
"outputs" : [],
131
143
"source" : [
132
144
" # instantiate S3 client and upload to s3\n " ,
133
145
" import boto3\n " ,
134
146
" \n " ,
135
147
" s3 = boto3.resource('s3')\n " ,
136
- " s3.meta.client.upload_file('label_tweets.csv', 'tweets-hackoff ', 'label_tweets.csv')"
148
+ " s3.meta.client.upload_file('label_tweets.csv', 'tweets-hackoff1 ', 'label_tweets.csv')"
137
149
]
150
+ },
151
+ {
152
+ "cell_type" : " code" ,
153
+ "execution_count" : null ,
154
+ "metadata" : {},
155
+ "outputs" : [],
156
+ "source" : []
138
157
}
139
158
],
140
159
"metadata" : {
141
160
"kernelspec" : {
142
- "name " : " python3 " ,
143
- "display_name " : " Python 3 " ,
144
- "language " : " python "
161
+ "display_name " : " conda_python3 " ,
162
+ "language " : " python " ,
163
+ "name " : " conda_python3 "
145
164
},
146
165
"language_info" : {
147
166
"codemirror_mode" : {
153
172
"name" : " python" ,
154
173
"nbconvert_exporter" : " python" ,
155
174
"pygments_lexer" : " ipython3" ,
156
- "version" : " 3.7.4-final "
175
+ "version" : " 3.6.10 "
157
176
}
158
177
},
159
178
"nbformat" : 4 ,
160
179
"nbformat_minor" : 4
161
- }
180
+ }
0 commit comments