class_docstr: Tagger base class that defines the interface. 
class_docstr_tok: ["Tagger","base","class","that","defines","the","interface","."]
code: def ngrams(sequence, n, transfer=None):
      ngrams_ = []
      part1 = (n - 1) * [TaggerBase.PAD] + [TaggerBase.START]
      if transfer is not None:
          part2 = [transfer(_) for _ in sequence]
      else:
          part2 = sequence
      part3 = [TaggerBase.END] + (n - 1) * [TaggerBase.PAD]
      seq = part1 + part2 + part3
      for i in range(n, n + len(sequence)):
          yield seq[i - n : i + n + 1]
  
imports: import numpy
  from six.moves import range
  from ..decorators import memoize
  from ..load import load_embeddings, load_ner_model, load_pos_model, load_unified_pos_model
label_desc: Use image node_id 2 for calling the TaggerBase obj's underlying member method code with example usage: obj.ngrams(sequence, n, transfer) without return types