Let BERT and clustering write the TL;DR
This library extracts summaries by embedding sentences with BERT, clustering them, and returning the ones nearest each centroid, optionally resolving pronouns first.

What it does
bert-extractive-summarizer is a convenience wrapper that turns HuggingFace Transformers models into extractive summarizers. It embeds each sentence, runs a clustering pass to find semantic centroids, and pulls out the sentences closest to those centers. An optional CoreferenceHandler can rewrite pronouns and ambiguous references via neuralcoref before the clustering step so the final summary reads more coherently.
The interesting bit
Instead of generating new text, it treats summarization as a geometry problem—no autoregressive decoding, just vector distance. It also exposes the raw embedding matrices and offers an elbow-method helper so the data itself can suggest how many sentences belong in the summary.
Key highlights
- Swappable backends: works with BERT, DistilBERT, SciBERT, or Sentence-BERT (
SBertSummarizer). - Can concatenate multiple hidden layers or return the raw sentence embeddings for downstream use.
- Optional coreference resolution expands “she” and “him” into explicit nouns before clustering.
- Includes an elbow-calculation utility (
calculate_optimal_k) to pick the summary length automatically. - Ships with a Flask service and Dockerfile for containerized deployment.
Caveats
- The README explicitly warns that enabling coreference requires
neuralcoref, which it states is incompatible withspacyversions above 0.2.1; this may force dependency downgrades in modern environments. - The library is orchestration rather than architecture: most of the heavy lifting is done by Transformers, scikit-learn-style clustering, and optional neuralcoref.
Verdict
Useful if you need fast, deterministic extractive summaries with off-the-shelf BERT models and want pronoun resolution thrown in. Skip it if you need abstractive summarization or a fully maintained coreference pipeline.
Frequently asked
- What is dmmiller612/bert-extractive-summarizer?
- This library extracts summaries by embedding sentences with BERT, clustering them, and returning the ones nearest each centroid, optionally resolving pronouns first.
- Is bert-extractive-summarizer open source?
- Yes — dmmiller612/bert-extractive-summarizer is open source, released under the MIT license.
- What language is bert-extractive-summarizer written in?
- dmmiller612/bert-extractive-summarizer is primarily written in Python.
- How popular is bert-extractive-summarizer?
- dmmiller612/bert-extractive-summarizer has 1.5k stars on GitHub.
- Where can I find bert-extractive-summarizer?
- dmmiller612/bert-extractive-summarizer is on GitHub at https://github.com/dmmiller612/bert-extractive-summarizer.