code: def predict(self, X, lengths=None):
          
          X = atleast2d_or_csr(X)
          scores = safe_sparse_dot(X, self.coef_.T)
          if hasattr(self, "coef_trans_"):
              n_classes = len(self.classes_)
              coef_t = self.coef_trans_.T.reshape(-1, self.coef_trans_.shape[-1])
              trans_scores = safe_sparse_dot(X, coef_t.T)
              trans_scores = trans_scores.reshape(-1, n_classes, n_classes)
          else:
              trans_scores = None
  
          decode = self._get_decoder()
  
          if lengths is None:
              y = decode(scores, trans_scores, self.intercept_trans_,
                         self.intercept_init_, self.intercept_final_)
          else:
              start, end = validate_lengths(X.shape[0], lengths)
  
              y = [decode(scores[start[i]:end[i]], trans_scores,
                          self.intercept_trans_, self.intercept_init_,
                          self.intercept_final_)
                   for i in six.moves.xrange(len(lengths))]
              y = np.hstack(y)
  
          return self.classes_[y]
docs: Predict labels/tags for samples X.
  
          Parameters
          ----------
          X : {array-like, sparse matrix}, shape (n_samples, n_features)
              Feature matrix.
  
          lengths : array-like of integer, shape (n_sequences,), optional
              Lengths of sequences in X. If not given, X is assumed to be a
              single sequence of length n_samples.
  
          Returns
          -------
          y : array, shape (n_samples,)
              Labels per sample in X.