|
10 | 10 | {
|
11 | 11 | "cell_type": "code",
|
12 | 12 | "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, |
13 | 42 | "metadata": {
|
14 | 43 | "ExecuteTime": {
|
15 | 44 | "end_time": "2017-11-05T18:16:27.608310Z",
|
|
18 | 47 | },
|
19 | 48 | "outputs": [],
|
20 | 49 | "source": [
|
21 |
| - "import nltk\n", |
22 | 50 | "text = \"This is Andrew's text, isn't it?\""
|
23 | 51 | ]
|
24 | 52 | },
|
25 | 53 | {
|
26 | 54 | "cell_type": "code",
|
27 |
| - "execution_count": 2, |
| 55 | + "execution_count": 3, |
28 | 56 | "metadata": {
|
29 | 57 | "ExecuteTime": {
|
30 | 58 | "end_time": "2017-11-05T18:16:27.633134Z",
|
|
38 | 66 | "['This', 'is', \"Andrew's\", 'text,', \"isn't\", 'it?']"
|
39 | 67 | ]
|
40 | 68 | },
|
41 |
| - "execution_count": 2, |
| 69 | + "execution_count": 3, |
42 | 70 | "metadata": {},
|
43 | 71 | "output_type": "execute_result"
|
44 | 72 | }
|
|
50 | 78 | },
|
51 | 79 | {
|
52 | 80 | "cell_type": "code",
|
53 |
| - "execution_count": 3, |
| 81 | + "execution_count": 4, |
54 | 82 | "metadata": {
|
55 | 83 | "ExecuteTime": {
|
56 | 84 | "end_time": "2017-11-05T18:16:27.647746Z",
|
|
64 | 92 | "['This', 'is', 'Andrew', \"'s\", 'text', ',', 'is', \"n't\", 'it', '?']"
|
65 | 93 | ]
|
66 | 94 | },
|
67 |
| - "execution_count": 3, |
| 95 | + "execution_count": 4, |
68 | 96 | "metadata": {},
|
69 | 97 | "output_type": "execute_result"
|
70 | 98 | }
|
|
76 | 104 | },
|
77 | 105 | {
|
78 | 106 | "cell_type": "code",
|
79 |
| - "execution_count": 4, |
| 107 | + "execution_count": 5, |
80 | 108 | "metadata": {
|
81 | 109 | "ExecuteTime": {
|
82 | 110 | "end_time": "2017-11-05T18:16:27.660827Z",
|
|
90 | 118 | "['This', 'is', 'Andrew', \"'\", 's', 'text', ',', 'isn', \"'\", 't', 'it', '?']"
|
91 | 119 | ]
|
92 | 120 | },
|
93 |
| - "execution_count": 4, |
| 121 | + "execution_count": 5, |
94 | 122 | "metadata": {},
|
95 | 123 | "output_type": "execute_result"
|
96 | 124 | }
|
|
109 | 137 | },
|
110 | 138 | {
|
111 | 139 | "cell_type": "code",
|
112 |
| - "execution_count": 5, |
| 140 | + "execution_count": 6, |
113 | 141 | "metadata": {
|
114 | 142 | "ExecuteTime": {
|
115 | 143 | "end_time": "2017-11-05T18:16:27.674332Z",
|
|
118 | 146 | },
|
119 | 147 | "outputs": [],
|
120 | 148 | "source": [
|
121 |
| - "import nltk\n", |
| 149 | + "\n", |
122 | 150 | "text = \"feet wolves cats talked\"\n",
|
123 | 151 | "tokenizer = nltk.tokenize.TreebankWordTokenizer()\n",
|
124 | 152 | "tokens = tokenizer.tokenize(text)"
|
125 | 153 | ]
|
126 | 154 | },
|
127 | 155 | {
|
128 | 156 | "cell_type": "code",
|
129 |
| - "execution_count": 6, |
| 157 | + "execution_count": 7, |
130 | 158 | "metadata": {
|
131 | 159 | "ExecuteTime": {
|
132 | 160 | "end_time": "2017-11-05T18:16:27.693761Z",
|
|
140 | 168 | "u'feet wolv cat talk'"
|
141 | 169 | ]
|
142 | 170 | },
|
143 |
| - "execution_count": 6, |
| 171 | + "execution_count": 7, |
144 | 172 | "metadata": {},
|
145 | 173 | "output_type": "execute_result"
|
146 | 174 | }
|
|
152 | 180 | },
|
153 | 181 | {
|
154 | 182 | "cell_type": "code",
|
155 |
| - "execution_count": 7, |
| 183 | + "execution_count": 8, |
156 | 184 | "metadata": {
|
157 | 185 | "ExecuteTime": {
|
158 | 186 | "end_time": "2017-11-05T18:16:30.840117Z",
|
|
166 | 194 | "u'foot wolf cat talked'"
|
167 | 195 | ]
|
168 | 196 | },
|
169 |
| - "execution_count": 7, |
| 197 | + "execution_count": 8, |
170 | 198 | "metadata": {},
|
171 | 199 | "output_type": "execute_result"
|
172 | 200 | }
|
|
193 | 221 | "name": "python",
|
194 | 222 | "nbconvert_exporter": "python",
|
195 | 223 | "pygments_lexer": "ipython2",
|
196 |
| - "version": "2.7.14" |
| 224 | + "version": "2.7.15" |
197 | 225 | }
|
198 | 226 | },
|
199 | 227 | "nbformat": 4,
|
|
0 commit comments