class_docstr: Transform indexedTokens and label (if any) of a TextFeature to a BigDL Sample.
  Need to word2idx first.
  
  >>> to_sample = TextFeatureToSample()
  creating: createTextFeatureToSample
code: def __init__(self, bigdl_type="float"):
      super(TextFeatureToSample, self).__init__(bigdl_type)
  
imports: import sys
  import six
  from bigdl.dllib.feature.common import Preprocessing
  from bigdl.dllib.feature.text import TextFeature
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 to create a new TextFeatureToSample object from inherited base classes: TextTransformer with example: obj = TextFeatureToSample(bigdl_type)