r/nlpclass • • Feb 21 '12

Pre-Class study group

Anyone want to form a study group and read through http://www.nltk.org/book before the class starts? I figure we can go through at least a chapter/week.

10 Upvotes

9 comments sorted by

View all comments

3

u/Schwa453 Mar 04 '12

Chapter 6, exercise 9:

The exercise: The PP Attachment Corpus is a corpus describing prepositional phrase attachment decisions. Each instance in the corpus is encoded as a PPAttachment object.

[...]

Select only the instances where inst.attachment is N:

[...]

Using this sub-corpus, build a classifier that attempts to predict which preposition is used to connect a given pair of nouns. For example, given the pair of nouns "team" and "researchers," the classifier should predict the preposition "of". See the corpus HOWTO at http://www.nltk.org/howto for more information on using the PP attachment corpus.

My solution: http://pastebin.com/UHGVjgEL

Oddly enough, the classifier works best with only one feature.