Skip to content

Commit 7fddbe0

Browse files
committed
new files
1 parent a45d2e6 commit 7fddbe0

File tree

2 files changed

+2097
-275
lines changed

2 files changed

+2097
-275
lines changed

label_tweet.ipynb

+40-21
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,31 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 3,
19+
"execution_count": 1,
2020
"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+
],
2231
"source": [
2332
"import pandas as pd\n",
2433
"import numpy as np\n",
2534
"\n",
2635
"import re\n",
27-
"#import nltk\n",
28-
"#nltk.download('vader_lexicon')\n",
36+
"import nltk\n",
37+
"nltk.download('vader_lexicon')\n",
2938
"from nltk.sentiment.vader import SentimentIntensityAnalyzer"
3039
]
3140
},
3241
{
3342
"cell_type": "code",
34-
"execution_count": 4,
43+
"execution_count": 2,
3544
"metadata": {},
3645
"outputs": [],
3746
"source": [
@@ -40,17 +49,20 @@
4049
},
4150
{
4251
"cell_type": "code",
43-
"execution_count": null,
52+
"execution_count": 4,
4453
"metadata": {},
4554
"outputs": [],
4655
"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",
4860
"df = pd.read_csv(data_location)"
4961
]
5062
},
5163
{
5264
"cell_type": "code",
53-
"execution_count": 6,
65+
"execution_count": 5,
5466
"metadata": {},
5567
"outputs": [],
5668
"source": [
@@ -85,7 +97,7 @@
8597
},
8698
{
8799
"cell_type": "code",
88-
"execution_count": 7,
100+
"execution_count": 6,
89101
"metadata": {},
90102
"outputs": [],
91103
"source": [
@@ -94,18 +106,18 @@
94106
},
95107
{
96108
"cell_type": "code",
97-
"execution_count": 8,
109+
"execution_count": 7,
98110
"metadata": {},
99111
"outputs": [
100112
{
101-
"output_type": "execute_result",
102113
"data": {
103114
"text/plain": [
104-
"<__main__.SentimentAnalysisTweets at 0x20e6cf84188>"
115+
"<__main__.SentimentAnalysisTweets at 0x7f89d4988860>"
105116
]
106117
},
118+
"execution_count": 7,
107119
"metadata": {},
108-
"execution_count": 8
120+
"output_type": "execute_result"
109121
}
110122
],
111123
"source": [
@@ -114,7 +126,7 @@
114126
},
115127
{
116128
"cell_type": "code",
117-
"execution_count": 14,
129+
"execution_count": 8,
118130
"metadata": {},
119131
"outputs": [],
120132
"source": [
@@ -125,23 +137,30 @@
125137
},
126138
{
127139
"cell_type": "code",
128-
"execution_count": null,
140+
"execution_count": 9,
129141
"metadata": {},
130142
"outputs": [],
131143
"source": [
132144
"# instantiate S3 client and upload to s3\n",
133145
"import boto3\n",
134146
"\n",
135147
"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')"
137149
]
150+
},
151+
{
152+
"cell_type": "code",
153+
"execution_count": null,
154+
"metadata": {},
155+
"outputs": [],
156+
"source": []
138157
}
139158
],
140159
"metadata": {
141160
"kernelspec": {
142-
"name": "python3",
143-
"display_name": "Python 3",
144-
"language": "python"
161+
"display_name": "conda_python3",
162+
"language": "python",
163+
"name": "conda_python3"
145164
},
146165
"language_info": {
147166
"codemirror_mode": {
@@ -153,9 +172,9 @@
153172
"name": "python",
154173
"nbconvert_exporter": "python",
155174
"pygments_lexer": "ipython3",
156-
"version": "3.7.4-final"
175+
"version": "3.6.10"
157176
}
158177
},
159178
"nbformat": 4,
160179
"nbformat_minor": 4
161-
}
180+
}

0 commit comments

Comments
 (0)