anchor.diff:  ;; accepts a number of parameter vectors, and returns a function that
   ;; tags a sequence.
   (define joint-label-sequence-family (classifier1-parameters classifier2-parameters transition1-parameters transition2-parameters label-parameters)
  -  ;; sequence-model is a function that tags a sequence.
  -  (define sequence-model (feature-vector-seq) 
  +  ;; sequence-model is a function that tags a list of feature vectors
  +  ;; with a pair of labels for each input vector
  +  (define sequence-model (feature-vector-seq)
  +    ;; define both labels for the current input vector
       (let ((cur-label1 (amb label1-list))
             (cur-label2 (amb label2-list))
             (cur-input-features (car feature-vector-seq)))
  +      ;; Create factors connecting the current input feature vector
  +      ;; to each label.
         (make-featurized-classifier cur-label1 cur-input-features classifier1-parameters)
         (make-featurized-classifier cur-label2 cur-input-features classifier2-parameters)
  +      ;; Create a factor connecting the current pair of labels.
         (make-indicator-classifier (lifted-list cur-label1 cur-label2) label-parameters)
   
         (if (nil? (cdr feature-vector-seq))
  +          ;; This is the last input vector, so simply return the
  +          ;; labels in a list.
             (lifted-list (lifted-list cur-label1 cur-label2))
  +        ;; Need to recurse on the remaining inputs.
           (let ((remaining-labels (sequence-model (cdr feature-vector-seq)))
                 (next-labels (lifted-car remaining-labels))
                 (next-label1 (lifted-car next-labels))
                 (next-label2 (lifted-cadr next-labels)))
  -
  +          ;; Create factors for the label transitions for both
  +          ;; label sets.
             (make-indicator-classifier (lifted-list cur-label1 next-label1) transition1-parameters)
             (make-indicator-classifier (lifted-list cur-label2 next-label2) transition2-parameters)
  +          ;; Return the list of labels.
             (lifted-cons (lifted-list cur-label1 cur-label2) remaining-labels)))))
  +  ;; The family of sequence models returns the procedure for tagging
  +  ;; a sequence.
     sequence-model)
   
   (define inputs (list (list "the" "man")
  
positive.code:                      (list (list "JJ" "NN" "VB" "JJ") (list "B" "I" "O" "O"))
                       ))
  
  ;; TODO: Use nontrivial feature generation.
  (define generate-token-features (token-list) (map (lambda (token) (feature-func (list (list token 1.0)))) token-list))
  (define featurized-inputs (map (lambda (x) (list (generate-token-features x))) inputs))
  
  (define require-seq-equal (predicted actual)
    (if (nil? actual)
        #t
  
negative.code:   (make-indicator-classifier-parameters (list label2-list label2-list))
    (make-indicator-classifier-parameters (list label1-list label2-list))))
  
  ;; These parameters control the number of iterations of gradient descent, etc.
  ;; They're optional, and the last argument to opt can be omitted.
  (define optimization-params (list (list "epochs" 10) (list "l2-regularization" 1.0)))
  
  ;; Train the parameters (using stochastic gradient).
  (define best-parameters (opt joint-label-sequence-family initial-parameters training-data optimization-params))
  ;; Instantiate the model with the trained parameters.
  (define trained-sequence-model (apply joint-label-sequence-family best-parameters))
  
  ;; Print out some sample tags for stuff.
  (display "Best tags for the man:")
  (display (get-best-value (trained-sequence-model (generate-token-features (list "the" "man")))))
  (display "Best tags for the man eats fast food:")
  