collapse-score-lite
因果配平第四方程 —— 果标签(能量坍塌)文本检测与最佳遴选模块。
简介
业务职责说明:
- 本模块用于评估与遴选符合“果标签”规范的自然语言文本。通过语法结构分析、词性标注、
- 主观程度词提取以及客观事件/违规符号(如 '|' 和
@占位符)拦截,判定文本是否达到 - “纯粹终极主观能量坍塌态”。
核心判定规则:
- 符号拦截:严格禁止包含 '|' 和
@占位符,一旦存在直接判定为无效(扣100分)。 - 意志主体挂载:需具备清晰的意志主体(如人称代词、专有名词、人名)。
- 纯粹度评估:主观感受词/程度修饰词/内在属性与愿望表达越纯粹,评分越高;增损转折骨架作为次级扩展。
- 特长/愿望/属性放行:表达意志主体的特长、技能、缺点、兴趣爱好、愿望(如“廉颇希望为国杀敌”)判定为合格。
- 客观事件拦截:严禁混入纯客观实体动作与历史事件叙事(如“去了北京”、“买东西”),混入则扣分并判定无效。
不足和隐患
词库使用硬编码枚举,可能无法应对词库之外的情况,但是如果使用 LLM 动态提取,速度只怕又成问题。如果出现覆盖不到的情况,请手动扩充/修改 collapase_score_lite.py 中的词库。
安装
pip install collapse-score-lite
使用
from collapse_score_lite import get_best_outcome_label, OutcomeLabelEvaluator
candidates = [
"廉颇不讲信用,而且性格差",
"廉颇吃了一斗米",
"廉颇值得信任",
"廉颇骁勇善战",
"廉颇去了赵国",
]
# 遴选最佳文本
best = get_best_outcome_label(candidates, group=False, return_eval=False)
print(best)
# 详细评估报告
report = get_best_outcome_label(candidates, return_eval=True)
print(report)
# 单条评估
evaluator = OutcomeLabelEvaluator()
print(evaluator.evaluate("廉颇值得信任"))
接口
get_best_outcome_label(texts, group=False, return_eval=False):从候选文本列表中遴选最适合的果标签,或返回详细评估报告。OutcomeLabelEvaluator.evaluate(text):评估单条文本的能量坍塌程度与果标签规范度,返回{score, score_explanation, is_valid}。
Metadata
Release files for collapse-score-lite 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| collapse_score_lite-0.1.4.tar.gz | 6.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| collapse_score_lite-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / collapse_score_lite-0.1.4.tar.gz
| Download URL | collapse_score_lite-0.1.4.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4727968ee6d3f8ec7e321c828b80089fc9439ff044b1ef4ee279e85c1d0cf61
|
|
BLAKE2b-256 checksum How to use checksums |
4352b05ee7665de266059f7cdcb28dc34184933c98ffa5fd1e7ca4f8fdf63717
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / collapse_score_lite-0.1.4-py3-none-any.whl
| Download URL | collapse_score_lite-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3d91f6833fe175e5a17e1dd5eaff74d97bbbb7bf9c5acb941d9a18785ef6a40
|
|
BLAKE2b-256 checksum How to use checksums |
17f47cff8dcf5567b39518c306279f0dc7e6b8c9ad8bff6e1856b5e37e6dec69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Security for collapse-score-lite 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.