xberg-extracting-keywords
Skill này làm gì
Skill này giải thích cách lấy từ khóa từ tài liệu bằng phương pháp YAKE hoặc RAKE, và cách nhận diện ngôn ngữ của tài liệu. Nó dành cho người muốn có nhãn chủ đề hoặc kiểm tra ngôn ngữ nhanh.
Khi nào nên dùng
- ✓Khi bạn muốn biết các chủ đề hoặc từ khóa chính của một báo cáo hoặc bài nghiên cứu.
- ✓Khi bạn cần biết tài liệu được viết bằng ngôn ngữ nào.
- ✓Khi bạn đang xây dựng tìm kiếm và cần embedding vector được tạo từ tài liệu.
Liên kết skill
https://github.com/xberg-io/xberg/blob/main/plugin/.ai-rulez/skills/xberg-extracting-keywords/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lấy các từ khóa chính từ bài nghiên cứu này và cho tôi biết nó được viết bằng ngôn ngữ nào.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent bật cài đặt từ khóa trong tùy chọn trích xuất và chọn YAKE hoặc RAKE. Các từ khóa sau đó xuất hiện trong kết quả. Embedding được tạo bằng một lệnh embed riêng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Extracting 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 '.result.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 '.result.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 '.result.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 down
Câu hỏi thường gặp
Khác nhau giữa YAKE và RAKE là gì?
YAKE là phương pháp thống kê, phù hợp làm mặc định chung, còn RAKE ưu tiên các cụm từ khóa nhiều từ.
Vì sao từ khóa của tôi bị thiếu?
Tính năng từ khóa phải được tích hợp sẵn trong công cụ. Nếu không, cài đặt sẽ bị bỏ qua và danh sách sẽ trống mà không báo lỗi.
Embedding được tạo ở đâu?
Một lệnh embed riêng sẽ tạo chúng, tách biệt với việc trích xuất thông thường.
Chi tiết
Mô tả gốc của tác giả
Use when extracting keywords (YAKE/RAKE) from documents — and, secondarily, when detecting document language or generating embeddings for RAG and search. Covers the keyword config (and its feature gating), `--detect-language`, and the standalone `embed` command with real flags.
repo: xberg-io/xberg
Độ phổ biến
- Sao GitHub
- 9.5k
- Vị trí xếp hạng
- #12270
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
xberg-batch-extraction
9.5kGiúp agent của bạn xử lý nhiều tài liệu một lượt với Xberg, dùng chung tùy chọn, giới hạn việc song song và không để một file lỗi làm dừng cả lượt.
xberg-chunking
9.5kGiúp agent của bạn chia văn bản dài thành các đoạn nhỏ cho prompt AI hoặc chỉ mục tìm kiếm, với kích thước đặt sẵn và chồng lấp tùy chọn.
xberg-extracting-tables
9.5kGiúp agent của bạn lấy bảng từ PDF, bảng tính và hình ảnh, giữ nguyên hàng và cột dưới dạng markdown hoặc dữ liệu có cấu trúc.
xberg-extracting-with-ocr
9.5kGiúp agent của bạn đọc văn bản từ PDF quét, ảnh chụp và hình ảnh không có lớp văn bản, bằng OCR với các gói ngôn ngữ tùy chọn.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.