code: func (pt *PerceptronTagger) Train(sentences TupleSlice, iterations int) {
  	var guess string
  	var found bool
  
  	pt.makeTagMap(sentences)
  	for i := 0; i < iterations; i++ {
  		for _, tuple := range sentences {
  			words, tags := tuple[0], tuple[1]
  			p1, p2 := "-START-", "-START2-"
  			context := []string{p1, p2}
  			for _, w := range words {
  				if w == "" {
  					continue
  				}
  				context = append(context, normalize(w))
  			}
  			context = append(context, []string{"-END-", "-END2-"}...)
  			for i, word := range words {
  				if guess, found = pt.tagMap[word]; !found {
  					feats := featurize(i, context, word, p1, p2)
  					guess = pt.model.predict(feats)
  					pt.model.update(tags[i], guess, feats)
  				}
  				p2 = p1
  				p1 = guess
  			}
  		}
  		shuffle.Shuffle(sentences)
  	}
  	pt.model.averageWeights()
  }
docs: // Train an Averaged Perceptron model based on sentences.