#4747th of 50 in Data and scraping for AI
keybert
Python library that extracts keywords and keyphrases using sentence embeddings
- Stars
- 4.2k
- License
- MIT
- Last commit
- Aug 2026
- Last release
- Feb 2025
- Language
- Python
4,129 on 21 Apr 20264,225 on 10 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
KeyBERT embeds a document and its candidate n-grams, then ranks phrases by cosine similarity to the document. It supports Sentence-Transformers, Flair, spaCy, Gensim and USE embeddings, with Max Sum and MMR options for diversifying results. A separate KeyLLM class sends text to an LLM such as OpenAI for keyword extraction.
Who it is for: Python developers who need keyword extraction from documents
Strengths
- Uses pretrained embeddings, so no training step; extraction takes a few lines of Python
- Max Sum Distance and MMR options reduce near-duplicate keywords
- Several embedding backends: Sentence-Transformers, Flair, spaCy, Gensim, USE
- Light install without PyTorch is possible via Model2Vec
Weaknesses
- Library only: no UI, server or API; you write Python to use it
- Max Sum Distance has super-exponential time cost with large top_n
- KeyLLM example needs the openai package and an API key
- Last release is 2025-02-07, older than the latest commit
What it needs
- GPU optional
- Needs Python 3.10+, scikit-learn, sentence-transformers, openai (for KeyLLM)
- Models: Sentence-Transformers, Flair, spaCy, Gensim, Universal Sentence Encoder
Quick answers
Is keybert open source?
Yes. Its code is on GitHub under the MIT license.
Does keybert need a GPU?
No. It runs on a CPU and can use a GPU when you have one.
Also in Data and scraping for AI
See all 50| Rank | Project | Score |
|---|---|---|
| 1 | doclingPython library that converts PDFs, Office files and more into structured text | 92 out of 100 |
| 2 | mineruParses PDFs, images and Office files into Markdown and structured JSON | 91 out of 100 |
| 3 | opendataloader-pdfPDF parser that outputs Markdown, JSON with bounding boxes, and Tagged PDF | 90 out of 100 |
| #4 | agent-reachCLI that gives coding agents read access to login-gated and Chinese web platforms | 88 out of 100 |
| #5 | markitdownPython library and CLI that converts office files, PDFs and audio to Markdown | 87 out of 100 |