Created
November 10, 2020 18:38
-
-
Save manmohan24nov/ea4c2b9450ad0f7489290e08d4cd7a21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from transformers import pipeline | |
>>> summarizer = pipeline('summarization', model='facebook/bart-large-cnn', tokenizer='facebook/bart-large-cnn') | |
>>> text = ".".join(comment_section) | |
>>> summarizer(text, min_length = round(0.1 * len(text.split(' '))), max_length = round(0.2 * len(text.split(' '))), do_sample=False) | |
[{'summary_text': "england would fall before there comes a day when the queen doesn't have tea. | |
She also regularly has wine with her meals. When someone gets to 100 years old in england they get a letter from the queen."}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment