public TfIdfCalculator(Map<Indexed<Product>, Integer> bags) {
        docs = Maps.newHashMap(bags);
        for (Indexed<Product> bag : docs.keySet()) {
            for (Tag word : bag.getWords()) {
                int count = !docCount.containsKey(word) ? 0 : docCount.get(word);
                docCount.put(word, count + 1);
            }
        }
    }