Natural Language Processing

KeyBERT – keyword and keyphrase extraction with embeddings

KeyBERT is a keyword and keyphrase extraction library that identifies the words and phrases most representative of a document. It uses semantic embeddings to compare candidate expressions with the meaning of the text as a whole.

The library provides a straightforward approach to extracting descriptive terms without requiring a dedicated keyword extraction model to be trained for each dataset. It is suitable for document indexing, content analysis, research, automatic tagging, and information retrieval.

KeyBERT combines embedding-based similarity scoring with configurable candidate selection and diversification techniques. This allows users to balance relevance against redundancy when identifying important concepts within a document or collection of documents.

This is free and open source software.

Key Features

  • Extracts keywords and multi-word keyphrases from text documents.
  • Uses document and candidate phrase embeddings to identify semantically relevant expressions.
  • Cosine similarity measures the relationship between candidate keywords and document content.
  • Configurable n-gram ranges determine the length of extracted keyphrases.
  • Stop-word filtering removes common terms from candidate expressions.
  • Specify the number of keywords returned for each document.
  • Max Sum Distance selects keywords with greater diversity between candidate phrases.
  • Maximal Marginal Relevance balances semantic relevance against redundancy.
  • Custom candidate lists allow extraction to focus on predefined terminology.
  • Supports Sentence Transformers and alternative embedding backends.
  • Compatible with embedding models from Flair, spaCy, Gensim, and other supported libraries.
  • Multilingual keyword extraction is available through suitable multilingual embedding models.
  • Highlight extracted keywords within the original document text.
  • Optional KeyLLM integration supports keyword extraction using large language models.
  • Embedding similarity can be used to reduce repeated keyword extraction for semantically similar documents.

Website: github.com/MaartenGr/KeyBERT
Support:
Developer: Maarten Grootendorst
License: MIT License

KeyBERT is written in Python. Learn Python with our recommended free books and free tutorials.


Related Software

Python Natural Language Processing Tools
PyTorch-TransformersLibrary of state-of-the-art pre-trained models for NLP
NLTKNatural Language Toolkit
spaCyIndustrial strength natural language processing
scikit-learnMachine learning library
HaystackAI orchestration framework
GensimVector space modeling and topic modeling toolkit
flairSimple framework for state-of-the-art NLP
TextBlobPython (2 and 3) library for processing textual data
doccanoData labelling and text annotation platform
BERTopicTopic modeling
textacyPython library for performing NLP tasks
PresidioData protection and de-identification SDK
polyglotMultilingual text (NLP) processing toolkit
AllenNLPApache 2.0 NLP research library
Snips NLUNatural Language Understanding Python library
PyNLPIVarious modules useful for common, and less common, NLP tasks
nlpnetNatural Language Processing with neural networks
PatternWeb mining module
GluonNLPDeep Learning for NLP
PyTorch-NLPNeural network layers, text processing modules and datasets
NLP ArchitectDeep Learning NLP/NLU library

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted