flashtext
Routes FlashText tasks for keyword extraction, replacement, fuzzy matching, keyword loading, and keyword-inspection workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- flashtext
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Routes FlashText tasks for keyword extraction, replacement, fuzzy matching, keyword loading, and keyword-inspection workflows.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/api-reference.md3.8 KB
- 参考文档references/data-formats.md1.9 KB
- 参考文档references/repo-provenance.md1.3 KB
- 参考文档references/repo-routing-metadata.json336 B
- 参考文档references/troubleshooting.md3.0 KB
- 参考文档references/workflows.md3.7 KB
- 脚本scripts/check_install.py5.5 KB
03 SKILL.md 正文
FlashText
Use this skill when a request names FlashText or asks to extract, replace,
load, inspect, or fuzzily match keywords with KeywordProcessor.
This repository is small enough that one router covers the whole package. Read the bundled references for exact API details instead of reopening the original checkout.
Install and verify
- Public install:
python -m pip install flashtext - From a checkout:
python -m pip install -e . - Safe smoke check:
python scripts/check_install.py - JSON smoke output:
python scripts/check_install.py --json - Minimal import check:
python -I -c "from flashtext import KeywordProcessor; print(KeywordProcessor().__class__.__name__)"
If you are checking whether this skill still matches the repository snapshot,
read references/repo-provenance.md before making that call.
Route map
- Need to add, remove, count, or inspect keywords with dictionary-like
behavior (
len,in,[],get_keyword,get_all_keywords)? Readreferences/api-reference.mdandreferences/workflows.md. - Need sentence extraction, replacement, spans,
case_sensitive, or fuzzymax_costbehavior? Start withreferences/workflows.md, then openreferences/api-reference.mdfor exact signatures and return shapes. - Need to load keywords from a file, list, or dictionary, or you want the
expected input shapes? Read
references/data-formats.md. - Need to debug import errors, bad file paths, malformed list/dict shapes,
replace_keywordswith tuple clean names, or missed matches caused by word boundaries or case handling? Readreferences/troubleshooting.md, then rerunscripts/check_install.py. - Need to compare the current checkout against the recorded baseline? Read
references/repo-provenance.md.
Typical request phrases
- "extract keywords from this sentence"
- "replace keywords with clean names"
- "show spans for each match"
- "make matching case sensitive"
- "load keywords from a file"
- "load from a list or dictionary"
- "remove a keyword variant"
- "allow punctuation like / inside keywords"
- "debug why a keyword did not match"
- "check whether the package is installed correctly"
What to read or run next
- Use
references/workflows.mdfor step-by-step usage patterns. - Use
references/api-reference.mdwhen you need the exact signature or return type for a method onKeywordProcessor. - Use
references/data-formats.mdwhen shaping file, list, or dictionary inputs. - Use
references/troubleshooting.mdfor predictable input and matching failures. - Run
scripts/check_install.pywhenever you need a quick install/import/ smoke verification.
What this skill does not cover
- No CLI entry point is shipped by the package.
- No network service, model backend, or accelerator-specific workflow is involved.
- No training, benchmarking, or docs-build workflow is part of the runtime route.
Working rule
Keep runtime instructions self-contained. Use the bundled references and script instead of the original repository when you need API details, data-shape reminders, or a fast validation check.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).