class_docstr: interface to Transformer-based text summarization
docstr: ```
  Summarize document text.  Extra arguments are fed to generate method
  Args:
    doc(str): text of document
  Returns:
    str: summary text
  ```
docstr_tok: ["``","`","Summarize","document","text",".","Extra","arguments","are","fed","to","generate","method","Args",":","doc","(","str",")",":","text","of","document","Returns",":","str",":","summary","text","``","`"]
code: def summarize(
      self,
      doc,
      max_length=150,
      min_length=56,
      no_repeat_ngram_size=3,
      length_penalty=2.0,
      num_beams=4,
      **kwargs,
  ):
      """
      ```
      Summarize document text.  Extra arguments are fed to generate method
      Args:
        doc(str): text of document
      Returns:
        str: summary text
      ```
      """
      import torch
  
      with torch.no_grad():
          answers_input_ids = self.tokenizer.batch_encode_plus(
              [doc],
              return_tensors="pt",
              truncation=True,
              max_length=1024,
          )["input_ids"].to(self.torch_device)
          summary_ids = self.model.generate(
              answers_input_ids,
              num_beams=num_beams,
              length_penalty=length_penalty,
              max_length=max_length,
              min_length=min_length,
              no_repeat_ngram_size=no_repeat_ngram_size,
              **kwargs,
          )
  
          exec_sum = self.tokenizer.decode(
              summary_ids.squeeze(), skip_special_tokens=True
          )
      return exec_sum
  
file_path: ktrain/ktrain/text/summarization/core.py
imports: from ...torch_base import TorchBase
label_desc: Use image node_id 2 for calling the TransformerSummarizer obj's underlying member method code with example usage: obj.summarize(doc, max_length, min_length, no_repeat_ngram_size, length_penalty, num_beams) and returns: exec_sum