class_docstr: Apply the jieba tokenizer to tokenize Chinese sentences.
  
  For more details, you may refer to [jieba](https://github.com/fxsjy/jieba)
class_docstr_tok: ["Apply","the","jieba","tokenizer","to","tokenize","Chinese","sentences",".","For","more","details",",","you","may","refer","to","[","jieba","]","(","https",":","\/\/github.com\/fxsjy\/jieba",")"]
code: def encode_with_offsets(self, sentences, output_type=str):
      is_multiple_sentences = isinstance(sentences, list)
      if not is_multiple_sentences:
          sentences = [sentences]
      all_tokens = [
          list(self._tokenizer.tokenize(sentence))
          for sentence in sentences
      ]
      offsests = [
          [(ele[1], ele[2]) for ele in tokens] for tokens in all_tokens
      ]
      if output_type is str:
          ret_tokens = [
              [ele[0] for ele in tokens] for tokens in all_tokens
          ]
      elif output_type is int:
          if self._vocab is None:
              raise TokenizerEncodeWithoutVocabError
          ret_tokens = [
              self._vocab[[ele[0] for ele in tokens]]
              for tokens in all_tokens
          ]
      else:
          raise TokenTypeNotSupportedError(output_type)
      if is_multiple_sentences:
          return ret_tokens, offsests
      else:
          return ret_tokens[0], offsests[0]
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/jieba.py
imports: from typing import Optional
  from .base import *
  from ..vocab import Vocab
  from ...utils.lazy_imports import try_import_jieba
label_desc: Use image node_id 3 for calling the JiebaTokenizer obj's underlying member method code with example usage: obj.encode_with_offsets(sentences, output_type) and returns: ret_tokens,  offsests, ret_tokens,  offsests