Introducing the BERT Keyword Extractor: a Streamlit interface for KeyBERT! 🎈
- Charly Wargnier
- Sep 20, 2021
- 3 min read
Updated: Oct 1, 2021
🎲 Want to jump right in? Try the Streamlit app here!
Automatic keyword generation methods have been around for a while (TF-IDF, Rake, YAKE!, just to name a few), all widely implemented in Python, all widely used in fields such Information Retrieval, Text Mining and of course, SEO!
Although techniques vary, they usually extract keywords and keyphrases from a document, assign a weight to each word, to signify the importance of that word in the wider document and corpus.
What's KeyBERT?
While all valuable, the KeyBERT library goes a step further than most in terms of accuracy by leveraging BERT embeddings!
What also makes KeyBERT stand out from the library crowd is its lightweightness, power and versatility.
Lightweight, as unlike other libraries, KeyBERT works very well with CPU configs. It can be used with a wide range of applications as a result.
Powerful, as KeyBERT supports the latest and best-performing embedding models, such as:
Flair
Spacy
Gensim
You can even select any sentence-transformers model and pass it through KeyBERT!

KeyBERT is also versatile with a bazillion of parameters to choose from. Here's a non-exhaustive list below:

That being said, like with any elaborate library, that versatility may come with a trade-off.
It can sometimes be cumbersome to choose the right model embedding and set of parameters to quickly iterate through your use cases.
This is where Streamlit comes in handy!
Introducing the BERT Keyword Extractor! 🎈
With the BERT Keyword Extraction (BERT KE), I wanted to create a simple interface that provides the relevant parameters at your fingertips, allowing you to iterate through in seconds and allow you to export your results!
🎲 Try the app here!

The BERT Keyword Extractor is currently in early beta with the following limitations:
2 embedding models (DistilBERT and Flair)
Only the first 500 words are currently reviewed
Once the app is deemed stable, I will add more models, more parameters, and more text allowance, so keep your eyes peeled!
Let's see what settings are currently available:
Choosing your model

At present, you can choose between two embedding models: DistilBERT, which is the default engine, and Flair. More to come soon!
Top N results

You can choose the number of results to be displayed. Between 1 and 30, the default number is 10.
Min/Max Ngrams

You can choose the minimum and maximum values for the ngram range.
This sets the length of the resulting keywords/keyphrases.
To extract a set of single keywords only, set the ngram range to (1, 1)
To extract keyphrases, set the minimum ngram value to 2. The maximum ngram value can be set to 2 or higher, depending on the number of words you would like to see in each keyphrase.
Check Stop Words

Tick this box to remove stop words from the document (currently English only).
Use MMR

You can use Maximal Margin Relevance (MMR) to diversify the results. It creates keywords/keyphrases based on cosine similarity.
Try high/low 'Diversity' settings for interesting variations.
Diversity

The higher the setting, the more diverse the keywords. Note that the *Keyword diversity* slider only works if the *MMR* checkbox is ticked.
Credits
Just a note where credit is due, KeyBERT has been created by the amazing Maarten Grootendorst
Maarten writes insightful Data Science articles in Medium, and is also the creator of 2 other awesome Python libraries: BERTopic and PolyFuzz!
BERTopic is a semi-supervised topic modelling library with a built-in visualiser. Check out Koray’s excellent article for some SEO use cases!
PolyFuzz is a mighty fuzzy string-matching/string-grouping library. It has been my go-to tool for fuzzy matching for over a year now, and it’s bang on for SEO tasks!
It can be used for mapping keywords to URLs, site migrations & redirect management.
It’s also got some good momentum in the SEO community, check-out what Greg Bernhardt, SearchSolved's Lee Foot, and yours truly have been doing with it!



Mình không phải kiểu theo kèo liên tục cả ngày, nhưng lại hay mở ra xem nhanh trước những trận lớn. Khi theo dõi ty le keo, mình nhận ra dữ liệu được cập nhật gần như theo thời gian thực, nên cảm giác không bị “trễ nhịp” so với diễn biến thị trường. Điều này khá quan trọng vì chỉ cần chậm vài phút là mức kèo đã khác. Với mình, việc cập nhật liên tục giúp mọi thứ luôn bám sát thực tế hơn thay vì chỉ mang tính tham khảo. Dù không phải lúc nào cũng dùng để vào tiền, nhưng việc nhìn thấy dữ liệu thay đổi đều đặn khiến mình yên tâm hơn khi theo…
Trong các nền tảng trực tuyến, việc công khai dữ liệu vận hành không phải lúc nào cũng được chú trọng. Khi quan sát qua game đổi thưởng có thể nhận ra một số cổng hiển thị tỷ lệ trả thưởng (RTP), luật chơi và cơ chế tính kết quả một cách rõ ràng. Bên cạnh đó, các yếu tố như hoàn trả định kỳ hoặc thưởng chào mừng cũng được thiết lập theo quy tắc cụ thể thay vì thay đổi liên tục. Những đặc điểm này thường xuất hiện ở các hệ thống có cấu trúc ổn định và kiểm soát dữ liệu tốt. Theo thời gian, sự rõ ràng trong cách vận hành giúp người dùng dễ theo…
Khi trải nghiệm các nền tảng có nhiều hình thức giao dịch, mình thường để ý những phương thức linh hoạt ngoài các kênh truyền thống. Trong quá trình tìm hiểu, phần giao dịch P2P nội bộ trên NET 88 cho phép chuyển đổi khá nhanh giữa các tài khoản trong hệ thống, thời gian xử lý chỉ khoảng vài giây. Điểm mình nhận ra là cách này phù hợp khi cần xử lý nhanh mà không phải qua trung gian bên ngoài. Khi thử sử dụng, thao tác đơn giản và không mất nhiều bước xác nhận phức tạp. Với những ai quen giao dịch thường xuyên, dạng P2P như vậy giúp tiết kiệm thời gian và giữ được sự…
Mình từng khá khó chịu khi dùng app nạp rút lâu, vì chơi mà phải chờ là mất hứng ngay. Khi tìm hiểu, mình thấy hitclub có thông tin rõ về thời gian nạp chỉ khoảng 1–2 phút, rút tầm 5–10 phút. Mình kiểm tra thực tế vài lần và thấy đúng như vậy, thao tác đơn giản, không gặp lỗi hay đứng giữa chừng. Việc này giúp trải nghiệm chơi game mượt mà, không bị gián đoạn giữa các ván. Với mình, nạp rút nhanh và tiện lợi như vậy khiến app phù hợp để mở chơi bất cứ khi nào rảnh, vừa thư giãn vừa tiết kiệm thời gian.
Mình hay tranh thủ nghỉ trưa để chơi vài ván nên cũng thử 28BET. Lúc vào thì thấy mọi thứ khá đơn giản, không cần mò nhiều. Mình chơi casino live trước, thấy load nhanh nên cũng ok. Sau đó mình thử qua thể thao thì thấy cập nhật kèo khá nhanh. Có lần mình vào lúc mạng không ổn lắm mà vẫn chơi được. Trong lúc mình dùng thì thấy thao tác khá mượt, không bị lag nhiều. Mình cũng thấy nạp rút xử lý nhanh. Với mình thì kiểu này phù hợp để chơi nhanh, giải trí nhẹ.