public HashedDataInstance(String line, boolean hasLabel, int dim,
			boolean personal) {
		String[] fields = line.split("\\|");
		int offset = 0;
		if (hasLabel) {
			clicked = Integer.valueOf(fields[0]);
			offset = 1;
		} else {
			clicked = -1;
		}
		depth = Integer.valueOf(fields[offset + 0]);
		position = Integer.valueOf(fields[offset + 1]);
		userid = Integer.valueOf(fields[offset + 2]);
		gender = Integer.valueOf(fields[offset + 3]);
		if (gender != 0) {
		    gender = (int)((gender - 1.5) * 2.0); // map gender from {1,2} to {-1, 1}
		}
		age = Integer.valueOf(fields[offset + 4]);
		hashedTextFeature = new HashMap<Integer, Integer>(); 
		
		String[] tokens = fields[offset+5].split(",");

		/**
		 * Fill in your code here to create a hashedTextFeature.
		 */
		
		
		for (int i = 0; i < tokens.length; i++) {
            updateFeature(tokens[i], dim);
        }   
		
		if (personal) {
			/**
			 * Extra credit Fill in your code here to for create a hashedFeature
			 * with personalization.
			 */

		    for (int i = 0; i < tokens.length; i++) {
		        updateFeature(tokens[i] + ":user" + userid, dim);
		    }
		    
		} 
	}