Skip to content

Instantly share code, notes, and snippets.

@manmohan24nov
Created November 10, 2020 18:59
Show Gist options
  • Save manmohan24nov/791ea0473b268452596b13bddaeb380d to your computer and use it in GitHub Desktop.
Save manmohan24nov/791ea0473b268452596b13bddaeb380d to your computer and use it in GitHub Desktop.
>>> from summarizer import TransformerSummarizer
>>> import re
>>> GPT2_model = TransformerSummarizer(transformer_type="GPT2",transformer_model_key="gpt2-medium")
>>> text = " ".join(comment_section)
>>> summerize = ''.join(GPT2_model(text, min_length=60, max_length=120))
>>> summerize
'The queen trolls her staff by leaving little bowls of snacks around the palace and marking the level of the snacks with a sharpie.
If the snacks dip below that level she starts trolling them about who ate her snacks.
The queen has a history of doing exactly that sort of thing in very sly ways.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment