docstr: load terms and polarities from file
  
  Args:
      filename: feature table file full path
  
  Returns:
      terms: candidate terms
      polarities: opinion polarity per term
code: def load_terms_and_polarities(filename):
      """
      load terms and polarities from file
  
      Args:
          filename: feature table file full path
  
      Returns:
          terms: candidate terms
          polarities: opinion polarity per term
  
      """
      print("Loading training data from {} ...".format(filename))
  
      table = np.genfromtxt(
          filename, delimiter=",", skip_header=1, dtype=str
      )
      if table.size == 0:
          raise ValueError(
              "Error: Term file is empty, no terms to re-rank."
          )
  
      try:
          terms = table[:, 1]
      except Exception as e:
          print(
              "\n\nError converting str to float in training table: {}".format(
                  e
              )
          )
  
      polarities = table[:, 3].astype(str)
  
      if len(terms) != len(polarities):
          raise ValueError(
              "Count of opinion terms is different than the count of loaded polarities."
          )
      polarities = {terms[i]: polarities[i] for i in range(len(terms))}
  
      print(str(terms.shape[0]) + " features loaded from CSV file")
      return terms, polarities
  
imports: import csv
  import pickle
  import numpy
  import tensorflow
  from os import PathLike
  from pathlib import Path
  from nlp_architect.models.absa.utils import _read_generic_lex_for_similarity
  from nlp_architect.models.absa import TRAIN_OUT, TRAIN_LEXICONS, GENERIC_OP_LEX, LEXICONS_OUT
  from scipy.spatial.distance import cosine
  from sklearn.model_selection import StratifiedKFold
  from tensorflow.keras.layers import Dense, Dropout
  from tensorflow.keras.models import Sequential, load_model
  from nlp_architect.utils.embedding import load_word_embeddings
label_desc: Use image node_id 4 for calling the RerankTerms obj's underlying member method code with example usage: obj.load_terms_and_polarities(filename) and returns: terms,  polarities