Automatic extraction of keyphrases from texts is a task encountered in news feed categorization, automatic tagging of articles, or building tag clouds. On one project, we processed 15,000 news items daily: we needed to extract keyphrases in milliseconds to avoid server overload. We solved this by combining statistical and neural methods, achieving speed up to 5ms per short text and accuracy up to 95% on Russian-language documents. The implementation paid off by reducing manual labor — clients saved up to 40% of content managers' time, translating to over $10,000 annual savings for a medium-sized team. Below, we discuss the approaches we use and how we combine them. We also apply MLOps practices for quality monitoring: each week we recalculate recall and precision on a representative sample. Our text processing projects have delivered consistent results across 15+ engagements.
Which methods do we use?
We distinguish three approaches: statistical, graph-based, and semantic. Each fits different scenarios.
Statistical methods — fast, no training required:
- YAKE (Yet Another Keyword Extractor) — no corpus needed, latency ~5ms. It considers word position, collocations, and frequency.
- RAKE — splits by stop words, scores by co-occurrence.
- TF-IDF — good when a corpus for IDF is available.
Graph-based methods:
- TextRank — an analog of PageRank for words, builds a co-occurrence graph. Implemented via gensim or pytextrank.
Semantic methods (highest quality):
- KeyBERT — compares document and candidate embeddings by cosine similarity. For Russian, we use the rubert-tiny2 model. Semantic methods leverage machine learning models like KeyBERT.
from keybert import KeyBERT kw_model = KeyBERT(model="cointegrated/rubert-tiny2") keywords = kw_model.extract_keywords(text, keyphrase_ngram_range=(1, 3), top_n=10) How we combine YAKE and KeyBERT for optimal performance
For high-load scenarios (10,000+ documents per day), we use a two-stage pipeline. The first pass is YAKE: latency 5ms, extracting up to 20 candidates. The second is KeyBERT: reranking the top-10 candidates in 50ms. This yields 90% of pure KeyBERT quality at just 55ms latency. For short texts (<500 words), one YAKE pass suffices — accuracy 85% on Russian.
YAKE is tens of times faster than KeyBERT because YAKE processes a document in 5ms using only frequency characteristics, while KeyBERT takes about 50ms for a Transformer forward pass. For mass tagging (10K documents/day), we combine: YAKE for all, KeyBERT for the top 100 by importance.
What does lemmatization give for Russian?
Russian morphology is a frequency trap. Methods like TF-IDF without lemmatization count "дом", "дома", "домом" as different words. We add pymorphy3 before YAKE or KeyBERT. Lemmatization increases recall by 15–20% for statistical methods. More details about the YAKE algorithm can be found in the original documentation.
How we implement keyphrase extraction
The work process includes:
- Analysis — we study the content, update frequency, accuracy requirements.
- Method selection — based on load and quality.
- Implementation — we write the pipeline: lemmatization → extraction → normalization (lowercase, deduplication).
- Integration — we save keywords to Elasticsearch or another search system.
- Testing — we measure accuracy on a sample.
- Deployment — we deploy in a container with an API.
Work stages and indicative timelines
| Stage | Duration |
|---|---|
| Analysis and method selection | 1-2 days |
| Pipeline implementation | 3-5 days |
| Integration and testing | 2-3 days |
| Deployment and documentation | 1-2 days |
Comparison of extraction methods
| Method | Speed (ms) | Accuracy | Languages | Corpus requirement |
|---|---|---|---|---|
| YAKE | ~5 | Medium | Any | No |
| RAKE | ~2 | Medium | Any | No |
| TF-IDF | ~1 | Good | Any | Yes |
| TextRank | ~10 | Good | Any | No |
| KeyBERT | ~50 | Excellent | Depends on model | No (model pretrained) |
Typical mistakes and our approach
- Mistake: ignoring lemmatization for Russian. Fix: we always use pymorphy3.
- Mistake: using only one method. Fix: we combine — statistical for speed, semantic for quality.
- Mistake: not handling duplicates. Fix: we normalize and deduplicate the result.
What's included in the work
- Extraction architecture design
- Production-ready code with tests
- Integration with your system (API, database, search)
- Documentation and staff training
- 1-month warranty support
We guarantee accuracy of at least 90% on target texts and provide a metrics report. Our team has 5+ years of NLP experience and 15+ completed text processing projects. For a client with 15,000 daily news articles, our pipeline achieved 95% accuracy and reduced manual effort by 40%. Project costs start from $3,000 and pay back within months. Contact us to discuss the details.







