
Keyword Extraction and Embedding
FreeEfficiently extract keywords and generate embeddings from documents.
Free · Opens the source repo
What Keyword Extraction and Embedding does
The Extracting Keywords skill is designed for developers and data scientists who need to perform keyword extraction, language detection, and generate embeddings from textual documents. Utilizing two primary algorithms, YAKE (Yet Another Keyword Extractor) and RAKE (Rapid Automatic Keyword Extraction), this skill allows users to extract relevant keywords based on statistical analysis and co-occurrence patterns. The configuration for keyword extraction is flexible, enabling users to specify parameters such as the maximum number of keywords, minimum score thresholds, and the language for stopword filtering.
In addition to keyword extraction, the skill includes functionality for detecting the language of the document. This is particularly useful for multilingual documents, as it allows users to identify the primary language present with a configurable confidence level. The language detection can be easily enabled via a command-line flag or through a configuration file, making it adaptable to various workflows.
Moreover, the skill features a standalone command for generating vector embeddings from text, which can be useful for applications in information retrieval and search. Users can choose from different embedding presets, including options for quality and speed, and can even utilize embeddings from external language models. The ability to produce embeddings from extracted text allows for seamless integration into machine learning workflows.
This skill is ideal for those working on text analysis, natural language processing, or any project that requires efficient keyword extraction and language processing capabilities. It is particularly suited for developers looking to enhance their applications with powerful text processing features without the need for extensive setup or configuration.
When to use it
Use this skill when you need to automatically extract keywords from documents or detect the language of the text, especially in data analysis or machine learning projects.
When not to use it
This skill may not be suitable for tasks requiring deep semantic understanding or context-aware keyword extraction, as it relies on statistical methods.
What you can build with it
Extracting Keywords from Research Papers
Use this skill to extract key terms from academic papers, helping to summarize and index research findings.
Detecting Language in Multilingual Texts
Apply the language detection feature to identify the primary language of documents, facilitating better processing in multilingual applications.
Generating Embeddings for Machine Learning
Leverage the embedding command to create vector representations of text, which can be used in machine learning models for tasks such as search and classification.
How to install Keyword Extraction and Embedding
View source1. Install with the skills CLI
npx skills add xberg-io/xberg/extracting-keywords --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by xberg-ioExtracting keywords, language, and embeddings
Use this for the enrichment surface around extraction: statistical keyword
extraction, language detection, and vector embeddings. Keywords and
language detection ride along with extraction and land on the result;
embeddings are produced by a dedicated embed command.
Keywords (YAKE / RAKE)
Keyword extraction is configured via the [keywords] config block (or
inline JSON) — there is no single --keywords CLI flag. When enabled,
extracted keywords appear on result.extracted_keywords (extractedKeywords
in Node.js; the CLI JSON field is extracted_keywords). Two algorithms are
available:
- YAKE (
"yake") — statistical, unsupervised single-document extraction. Good general default. - RAKE (
"rake") — co-occurrence / phrase-based. Favors multi-word key phrases.
Feature-gated: keyword extraction requires the CLI to be built with the
keywords-yakeand/orkeywords-rakeCargo features (both are in the default/fullbuild). If the CLI was built without them, the[keywords]config block is silently ignored —result.extracted_keywordssimply stays empty rather than erroring. The"yake"algorithm needskeywords-yake;"rake"needskeywords-rake.
Enable via inline JSON on the CLI:
xberg extract paper.pdf --format json \
--config-json '{"keywords":{"algorithm":"yake","max_keywords":15,"language":"en"}}' \
| jq '.extracted_keywords'
Or in a config file:
[keywords]
algorithm = "rake" # "yake" or "rake"
max_keywords = 10 # default 10
min_score = 0.0 # filter below this score (normalized 0.0-1.0 for both algorithms)
ngram_range = [1, 3] # unigrams..trigrams (default); config-file only
language = "en" # stopword language; omit to skip stopword filtering
xberg extract report.pdf --config xberg.toml --format json | jq '.extracted_keywords'
Field notes:
max_keywordscaps how many keywords are returned (default 10).min_scorefilters low-scoring keywords. Both YAKE and RAKE normalize their scores to the0.0-1.0range with higher-is-better, somin_scoreretains keywords withscore >= min_scoreidentically for either algorithm.ngram_rangeis[min, max]:[1,1]unigrams only,[1,2]adds bigrams,[1,3](default) adds trigrams. Config-file only — it is not a field on the language bindings'KeywordConfig.languageenables stopword filtering for that language; omit it to disable stopword filtering entirely.
Language detection
Language detection is a real CLI flag: --detect-language. Detected
languages appear on result.detected_languages:
xberg extract multilingual.pdf --detect-language true --format json \
| jq '.detected_languages'
In a config file it lives under [language_detection]:
[language_detection]
enabled = true
min_confidence = 0.8
detect_multiple = false
The CLI flag enables detection with min_confidence = 0.8 and
single-language mode; use the config block to detect multiple languages or
tune confidence.
Embeddings (embed command)
The standalone embed command produces vector embeddings for text from
--text (repeatable) or stdin. It does not run extraction — pipe
extracted content in if you want document embeddings.
# Local ONNX preset model (default provider)
xberg embed --text "first passage" --text "second passage" --preset balanced
# Embed extracted document text
xberg extract report.pdf | xberg embed --preset quality
Presets for the local provider: fast, balanced (default), quality,
multilingual. Output defaults to JSON (--format json).
--provider selects the embedding source:
| Provider | Flag | Notes |
|---|---|---|
local | --preset <fast|balanced|quality|multilingual> | Default. ONNX model, no API key. |
llm | --model <id> --api-key <key> | liter-llm routing, e.g. openai/text-embedding-3-small. |
plugin | --plugin <name> | A backend pre-registered in-process via the plugin API. |
# Provider-hosted embeddings via an LLM
xberg embed --text "query text" \
--provider llm --model openai/text-embedding-3-small --api-key "$OPENAI_API_KEY"
Local embedding presets must be downloaded first if not cached. Pre-warm them with the cache command:
xberg cache warm --embedding-model balanced # one preset
xberg cache warm --all-embeddings # all available presets (currently 8)
Programmatic access
Keywords and detected languages live on the document in the result envelope:
from xberg import ExtractInput, extract, ExtractionConfig, KeywordConfig, KeywordAlgorithm
config = ExtractionConfig(
keywords=KeywordConfig(algorithm=KeywordAlgorithm.YAKE, max_keywords=15, language="en"),
)
result = await extract(ExtractInput(uri="paper.pdf"), config)
doc = result.results[0]
print(doc.extracted_keywords) # extracted keywords (when enabled)
print(doc.detected_languages) # detected languages (when enabled)
See references/python-api.md and references/configuration.md in the
sibling xberg skill for the keyword / language-detection config
classes and the embedding presets.
Common pitfalls
- No
--keywordsflag — keyword extraction is config-only. Use--config-json '{"keywords":{...}}'or a[keywords]config block. min_scoredirection — scores are normalized to0.0-1.0with higher-is-better for both YAKE and RAKE, so the same threshold behaves identically for either algorithm.- Embeddings ≠ extraction —
embedonly takes raw text. Pipexberg extractoutput into it for document vectors. - Cold embedding models — first local run downloads the preset; run
xberg cache warm --all-embeddingsto pre-populate.
See references/advanced-features.md for the embeddings pipeline and
references/cli-reference.md for the embed and cache warm flag sets.
Frequently asked questions about Keyword Extraction and Embedding
Similar skills
Power BI Semantic Modeling
Optimize your Power BI data models with best practices.
Data Context Extractor
Tailor data analysis skills to your company's needs.
Power BI Performance Troubleshooting
Systematic guidance for optimizing Power BI performance.
Power BI Model Design Review
Optimize your Power BI data models with expert reviews.
Power BI DAX Formula Optimizer
Optimize your DAX formulas for better performance and clarity.
Fabric Lakehouse
Optimize your data solutions with Lakehouse best practices.
