class_docstr: An class that supply methods for ABSA task data transformation.
docstr: Get the index of words in sentence.
  
  :param str text: input text
  :param bool lower: whether text is lowercase or not
  :return dict: index of words
docstr_tok: ["Get","the","index","of","words","in","sentence",".",":","param","str","text",":","input","text",":","param","bool","lower",":","whether","text","is","lowercase","or","not",":","return","dict",":","index","of","words"]
code: def get_word2id(text, lower=True):
      r"""
      Get the index of words in sentence.
  
      :param str text: input text
      :param bool lower: whether text is lowercase or not
      :return dict: index of words
      """
      word2idx = {}
      idx = 1
      if lower:
          text = text.lower()
      words = text.split()
      for word in words:
          if word not in word2idx:
              word2idx[word] = idx
              idx += 1
  
      return word2idx
  
imports: import random
  from abc import ABC
  from copy import deepcopy
  from ..transformation import Transformation
  from ....common.settings import NEGATIVE_WORDS_LIST, DEGREE_WORD_LIST
label_desc: Use image node_id 6 for calling the ABSATransformation obj's underlying member method code with example usage: obj.get_word2id(text, lower) and returns: word2idx