Created
December 19, 2021 07:54
-
-
Save vinimonteiro/c63fe84841c957b87f797367ec564adf to your computer and use it in GitHub Desktop.
summarizer_pipelineapi_1
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 = """ | |
The researcher Alvaro Pascual-Leone experimented with measuring exactly that. He wanted to know the speed at which the brain applies such changes. | |
He blindfolded sighted participants for five days and kept training them at braille. Day after day, the participants would show improvement. | |
At the end of the five days, their brains were measured in the scanner, and it showed that their occipital cortex (vision) was activated when they were touching objects! | |
After the blindfold was removed, the brain would come back to its previous state within a day. It was remarkable to see how quickly neural reorganization can happen. | |
But wait! That’s not all. | |
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