def annotate(self, sent):
    """Annotate a squence of words with entity tags.

    Args:
      sent: sequence of strings/words.
    """
    preds = []
    words = []
    for word, fv in self.sent2examples(sent):
      probs = self.predictor(fv)
      tags = probs.argsort()
      tag = self.ID_TAG[tags[-1]]

      words.append(word)
      preds.append(tag)

    # fix_chunks(preds)
    annotations = zip(words, preds)
    return annotations
def annotate ( self , sent ) : preds = [ ] words = [ ] for word , fv in self . sent2examples ( sent ) : probs = self . predictor ( fv ) tags = probs . argsort ( ) tag = self . ID_TAG [ tags [ - 1 ] ] words . append ( word ) preds . append ( tag ) annotations = zip ( words , preds ) return annotations
Annotate a squence of words with entity tags.

    Args:
      sent: sequence of strings/words.