A script to calculate bag of words (occurrences of words) from vocabulary