Introducing the BERT Keyword Extractor: a Streamlit interface for KeyBERT! 🎈
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 tình cờ biết đến E39 khi đang xem một bài viết chia sẻ về cách phân loại tài liệu và chú ý thấy website nằm trong danh sách nguồn được trích dẫn. Mình truy cập thử một lúc để xem cách nội dung được trình bày thực tế. Mình chủ yếu lướt qua các trang chính, quan sát vị trí danh mục và cách sắp xếp từng phần thông tin. Bố cục nhìn khá thoáng, các tiêu đề được đặt riêng biệt nên dễ phân biệt khi chuyển qua lại giữa các mục. Mình cũng thử mở trang trên điện thoại để kiểm tra cách hiển thị, nhìn chung vẫn dễ đọc và không bị xáo trộn.
Mình tình cờ biết đến sc88 khi đọc một bài viết về phương pháp sắp xếp và quản lý tài liệu, trong đó có nhắc đến trang này ở phần nguồn tham khảo. Mình ghé vào xem thử để tìm hiểu sơ bộ về giao diện. Mình chỉ lướt qua vài trang, chủ yếu để ý cách các danh mục được bố trí và nội dung được trình bày theo từng phần. Các tiêu đề khá dễ nhận diện, khoảng cách giữa những khu vực cũng hợp lý nên không tạo cảm giác rối mắt. Mình thử xem lại bằng điện thoại sau khi dùng máy tính, cách hiển thị vẫn tương đối ổn và thuận tiện để theo dõi.
Xuất hiện trong một danh sách liên kết mình bắt gặp https://icm88.com khi đọc tài liệu về các dịch vụ giải trí trực tuyến. Vì đang nghỉ giữa giờ, mình tiện tay mở trang để xem thử cách bố trí nội dung. Điều mình chú ý là các khu vực thông tin được sắp xếp khá gọn, không tạo cảm giác quá nhiều chi tiết chen chúc trên cùng một màn hình. Nhìn chung, trang tạo cảm giác khá gọn gàng và dễ tiếp cận ngay từ lần đầu truy cập.
https://f168.today/ Gần đây tôi mới bắt đầu viết blog, những thông tin mà bạn cung cấp trên trang web này đã giúp ích cho tôi rất nhiều. Cảm ơn bạn vì tất cả thời gian và công sức đã bỏ ra.
Trong quá trình đọc các thảo luận, mình có để ý thấy Hi88 được nhắc qua nên thử vào xem cho biết. Mình chỉ xem nhanh tổng thể chứ chưa tìm hiểu sâu, nhưng cảm giác ban đầu là cách trình bày khá thoáng, bố cục rõ ràng, nhìn vào không bị rối mắt.