code: def document_vector(text: str, learn, data, agg: str = "mean"):
      
  
      s = _tokenizer.tokenizer(text)
      t = torch.tensor(data.vocab.numericalize(s), requires_grad=False).to(device)
      m = learn.model[0].encoder.to(device)
      res = m(t).cpu().detach().numpy()
      if agg == "mean":
          res = res.mean(0)
      elif agg == "sum":
          res = res.sum(0)
      else:
          raise ValueError("Aggregate by mean or sum")
  
      return res
docs: :meth: `document_vector` get document vector using fastai language model and data bunch
      :param str text: text to extract embeddings
      :param learn: fastai language model learner
      :param data: fastai data bunch
      :param agg: how to aggregate embeddings
      :return: `numpy.array` of document vector sized 400 based on the encoder of the model