class_docstr: TextSet wraps a set of texts with status.
class_docstr_tok: ["TextSet","wraps","a","set","of","texts","with","status","."]
docstr: Assign a word_index dictionary for this TextSet to use during word2idx.
  If you load the word_index from the saved file, you are recommended to use `load_word_index`
  directly.
  
  :return: TextSet with the word_index set.
docstr_tok: ["Assign","a","word_index","dictionary","for","this","TextSet","to","use","during","word2idx",".","If","you","load","the","word_index","from","the","saved","file",",","you","are","recommended","to","use","`","load_word_index","`","directly",".",":","return",":","TextSet","with","the","word_index","set","."]
code: def set_word_index(self, vocab):
      """
      Assign a word_index dictionary for this TextSet to use during word2idx.
      If you load the word_index from the saved file, you are recommended to use `load_word_index`
      directly.
  
      :return: TextSet with the word_index set.
      """
      jvalue = callZooFunc(
          self.bigdl_type, "textSetSetWordIndex", self.value, vocab
      )
      return TextSet(jvalue=jvalue)
  
imports: import six
  from bigdl.util.common import JavaValue
  from zoo.common.utils import callZooFunc
  from pyspark import RDD
label_desc: Use image node_id 9 for calling the TextSet obj's underlying member method code with example usage: obj.set_word_index(vocab) and returns: TextSet