Created
December 18, 2021 20:59
-
-
Save vinimonteiro/b1c9b1da110fe2c882b2648c3d021f2b to your computer and use it in GitHub Desktop.
summarizer_pipelineapi
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 | |
summarization = pipeline("summarization") | |
original_text = """ | |
In another experiment, participants would have their brains scanned at the same time as being blindfolded. They would perform various touching tasks while having the brain mapped out. It was noticed that brain reorganization would happen as rapidly as in 40 to 60 minutes! | |
Considering how quickly the brain reorganizes, it’s suggested that dreams are a defence mechanism. When we go to sleep, our vision cortex finds itself at a disadvantage. If you think about it, it’s the only sense lost — we still hear, taste, feel and smell. It’s unfair. | |
The brain, to protect the visual cortex from being taken over, creates images and videos internally (the dreams), and we see with our eyes shut. This way, vision is safe. | |
""" | |
summary = summarization(original_text)[0]['summary_text'] | |
print("Summary:", summary) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment