You can implement text summarization using a BERT-based model with the Hugging Face Transformers library, here is the code you can refer:
In the above code, we are using a Pre-trained Model that uses Facebook/bart-large-cnn, a BERT-like model optimized for the summarization Pipeline. This model simplifies the summarization task with high-level abstraction, and Adjustable Parameters, max_length and min_length, control the summary length.
Hence, this provides a quick and effective way to perform text summarization with a BERT-based architecture.