docstr: :param is_target:
  :param mode:
      None or "concat" or "mean".
      When None, it will be set automatically based on is_target:
      (is_target) -> 'concat'
      (not is_target) -> 'mean'
  :param device: name of the device that get_device_from_name will attempt to use.
docstr_tok: [":","param","is_target",":",":","param","mode",":","None","or","``","concat","''","or","``","mean","''",".","When","None",",","it","will","be","set","automatically","based","on","is_target",":","(","is_target",")","-",">","'concat'","(","not","is_target",")","-",">","'mean'",":","param","device",":","name","of","the","device","that","get_device_from_name","will","attempt","to","use","."]
code: def __init__(self, is_target=False, mode=None, device=""):
      """
      :param is_target:
      :param mode:
          None or "concat" or "mean".
          When None, it will be set automatically based on is_target:
          (is_target) -> 'concat'
          (not is_target) -> 'mean'
      :param device: name of the device that get_device_from_name will attempt to use.
      """
      super().__init__(is_target)
  
      if mode is None:
          if is_target:
              self._mode = "concat"
          else:
              self._mode = "mean"
      else:
          if mode not in ["concat", "mean"]:
              self._unexpected_mode()
  
          if is_target and mode != "concat":
              raise ValueError(
                  'mode must be "concat" when is_target=True'
              )
  
          self._mode = mode
  
      # Defined in self.prepare()
      self._combine_fn = None
      self.max_words_per_sent = None
      self.cae = CategoricalAutoEncoder(
          is_target=is_target, max_encoded_length=100, device=device
      )
      self.is_prepared = False
  
file_path: lightwood/lightwood/encoder/text/short.py
imports: from typing import List
  import torch
  from lightwood.encoder import BaseEncoder
  from lightwood.encoder.categorical import CategoricalAutoEncoder
  from type_infer.rule_based.helpers import tokenize_text
  from lightwood.helpers.torch import concat_vectors_and_pad, average_vectors
  import pandas
label_desc: Use image node_id 1 to create a new ShortTextEncoder object from inherited base classes: BaseEncoder with example: obj = ShortTextEncoder(is_target, mode, device)