UofG grad course CIS-6190 Assignment 2
Test Environment: Python 3.7.2 linux.socs.uoguelph.ca
-
python preprocessor.py --Input YourInputFile --Output YourOutputFileThe input is set to documents_small.tokenized, and the output is set to documents_small.processes in default. The program should print out the progress every 5,000 lines of documents.
The goal is to perform 4 processing tasks:
- Normalization: convert all token values into lower cases.
- Further Filtering: remove numbers and punctuation marks.
- Stop Word Removal: remove all stop words in English (such as "the", "a", "of").
- Stemming: convert the remaining words to their stems.
The test cases are added at the top of documents_small.tokenized file. Such as "ComPuting" or "cOMPuter". Please check the file for full details.
-
python indexer.py --Input YourInputFile --Dictionary YourOutputDictionaryFile --Postings YourOutputPostingsFile --Docids YourOutputDocidsFileThe input is set to documents_small.preprocessed, and the output is set to dictionary.txt, postings.txt, docids.txt in default.
The goal is to take the preprocessed file as input and produce an inverted index with three outputfiles: dictionary.txt, postings.txt and docids.txt.
- dictionary.txt: <stem> <document-frequency>
- postings.txt: <did> <tf>
- docids.txt <docid> <title> <start-line-number>
-
python retriever.py --Dictionary YourInputDictionaryFile --Postings YourInputPostingsFile --Docids YourInputDocidsFileThe input is set to dictionary.txt, postings.txt, docids.txt in default.
The goal of this program is to load the inverted files from the offline processing into memory and then ask for user's query iteratively. Then search for the top-10 relative documents based on tf.idf and inner products.