Calculating Word Frequency Tables

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 ...

Book Review: Natural Language Understanding

Although “Natural Language Understanding” by James Allen is an older book, it still contains some useful content presented in a readable form. Although more modern books take a more statistical approach, this book has good, clear presentations of formal grammar, logic, and conversation agent topics.

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 ...

Book Review: Word Sense Disambiguation

“Word Sense Disambiguation: The Case for Combinations of Knowledge Sources” by Mark Stevenson describes the author’s six year research project into Word Sense Disambiguation that started with his PhD in 1995. The book includes a summary literature review of previous attempts at Word Sense Disambiguation before building a framework that combines multiple models and filters ...

Part of Speech Tags 3

A frequently asked question is “What do the Part of Speech tags (VB, JJ, etc) mean?” The bottom line is that these tags mean whatever they meant in your original training data. You are free to invent your own tags in your training data, as long as you are consistent in their usage. Training data ...

Book Review: Python Text Processing with NLTK 2.0 Cookbook

“Python Text Processing with NLTK 2.0 Cookbook” by Jacob Perkins is a useful complement to “Natural Language Processing with Python”. Rather than trying to introduce Python, NLP, and NLTK in one book, it focuses on practical worked examples.

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 ...

The NLP Stack

Processing natural language is a complicated business. Not that long ago it seemed to be an intractable problem to many people. Although full understanding is still a cutting edge research problem, large areas of natural language processing have become practical on most computing platforms. This is especially true when NLP techniques are applied to restricted ...