{ "cells": [ { "cell_type": "code", "execution_count": 51, "id": "54edbe68", "metadata": { "collapsed": false }, "outputs": [], "source": [ "import nltk\n", "import urllib2\n", "import re" ] }, { "cell_type": "markdown", "id": "4e25d1be", "metadata": {}, "source": [ "# Automatic Tagging with NLTK" ] }, { "cell_type": "markdown", "id": "5196f354", "metadata": {}, "source": [ "Although the above results are neat, they aren't all that useful in practice\n", "because most texts we want to visualize in such ways aren't tagged, and tagging\n", "them by hand ist costly.\n", "\n", "What we need is an *automated tagger*." ] }, { "cell_type": "markdown", "id": "6770f788", "metadata": {}, "source": [ "Let's take a page off Wikipedia and tag it automatically." ] }, { "cell_type": "code", "execution_count": 52, "id": "dd9fe4bf", "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "u'\\n\\n\\nGeorge Washington - Wikipedia, the free encyclopedia\\n\\n\\n\\n\\n\\n