private void loadParametersFromJackson(JsonParser jp,
			CorefColumnDataset dataset) throws JsonParseException, IOException,
			DatasetException {
		if (jp.nextToken() != JsonToken.START_ARRAY)
			throw new DatasetException("Error parsing parameters");
		MapEncoding<Feature> explicitEncoding = dataset
				.getExplicitFeatureEncoding();
		FeatureEncoding<String> basicEncoding = dataset.getFeatureEncoding();
		while (jp.nextToken() != JsonToken.END_ARRAY) {
			// Skip start array token for this parameter.
			// Each parameter follows the format: [ idxTpl, [vals], weight ]
			if (jp.nextToken() != JsonToken.VALUE_NUMBER_INT)
				throw new DatasetException("Error parsing parameters");
			// Template index.
			int idxTpl = jp.getIntValue();
			// Skip start array token for the feature values.
			if (jp.nextToken() != JsonToken.START_ARRAY)
				throw new DatasetException(
						"Error parsing parameter feature values");
			// List of values.
			LinkedList<Integer> valuesL = new LinkedList<Integer>();
			while (jp.nextToken() != JsonToken.END_ARRAY)
				valuesL.add(basicEncoding.put(jp.getText()));
			// Convert the list of values to an array.
			int[] values = new int[valuesL.size()];
			int idxVal = 0;
			for (int val : valuesL)
				values[idxVal++] = val;
			// Create a feature object and encode it.
			Feature ftr = new Feature(idxTpl, values);
			int code = explicitEncoding.put(ftr);
			// Put the new parameter weight in the parameters dictionary.
			if (jp.nextToken() != JsonToken.VALUE_NUMBER_FLOAT
					&& jp.getCurrentToken() != JsonToken.VALUE_NUMBER_INT)
				throw new DatasetException(
						"Error parsing parameter feature values");
			parameters.put(code, new AveragedParameter(jp.getDoubleValue()));
			// Skip the end array token.
			if (jp.nextToken() != JsonToken.END_ARRAY)
				throw new DatasetException("Error parsing parameters");
		}
	}