class_docstr: A model API that tags input sentence.
  
  Attributes:
      model: Model.
      preprocessor: Transformer. Preprocessing data for feature extraction.
      tokenizer: Tokenize input sentence. Default tokenizer is `str.split`.
code: def _build_response(self, sent, tags, prob):
      words = self.tokenizer(sent)
      res = {"words": words, "entities": []}
      chunks = metrics.get_entities(tags)
  
      for chunk_type, chunk_start, chunk_end in chunks:
          chunk_end += 1
          entity = {
              "text": " ".join(words[chunk_start:chunk_end]),
              "type": chunk_type,
              "score": float(np.average(prob[chunk_start:chunk_end])),
              "beginOffset": chunk_start,
              "endOffset": chunk_end,
          }
          res["entities"].append(entity)
  
      return res
  
file_path: ktrain/ktrain/text/ner/anago/tagger.py
imports: from ....imports import *
  from ..None import metrics
label_desc: Use image node_id 5 for calling the Tagger obj's underlying member method code with example usage: obj._build_response(sent, tags, prob) and returns: res