Style Fingerprint v2 | 写作风格指纹
What changed in v2 | v2 变更
| Fix/New |
说明 |
| Fixed |
反问句检测(v1 正则语序错误,永远返回 0) |
| Fixed |
被动语态误伤「由于/自由」 |
| Fixed |
省略主语字符类拆词误判 |
| Fixed |
隐喻误报(排除副词「好像/似乎」) |
| Rewritten |
词汇层:滑窗伪分词 → 封闭集合功能词指纹(疑问/连接/情态/程度/人称/语气词)+ 跨句口头禅候选 |
| New |
compare:新稿 vs 指纹,15 维度偏差报告 + 修正建议(写作质量闸门) |
| New |
merge:多文本合并指纹(按字数加权) |
| New |
export 范例句层:few-shot 例句比规则对 LLM 更有效 |
| New |
selftest:11 项内置回归用例 |
| New |
<300 字自动标注低置信度 |
| Format |
指纹 JSON v2:全部指标改为比率(每百句/每千字),跨文本可比 |
Recommended workflow | 推荐工作流
# 1. 提取作者指纹(建议 ≥300 字,多篇可用 merge 合并)
python3 style_fingerprint.py analyze --file author_a_1.txt --name 作者A
python3 style_fingerprint.py analyze --file author_a_2.txt --name 作者A2
python3 style_fingerprint.py merge --names "作者A,作者A2" --name 作者A综合
# 2. 导出风格指南(规则 + 范例句)给写作 Agent
python3 style_fingerprint.py export --name 作者A综合 --output style_guide.md
# 3. Agent 写作后,校验新稿是否还原了风格
python3 style_fingerprint.py compare --name 作者A综合 --file draft.txt
Notes | 注意
- 指纹保存在技能目录
fingerprints/ 下(自包含设计,拷贝技能即带走数据)
- <300 字的样本会标注 low_confidence,结论仅供参考
- compare 一致率是参考值:句式类维度 ±30% 内为 ✅
- 零外部依赖,Python 3.7+ 即可运行
檢視許可證全文(MIT)
MIT License
Copyright (c) 2026 Noah and AI Assistants
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.