class_docstr: An class that supply methods for ABSA task data transformation.
docstr: Get the candidate opinion words from words_list.
  
  :param set candidate_list: candidate words
  :param list words_list: tokenized words of original sentence
  :param list postag_list: postag
  :param int opi_from: start index of opinion
  :param int opi_to: end index of opinion
  :return list: refined candidate words
docstr_tok: ["Get","the","candidate","opinion","words","from","words_list",".",":","param","set","candidate_list",":","candidate","words",":","param","list","words_list",":","tokenized","words","of","original","sentence",":","param","list","postag_list",":","postag",":","param","int","opi_from",":","start","index","of","opinion",":","param","int","opi_to",":","end","index","of","opinion",":","return","list",":","refined","candidate","words"]
code: def get_candidate(
      self, candidate_list, words_list, postag_list, opi_from, opi_to
  ):
      r"""
      Get the candidate opinion words from words_list.
  
      :param set candidate_list: candidate words
      :param list words_list: tokenized words of original sentence
      :param list postag_list: postag
      :param int opi_from: start index of opinion
      :param int opi_to: end index of opinion
      :return list: refined candidate words
      """
      refined_candi = []
  
      for candidate in candidate_list:
          opi = words_list[opi_from:opi_to][0]
          isupper = opi[0].isupper()
          allupper = opi.isupper()
          if allupper:
              candidate = candidate.upper()
          elif isupper:
              candidate = candidate[0].upper() + candidate[1:]
          if opi_from == 0:
              candidate = candidate[0].upper() + candidate[1:]
  
          new_words = (
              words_list[:opi_from] + [candidate] + words_list[opi_to:]
          )
          # check pos tag
          new_postag_list = self.get_postag(new_words, 0, -1)
          new_postag_list = [t[1] for t in new_postag_list]
  
          if (
              len(
                  [
                      i
                      for i, j in zip(
                          postag_list[opi_from:opi_to],
                          new_postag_list[opi_from:opi_to],
                      )
                      if i != j
                  ]
              )
              != 0
          ):
              continue
          refined_candi.append(candidate)
  
      return refined_candi
  
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 11 for calling the ABSATransformation obj's underlying member method code with example usage: obj.get_candidate(candidate_list, words_list, postag_list, opi_from, opi_to) and returns: refined_candi