class_docstr: Text Processor class implement NER, POS tag, lexical tree parsing.
  EnProcessor is designed by single instance mode.
docstr: Get antonyms from WordNet.
  
  This method uses NTLK WordNet to generate antonyms, and uses "lesk"
  algorithm which is proposed by Michael E. Lesk in 1986, to screen
  the sense out.
  
  
  :param list tokens_and_pos: A list of tuples, *(token, POS)*.
  :param str lang: language name.
  :return: A list of str, represents the sense of each input token.
docstr_tok: ["Get","antonyms","from","WordNet",".","This","method","uses","NTLK","WordNet","to","generate","antonyms",",","and","uses","``","lesk","''","algorithm","which","is","proposed","by","Michael","E.","Lesk","in","1986",",","to","screen","the","sense","out",".",":","param","list","tokens_and_pos",":","A","list","of","tuples",",","*","(","token",",","POS",")","*",".",":","param","str","lang",":","language","name",".",":","return",":","A","list","of","str",",","represents","the","sense","of","each","input","token","."]
code: def get_antonyms(self, tokens_and_pos, lang="eng"):
      r"""
      Get antonyms from WordNet.
  
      This method uses NTLK WordNet to generate antonyms, and uses "lesk"
      algorithm which is proposed by Michael E. Lesk in 1986, to screen
      the sense out.
  
  
      :param list tokens_and_pos: A list of tuples, *(token, POS)*.
      :param str lang: language name.
      :return: A list of str, represents the sense of each input token.
  
      """
      if self.__wordnet is None:
          self.__wordnet = self.model_manager.load(NLTK_WORDNET)
  
      if isinstance(tokens_and_pos, str):
          tokens_and_pos = self.get_pos(tokens_and_pos)
  
      def lesk(sentence, word, pos):
          synsets = self.__wordnet.synsets(word, lang=lang)
          antonyms = set()
  
          for synonym in synsets:
              for l in synonym.lemmas():
                  if l.antonyms():
                      antonyms.add(l.antonyms()[0].synset())
  
          if pos is not None:
              antonyms = [ss for ss in antonyms if str(ss.pos()) == pos]
  
          return antonyms
  
      sentoken = []
      sentence = []
      # normalize pos tag
      for word, pos in tokens_and_pos:
          sentoken.append(word)
          sentence.append((word, self.normalize_pos(pos)))
      ret = []
  
      for word, pos in sentence:
          ret.append(lesk(sentoken, word, pos))
      return ret
  
imports: import re
  import nltk
  import spacy
  import threading
  from functools import reduce
  from spacy.tokens import Doc
  from .nltk_res_load import *
  from ..settings import *
label_desc: Use image node_id 18 for calling the EnProcessor obj's underlying member method code with example usage: obj.get_antonyms(tokens_and_pos, lang) and returns: ret, antonyms