code: def encode_document(
      self, document: PersonDocument
  ) -> "TCLSEncodedDocument":
      origin_dk = 1.0 if document.background.origin == "DK" else 0.0
      origin_nd = 1.0 - origin_dk
      sex_m = 1.0 if document.background.gender == "M" else 0.0
      sex_f = 1.0 - sex_m
      age = self.minmax_norm(
          birth_month=document.background.birth_month,
          birth_year=document.background.birth_year,
      )
  
      background = np.array(
          [origin_dk, origin_nd, sex_m, sex_f, age], dtype=np.float32
      )
      sequence = " ".join(
          reduce(lambda xs, ys: xs + ys, document.sentences)
      )
      data = (
          self.vectorizer.transform([sequence])
          .toarray()
          .flatten()
          .astype(np.float32)
      )
  
      data /= data.sum()
  
      data = np.concatenate([background, data])
  
      target = np.array(document.task_info).astype(int)
  
      sequence_id = np.array(document.person_id)
  
      return TCLSEncodedDocument(
          sequence_id=sequence_id,
          input_ids=data,
          target=target,
          background=background,
      )
  
file_path: life2vec/src/tasks/tabular.py
imports: from dataclasses import dataclass
  from doctest import ELLIPSIS_MARKER
  from itertools import chain
  from typing import List, TypeVar, cast
  from datetime import date
  import numpy
  import pandas
  from sklearn.feature_extraction.text import CountVectorizer
  from src.data_new.types import Background, JSONSerializable, PersonDocument, EncodedDocument
  from src.tasks.base import Task
  from functools import reduce
  import logging
label_desc: Use image node_id 4 for calling the TabularCLS obj's underlying member method code with example usage: obj.encode_document(document) and returns: TCLSEncodedDocument