

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


605.744 Information Retrieval Spring 2011 – Paul McNamee
As soon as you can, please send me an email identifying yourself and telling me which email address you would like class-related mailings sent to. Any account is fine, but it should be one you can check regularly.
Zipf’s law (cf. Section 5.1 in the text) predicts that the number of times the ith most frequent word will be seen is about k/i times the frequency of the most common word, for some k. You can verify whether this is so by examining a collection of text and counting the number of occurrences for each word. For this assignment, two electronic texts have been placed on the course web page: the Bible (American Standard Version) and Jane Austen's Sense and Sensibility. Download these files, and write a program (or programs) to run on the texts individually (i.e., run separately on each text). The program should: o Performs some normalization of the text. For example, removing punctuation and lower-casing words. o Report the number of ‘paragraphs’ processed, the number of unique words observed, and the total number of words encountered. Be sure to describe how you determine what constitutes a word. For example, you should indicate if you ignore case-differences and how you treat punctuation symbols and digits. o Keep track of both the total number of times each word is seen and the number of documents (paragraphs = documents) which the word occurs in. o Identify the 30 most frequent words (by total count) and report the number of times each occurs (both in total and expressed as the number of documents it appears in). o Also print the 100th, 500th, and 1000th^ most-frequent words and their frequencies of occurrence. (But please do not turn in a printout with the top 1000.) o Compute and prints the number of words that occur in exactly one document. (For Sense , I believe surplice and simpering are such words.) What percentage of the dictionary terms occur in just one document? You can (and should) build the required lexicon in one scan of the input text. After sorting terms by total frequency it should be fairly easy to extract the pieces of information that I am asking you to report. In the files paragraphs are indicated with
tags indicating the start of each new paragraph. Some 'paragraphs' are short, some are longer; I think that none are empty, but I haven't verified this. Lexicons are a key data structure for IR systems. In future assignments you will need a lexicon, so you might consider how to make your dictionary modular and reusable. In particular you will want it to fit in memory, to be storable on disk for subsequent reloading, and to enable efficient lookups. Some representations you might consider are in-memory hashtables, binary trees, or tries. If you use Java, using the built-in HashMap or a TreeMap classes is a very reasonable idea. Hand in your source code and the requested output described above. The Bible text was obtained from http://unbound.biola.edu/; versions in numerous languages are available. Austen's novel was obtained from Project Gutenberg: http://www.gutenberg.org/. I attempted to process an English version of the Koran (several are available from PG); however, I found it difficult to automatically segment verses from those texts, so I gave up. The Biblical text is just a bit under 5MB in size; Sense and Sensibility is about 1/7th of the size. I have coded a solution to the exercise above in ~ 240 lines of (verbose, commented) Java code and I have had former students write good solutions in about 2 pages of (good) Perl.
[1] Problem 1.7 (pg. 13) [2] Problem 1.9 (pg. 13) [note: consider ‘optimal’ to mean it is not possible to respond to a query with less processing effort] [3] Problem 2.5 (pg. 35)
605.744 Information Retrieval Spring 2011 – Paul McNamee
Tag clouds. Use the results from your program to create a pretty or interesting tag cloud. For example, the cloud below was created using Wordle (TM) by supplying weights from the Sense text. I removed 30 or so 'stopwords' (clearly not quite enough for the best tag-cloud generation) and used total count as 'weights'. I used the tool at: http://www.wordle.net/advanced (you may use this tool, or another). I pasted the top 50 remaining words from my program which looked like this (to accomodate Wordle's weight format): her: she: elinor: mrs: which: Your results may look different, depending on if you remove stopwords, how you define what is a word, how many words you use, any options used by the tool you use, etc...