diff --git a/content/text_analysis.ipynb b/content/text_analysis.ipynb index 09185d8..c541c08 100644 --- a/content/text_analysis.ipynb +++ b/content/text_analysis.ipynb @@ -28,23 +28,28 @@ }, { "cell_type": "code", - "source": "import nltk\nimport pyodide_http\npyodide_http.patch_all()\nimport matplotlib\n%matplotlib inline", + "source": "import nltk\nimport pyodide_http\npyodide_http.patch_all()\nimport matplotlib\n%matplotlib inline\n%pip install tk\nimport tk", "metadata": { "trusted": true }, - "execution_count": 1, + "execution_count": 13, "outputs": [] }, { "cell_type": "code", - "source": "# nltk.download('all-corpora') this is overkill! \nnltk.download (\n 'genesis',\n 'gutenberg',\n 'inaugural',\n 'nps_chat',\n 'treebank',\n 'webtext',\n 'wordnet',\n)", + "source": "# nltk.download('all-corpora') this is overkill! \nnltk.download('genesis')\nnltk.download('gutenberg')\nnltk.download('inaugural')\nnltk.download('nps_chat')\nnltk.download('treebank')\nnltk.download('webtext')\nnltk.download('wordnet')", "metadata": { "trusted": true }, - "execution_count": 15, + "execution_count": 6, "outputs": [ { - "execution_count": 15, + "name": "stderr", + "text": "[nltk_data] Downloading package genesis to /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/genesis.zip.\n[nltk_data] Downloading package gutenberg to\n[nltk_data] /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/gutenberg.zip.\n[nltk_data] Downloading package inaugural to\n[nltk_data] /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/inaugural.zip.\n[nltk_data] Downloading package nps_chat to /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/nps_chat.zip.\n[nltk_data] Downloading package treebank to /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/treebank.zip.\n[nltk_data] Downloading package webtext to /home/pyodide/nltk_data...\n[nltk_data] Unzipping corpora/webtext.zip.\n[nltk_data] Downloading package wordnet to /home/pyodide/nltk_data...\n", + "output_type": "stream" + }, + { + "execution_count": 6, "output_type": "execute_result", "data": { "text/plain": "True" @@ -59,7 +64,7 @@ "metadata": { "trusted": true }, - "execution_count": 9, + "execution_count": 7, "outputs": [ { "name": "stdout", @@ -79,7 +84,7 @@ "metadata": { "trusted": true }, - "execution_count": 10, + "execution_count": 8, "outputs": [ { "name": "stdout", @@ -140,13 +145,8 @@ "metadata": { "trusted": true }, - "execution_count": 12, + "execution_count": 14, "outputs": [ - { - "name": "stderr", - "text": "/lib/python3.11/site-packages/nltk/draw/__init__.py:15: UserWarning: nltk.draw package not loaded (please install Tkinter library).\n warnings.warn(\"nltk.draw package not loaded (please install Tkinter library).\")\n", - "output_type": "stream" - }, { "output_type": "display_data", "data": { @@ -163,7 +163,7 @@ "metadata": { "trusted": true }, - "execution_count": 13, + "execution_count": 15, "outputs": [ { "output_type": "display_data",