docs: function(dataset) {
  
  		// calculate counts for equation (3):
  		var mapWordToTotalCount = {};
  		var totalNumberOfWordsInDataset = 0;
  		for (var i in dataset) {
  			var datum = dataset[i];
  			var totalPerDatum = 0;
  			
  			// for each input sentence, count the total number of words in it:
  			for (var word in datum) {
  				mapWordToTotalCount[word] |= 0;
  				mapWordToTotalCount[word] += datum[word];
  				totalPerDatum += datum[word];
  			}
  			datum["_total"] = totalPerDatum;
  			totalNumberOfWordsInDataset += totalPerDatum;
  		}
  		mapWordToTotalCount["_total"] = totalNumberOfWordsInDataset;
  		
  		this.dataset = dataset;
  		this.mapWordToTotalCount = mapWordToTotalCount;
  		
  		// calculate smoothing factor for equation (3):
  		var mapWordToSmoothingFactor = {};
  		for (var word in mapWordToTotalCount) {
  			mapWordToSmoothingFactor[word] = 
  				(1-this.smoothingCoefficient) * this.mapWordToTotalCount[word] / this.mapWordToTotalCount["_total"];
  		}
  		this.mapWordToSmoothingFactor = mapWordToSmoothingFactor;
  		
  		this.globalSmoothingFactor = (1/totalNumberOfWordsInDataset)  // a global smoother, for totally unseen words.
  	}