Skip to content

Commit e5d31be

Browse files
committed
Add required import
1 parent 7fde864 commit e5d31be

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

week1/lemmatization_demo.ipynb

+42-14
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@
1010
{
1111
"cell_type": "code",
1212
"execution_count": 1,
13+
"metadata": {},
14+
"outputs": [
15+
{
16+
"name": "stdout",
17+
"output_type": "stream",
18+
"text": [
19+
"[nltk_data] Downloading package wordnet to /Users/anton/nltk_data...\n",
20+
"[nltk_data] Package wordnet is already up-to-date!\n"
21+
]
22+
},
23+
{
24+
"data": {
25+
"text/plain": [
26+
"True"
27+
]
28+
},
29+
"execution_count": 1,
30+
"metadata": {},
31+
"output_type": "execute_result"
32+
}
33+
],
34+
"source": [
35+
"import nltk\n",
36+
"nltk.download('wordnet')"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": 2,
1342
"metadata": {
1443
"ExecuteTime": {
1544
"end_time": "2017-11-05T18:16:27.608310Z",
@@ -18,13 +47,12 @@
1847
},
1948
"outputs": [],
2049
"source": [
21-
"import nltk\n",
2250
"text = \"This is Andrew's text, isn't it?\""
2351
]
2452
},
2553
{
2654
"cell_type": "code",
27-
"execution_count": 2,
55+
"execution_count": 3,
2856
"metadata": {
2957
"ExecuteTime": {
3058
"end_time": "2017-11-05T18:16:27.633134Z",
@@ -38,7 +66,7 @@
3866
"['This', 'is', \"Andrew's\", 'text,', \"isn't\", 'it?']"
3967
]
4068
},
41-
"execution_count": 2,
69+
"execution_count": 3,
4270
"metadata": {},
4371
"output_type": "execute_result"
4472
}
@@ -50,7 +78,7 @@
5078
},
5179
{
5280
"cell_type": "code",
53-
"execution_count": 3,
81+
"execution_count": 4,
5482
"metadata": {
5583
"ExecuteTime": {
5684
"end_time": "2017-11-05T18:16:27.647746Z",
@@ -64,7 +92,7 @@
6492
"['This', 'is', 'Andrew', \"'s\", 'text', ',', 'is', \"n't\", 'it', '?']"
6593
]
6694
},
67-
"execution_count": 3,
95+
"execution_count": 4,
6896
"metadata": {},
6997
"output_type": "execute_result"
7098
}
@@ -76,7 +104,7 @@
76104
},
77105
{
78106
"cell_type": "code",
79-
"execution_count": 4,
107+
"execution_count": 5,
80108
"metadata": {
81109
"ExecuteTime": {
82110
"end_time": "2017-11-05T18:16:27.660827Z",
@@ -90,7 +118,7 @@
90118
"['This', 'is', 'Andrew', \"'\", 's', 'text', ',', 'isn', \"'\", 't', 'it', '?']"
91119
]
92120
},
93-
"execution_count": 4,
121+
"execution_count": 5,
94122
"metadata": {},
95123
"output_type": "execute_result"
96124
}
@@ -109,7 +137,7 @@
109137
},
110138
{
111139
"cell_type": "code",
112-
"execution_count": 5,
140+
"execution_count": 6,
113141
"metadata": {
114142
"ExecuteTime": {
115143
"end_time": "2017-11-05T18:16:27.674332Z",
@@ -118,15 +146,15 @@
118146
},
119147
"outputs": [],
120148
"source": [
121-
"import nltk\n",
149+
"\n",
122150
"text = \"feet wolves cats talked\"\n",
123151
"tokenizer = nltk.tokenize.TreebankWordTokenizer()\n",
124152
"tokens = tokenizer.tokenize(text)"
125153
]
126154
},
127155
{
128156
"cell_type": "code",
129-
"execution_count": 6,
157+
"execution_count": 7,
130158
"metadata": {
131159
"ExecuteTime": {
132160
"end_time": "2017-11-05T18:16:27.693761Z",
@@ -140,7 +168,7 @@
140168
"u'feet wolv cat talk'"
141169
]
142170
},
143-
"execution_count": 6,
171+
"execution_count": 7,
144172
"metadata": {},
145173
"output_type": "execute_result"
146174
}
@@ -152,7 +180,7 @@
152180
},
153181
{
154182
"cell_type": "code",
155-
"execution_count": 7,
183+
"execution_count": 8,
156184
"metadata": {
157185
"ExecuteTime": {
158186
"end_time": "2017-11-05T18:16:30.840117Z",
@@ -166,7 +194,7 @@
166194
"u'foot wolf cat talked'"
167195
]
168196
},
169-
"execution_count": 7,
197+
"execution_count": 8,
170198
"metadata": {},
171199
"output_type": "execute_result"
172200
}
@@ -193,7 +221,7 @@
193221
"name": "python",
194222
"nbconvert_exporter": "python",
195223
"pygments_lexer": "ipython2",
196-
"version": "2.7.14"
224+
"version": "2.7.15"
197225
}
198226
},
199227
"nbformat": 4,

0 commit comments

Comments
 (0)