Calculating Word Statistics from the Gutenberg Corpus 1

Following on from the previous article about scanning text files for word statistics, I shall extend this to use real large corpora. First we shall use this script to create statistics for the entire Gutenberg English language corpus. Next I shall do the same with the entire English language Wikipedia.

Calculating Word Frequency Tables 2

Now that we can segment words and sentences, it is possible to produce word and tuple frequency tables. Here I show you how to create a word frequency table for a large collection of text files.

Segmenting Words and Sentences 1

Even simple NLP tasks such as tokenizing words and segmenting sentences can have their complexities. Punctuation characters could be used to segment sentences, but this requires the punctuation marks to be treated as separate tokens. This would result in abbreviations being split into separate words and sentences. This post uses a classification approach to create ...

Extracting Noun Phrases from Parsed Trees 6

Following on from my previous post about NLTK Trees, here is a short Python function to extract phrases from an NLTK Tree structure.

NLTK Trees

A number of NLTK functions work with Tree objects. For example, part of speech tagging and chunking classifiers, naturally return trees. Sentence manipulation functions also work with trees. Although Natural Language Processing with Python (Bird et al) includes a couple of pages about NLTK’s Tree module, coverage is generally sparse. The online documentation actually contains ...

Support for SciPy in NLTK’s Maximum Entropy methods

Recently I have been working with the Maximum Entropy classifiers in NLTK. Maximum entropy models are similar to the well known Naive Bayes models but they allow for independence between the features – i.e. they are not “naive”. SciPy has had some problems with its Maximum Entropy code, and v0.8 must be used. v0.9 crashes ...

Voting Machines in the Florida 2000 Election

This example uses Caliper® Maptitude® to analyze the Florida results of the 2000 US Presidential Election. During the 2000 Presidential Election, the results for Florida came under close scrutiny and argument, with the final result being decided by the courts. Amongst the accusations was the charge that a lot of people in the county of ...

Polar Maps and Projections: Part 2, Implementation 2

The first part of this article looked at different ways of producing polar maps and surveyed a number of different azimuthal projections that are often used for polar maps. In this second part, I produce a working implementation using UMN MapServer and OpenLayers.

Polar Maps and Projections: Part 1, Overview

With the success of my earlier series on global equal area map projections (starting with this overview), I received a number of requests to produce a similar how-to article for polar maps. The first part of this article (published here) provides an overview of a number of different map projections commonly used for polar maps. ...

How to create an online map with a non-Mercator Projection: Part 2

In the first part of this article we created a WMS server of basemaps using an unconventional map projection (the Mollweide projection). In this second part, we shall implement the client side of the project, creating a working application that will plot user data on the basemaps.