private double findCosSimBetween2Docs(int doc1, int doc2) {
        double dotProduct = 0;
        for(Entry elem: tf_Idf.entrySet()) {
            HashMap<Integer, Double> map = (HashMap<Integer, Double>)elem.getValue();
            if(map.containsKey(doc1) && map.containsKey(doc2)) {
                dotProduct += (double)map.get(doc1) * (double)map.get(doc2);
            }
        }
        return dotProduct/(vecLenght.get(doc1)*vecLenght.get(doc2));
    }