private Map<String, Cluster> readFile(String labelPath, String dataPath, String phase) {
		System.out.println("read the " + phase + " file ..... ");

		// read the label file
		System.out.println("Reading label from file " + phase + ".label ");
		List<String> classRecords = IOUtils.readFile(labelPath);
		documentClass = new HashMap<String, String>();
		documentListClass = new HashMap<String,ArrayList<String>>();

		for (int i = 0; i < classRecords.size(); i++) {
			String record = classRecords.get(i);
			documentClass.put((i + 1) + "", record);

			boolean contain = documentListClass.containsKey(record);
			if(!contain){
				documentListClass.put(record, new ArrayList<String>()) ;
			}
			documentListClass.get(record).add((i+1)+"");
		}

		// read the document
		System.out.println("Reading document from file " + phase + ".data ");
		List<String> dataRecords = IOUtils.readFile(dataPath);
		documentsCount = new HashMap<String, Document>();		

		for (String record : dataRecords) {
			String[] elements = record.split(" ");
			String documentID = elements[0];
			String wordID = elements[1];
			int wordCount = Integer.parseInt(elements[2]);

			boolean contain = documentsCount.containsKey(documentID);
			if (!contain) {
				documentsCount.put(documentID, new Document(documentID));
			}

			documentsCount.get(documentID).add(wordID, wordCount);
		}		

		// put the documents with the same cluster ID into the cluster
		System.out.println("put the documents with the same cluster ID into the cluster");
		Map<String, Cluster> clusters = new HashMap<String, Cluster>();
		for (String documentID : documentClass.keySet()) {
			String clusterID = documentClass.get(documentID);

			boolean contain = clusters.containsKey(clusterID);
			if (!contain) {
				clusters.put(clusterID, new Cluster(clusterID));
			}

			// put the document into cluster
			Document document = documentsCount.get(documentID);
			clusters.get(clusterID).addDocument(document);
		}

		// when in training phase, calculate the probability and frequence
		if (phase.equals("training")) {
			System.out.println("calculate the training probability");

			// generate the word count of cluster
			for (int index = 1; index <= 20; index++) {
				System.out.println("calculate the cluster "+ index);
				// fill the word count
				// clusters.get(clusterID).fillWordCounts();

				// calculate the bernoulli probability
				clusters.get(Integer.toString(index)).calculateBernoulliProbability();

			}

		}

		return clusters;
	}