code: def get_text_columns(
      text_dataset: pd.DataFrame,
      text_column: Optional[Union[str, List]],
  ):
      """Get the text columns for prediction.
  
      :param text_dataset: The text dataset.
      :type text_dataset: pd.DataFrame
      :param text_column: The name of the text column or list of columns.
      :type text_column: str or list[str]
      :return: The text columns for prediction.
      :rtype: pd.DataFrame
      """
      text_exists = not not text_column
      num_cols = len(text_dataset.columns)
      is_list = isinstance(text_column, list)
      text_cols = len(text_column) if is_list else 1
      # Drop metadata columns before calling predict
      if text_exists and num_cols - text_cols > 0:
          if not is_list:
              text_column = [text_column]
          text_dataset = text_dataset[text_column]
      return text_dataset
  
file_path: responsible-ai-toolbox/responsibleai_text/responsibleai_text/utils/feature_extractors.py
imports: import re
  from typing import List, Optional, Union
  import pandas
  import spacy
  from negspacy.termsets import termset
  from tqdm import tqdm
  from nlp_feature_extractors import attribute_extractors
  from responsibleai_text.common.constants import ModelTask, QuestionAnsweringFields
label_desc: Use image node_id 3 for calling a global function with example usage: get_text_columns(text_dataset, text_column) and returns: text_dataset