视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
rank-bm25【文档与办公】Guides tokenized lexical document retrieval with the rank_bm25 Python package, including BM25Okapi, BM25L, BM25Plus, full-corpus scoring, top-n retrieval, batch scoring, and input troubleshooting.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a task asks for the rank_bm25 package, Okapi BM25,
BM25L, BM25+, sparse lexical ranking, or a small in-memory search index over
pre-tokenized documents. It teaches the package API; it is not a production
search-service design and it does not cover the commented-out BM25Adpt/BM25T
classes.
rank_bm25 distribution, ensure
NumPy is available, and run the import check below.python -m pip install rank_bm25
python -c "from rank_bm25 import BM25Okapi, BM25L, BM25Plus; print('rank_bm25 ready')"
The package has no console CLI and its runtime dependency is NumPy. CPU execution is the supported baseline for the covered in-memory workflows.
document.split(); pass a list of those token sequences as corpus.BM25Okapi, BM25L, or BM25Plus, construct it once for a corpus,
and reuse the index for compatible tokenized queries.get_scores(query) for one score per indexed document,
get_top_n(query, documents, n=5) when you need the original documents,
or get_batch_scores(query, doc_ids) for a selected index subset.documents list in exactly the same order as the corpus;
get_top_n checks the lengths and maps score indices back into that list.python scripts/smoke_rank_bm25.py from this skill directory or any
current working directory after installing the package.The package is intentionally lightweight and in-memory. For full API details, recipes, and predictable failure recovery, follow the linked references rather than reopening the source repository.