KeyBERT Minimal Keyword Extraction with BERT Embeddings
KeyBERT is a minimal and easy-to-use Python library that leverages BERT embeddings and cosine similarity to extract keywords and keyphrases from documents. It supports multiple embedding backends including sentence-transformers, Flair, and spaCy, with built-in diversity algorithms like Max Sum Similarity and Maximal Marginal Relevance.
Installation
Use the upstream install or setup path that matches your environment:
- pip install keybert
- pip install keybert[flair]
- pip install keybert[gensim]
- pip install keybert[spacy]
Requirements and caveats from upstream:
Basic usage or getting-started notes:
2.2. Basic Usage
Thus, the goal was a pip install keybert and at most 3 lines of code in usage.
Extracted from upstream docs: https://raw.githubusercontent.com/MaartenGr/KeyBERT/HEAD/README.md