int prevPercentDone = 1;
for (Map.Entry<String, List<Integer>> itemFeature : itemFeaturesMap.entrySet()) {
int numfeatures = itemFeature.getValue().size();
itemWritable.set(itemFeature.getKey());
Vector featureVector = new SequentialAccessSparseVector(numfeatures);
int i = 0;
for (Integer feature : itemFeature.getValue()) {
featureVector.setQuick(i++, feature);
}
featuresWritable.set(featureVector);
writer.append(itemWritable, featuresWritable);
// Update the progress
double percentDone = ++doneRecords * 100.0 / totalRecords;