class_docstr: Base class for processing :class:`src.data.types.PersonDocument` objects
  for various ML tasks. Includes default implementations for clipping and augmenting
  documents.
  In order to implement a new task, we have to implement the :meth:`encode_sequence`,
  which defines how the documents should be encoded for a specific task, ie. what
  input the forward method of the model expects for the task in question.
  
  Also defines a default implementation for pulling :class:`PersonDocument` objects
  out of the sentence data provided by the :class:`src.data.Corpus`. Task
  implementations can extend this method and save task-specific information in the
  :attr:`task_info` field
  
  :param name: The name of the task.
  :param max_length: The maximum length of the encoded documents
  :param no_sep: If True, don't include the [SEP] token between sentences.
  
  :param p_timecut:
  :param p_resample:
  :param p_abspos_noise:
  :param p_hide_background:
  :param p_shuffle_sentences:
  
  :param shuffle_within_sentences:
  
  
  .. todo::
      Confirm this is what no_sep is actually for since this has always been False as
      far as I (Søren) know
class_docstr_tok: ["Base","class","for","processing",":","class",":","`","src.data.types.PersonDocument","`","objects","for","various","ML","tasks",".","Includes","default","implementations","for","clipping","and","augmenting","documents",".","In","order","to","implement","a","new","task",",","we","have","to","implement","the",":","meth",":","`","encode_sequence","`",",","which","defines","how","the","documents","should","be","encoded","for","a","specific","task",",","ie",".","what","input","the","forward","method","of","the","model","expects","for","the","task","in","question",".","Also","defines","a","default","implementation","for","pulling",":","class",":","`","PersonDocument","`","objects","out","of","the","sentence","data","provided","by","the",":","class",":","`","src.data.Corpus","`",".","Task","implementations","can","extend","this","method","and","save","task-specific","information","in","the",":","attr",":","`","task_info","`","field",":","param","name",":","The","name","of","the","task",".",":","param","max_length",":","The","maximum","length","of","the","encoded","documents",":","param","no_sep",":","If","True",",","do","n't","include","the","[","SEP","]","token","between","sentences",".",":","param","p_timecut",":",":","param","p_resample",":",":","param","p_abspos_noise",":",":","param","p_hide_background",":",":","param","p_shuffle_sentences",":",":","param","shuffle_within_sentences",":","..","todo",":",":","Confirm","this","is","what","no_sep","is","actually","for","since","this","has","always","been","False","as","far","as","I","(","S\u00f8ren",")","know"]
code: def get_document(
      self, person_sentences: pd.DataFrame
  ) -> PersonDocument:
      person_id = person_sentences.name
      sentences = [x.split(" ") for x in person_sentences.SENTENCE]
      abspos = (person_sentences.START_DATE + 1).tolist()
      age = person_sentences.AGE.tolist()
  
      after_threshold = person_sentences.AFTER_THRESHOLD
      try:
          timecut_pos = next(
              i for i, k in enumerate(after_threshold) if k
          )
      except StopIteration:
          timecut_pos = len(after_threshold)
  
      birthday = person_sentences.BIRTHDAY.iloc[0]
      origin = person_sentences.RES_ORIGIN.iloc[0]
      gender = person_sentences.GENDER.iloc[0]
  
      background = Background(
          origin=origin,
          gender=gender,
          birth_month=birthday.month,
          birth_year=birthday.year,
      )
  
      return PersonDocument(
          person_id=person_id,
          sentences=sentences,
          abspos=abspos,
          age=age,
          timecut_pos=timecut_pos,
          background=background,
      )
  
file_path: life2vec/src/tasks/base.py
imports: import random
  from dataclasses import asdict, dataclass
  from itertools import accumulate
  from typing import TYPE_CHECKING, Callable, Dict, List, TypeVar
  import numpy
  import pandas
  import torch
  from src.data_new.augment import add_noise2time, align_document, make_timecut, resample_document, shuffle_sentences, drop_tokens
  from src.data_new.types import Background, PersonDocument
label_desc: Use image node_id 6 for calling the Task obj's underlying member method code with example usage: obj.get_document(person_sentences) and returns: PersonDocument