Inverse Document Frequency

The final goal to achieve here is: Given such an input file, output the
top 5 words in terms of IDF for each document