From e5d31be9d6b1ebc912bfee8a1b46d060e9ba70b3 Mon Sep 17 00:00:00 2001 From: Anton Belyy Date: Thu, 6 Dec 2018 02:10:53 +0300 Subject: [PATCH] Add required import --- week1/lemmatization_demo.ipynb | 56 +++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/week1/lemmatization_demo.ipynb b/week1/lemmatization_demo.ipynb index 9ba86d59..cac96b78 100644 --- a/week1/lemmatization_demo.ipynb +++ b/week1/lemmatization_demo.ipynb @@ -10,6 +10,35 @@ { "cell_type": "code", "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[nltk_data] Downloading package wordnet to /Users/anton/nltk_data...\n", + "[nltk_data] Package wordnet is already up-to-date!\n" + ] + }, + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import nltk\n", + "nltk.download('wordnet')" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.608310Z", @@ -18,13 +47,12 @@ }, "outputs": [], "source": [ - "import nltk\n", "text = \"This is Andrew's text, isn't it?\"" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.633134Z", @@ -38,7 +66,7 @@ "['This', 'is', \"Andrew's\", 'text,', \"isn't\", 'it?']" ] }, - "execution_count": 2, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -50,7 +78,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.647746Z", @@ -64,7 +92,7 @@ "['This', 'is', 'Andrew', \"'s\", 'text', ',', 'is', \"n't\", 'it', '?']" ] }, - "execution_count": 3, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -76,7 +104,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.660827Z", @@ -90,7 +118,7 @@ "['This', 'is', 'Andrew', \"'\", 's', 'text', ',', 'isn', \"'\", 't', 'it', '?']" ] }, - "execution_count": 4, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -109,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.674332Z", @@ -118,7 +146,7 @@ }, "outputs": [], "source": [ - "import nltk\n", + "\n", "text = \"feet wolves cats talked\"\n", "tokenizer = nltk.tokenize.TreebankWordTokenizer()\n", "tokens = tokenizer.tokenize(text)" @@ -126,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:27.693761Z", @@ -140,7 +168,7 @@ "u'feet wolv cat talk'" ] }, - "execution_count": 6, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -152,7 +180,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2017-11-05T18:16:30.840117Z", @@ -166,7 +194,7 @@ "u'foot wolf cat talked'" ] }, - "execution_count": 7, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -193,7 +221,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", - "version": "2.7.14" + "version": "2.7.15" } }, "nbformat": 4,