class_docstr: An class that supply methods for ABSA task data transformation.
docstr: Refine the candidate opinion words.
  
  :param list trans_words: tokenized words of transformed sentence
  :param int opi_from: start position of opinion words
  :param int opi_to: end position of opinion words
  :param set candidate_list: candidate antonyms word list
  :return list: refined candidate word list
docstr_tok: ["Refine","the","candidate","opinion","words",".",":","param","list","trans_words",":","tokenized","words","of","transformed","sentence",":","param","int","opi_from",":","start","position","of","opinion","words",":","param","int","opi_to",":","end","position","of","opinion","words",":","param","set","candidate_list",":","candidate","antonyms","word","list",":","return","list",":","refined","candidate","word","list"]
code: def refine_candidate(
      self, trans_words, opi_from, opi_to, candidate_list
  ):
      r"""
      Refine the candidate opinion words.
  
      :param list trans_words: tokenized words of transformed sentence
      :param int opi_from: start position of opinion words
      :param int opi_to: end position of opinion words
      :param set candidate_list: candidate antonyms word list
      :return list: refined candidate word list
      """
      if len(trans_words) == 0:
          return []
      postag_list = self.get_postag(trans_words, 0, -1)
      postag_list = [t[1] for t in postag_list]
      refined_candi = self.get_candidate(
          candidate_list, trans_words, postag_list, opi_from, opi_to
      )
  
      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 5 for calling the ABSATransformation obj's underlying member method code with example usage: obj.refine_candidate(trans_words, opi_from, opi_to, candidate_list) and returns: refined_candi, list