class_docstr: interface to Lexrank-based text summarization
docstr: ```
  summarize document text
  Args:
    doc(str): text of document
    num_sentences(int): Number of sentences for summary
    maximum_length(int): Maximum length of sentence in summary
    minimumlength(int): Minimum length of sentence in summary
    join_sentences(bool): If True, summary is a single string instead of a list of sentences.
    num_candidate_sentences(int): Number of candidate sentences from which to select final summary.
  Returns:
    str: summary text
  ```
docstr_tok: ["``","`","summarize","document","text","Args",":","doc","(","str",")",":","text","of","document","num_sentences","(","int",")",":","Number","of","sentences","for","summary","maximum_length","(","int",")",":","Maximum","length","of","sentence","in","summary","minimumlength","(","int",")",":","Minimum","length","of","sentence","in","summary","join_sentences","(","bool",")",":","If","True",",","summary","is","a","single","string","instead","of","a","list","of","sentences",".","num_candidate_sentences","(","int",")",":","Number","of","candidate","sentences","from","which","to","select","final","summary",".","Returns",":","str",":","summary","text","``","`"]
code: def summarize(
      self,
      doc,
      num_sentences=3,
      maximum_length=2000,
      minimum_length=40,
      join_sentences=True,
      num_candidate_sentences=100,
      **kwargs,
  ):
      """
      ```
      summarize document text
      Args:
        doc(str): text of document
        num_sentences(int): Number of sentences for summary
        maximum_length(int): Maximum length of sentence in summary
        minimumlength(int): Minimum length of sentence in summary
        join_sentences(bool): If True, summary is a single string instead of a list of sentences.
        num_candidate_sentences(int): Number of candidate sentences from which to select final summary.
      Returns:
        str: summary text
      ```
      """
      from sumy.nlp.tokenizers import Tokenizer
      from sumy.parsers.html import HtmlParser
      from sumy.parsers.plaintext import PlaintextParser
  
      parser = PlaintextParser.from_string(
          doc, Tokenizer(self.language)
      )
      results = []
      for sentence in self.summarizer(
          parser.document, num_candidate_sentences
      ):
          if (
              len(sentence._text) > maximum_length
              or len(sentence._text) < minimum_length
              or sentence._text[0].isdigit()
          ):
              continue
          results.append(
              sentence._text + "."
              if sentence._text[-1] not in [".", "?", "!", ";"]
              else sentence._text
          )
      return (
          " ".join(results[:num_sentences])
          if join_sentences
          else results[:num_sentences]
      )
  
file_path: ktrain/ktrain/text/summarization/core.py
imports: from ...torch_base import TorchBase
label_desc: Use image node_id 2 for calling the LexRankSummarizer obj's underlying member method code with example usage: obj.summarize(doc, num_sentences, maximum_length, minimum_length, join_sentences, num_candidate_sentences) and returns: unknown