build-context-token-vectors
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuild context token vectors
构建上下文令牌向量
A benchmark is only as good as what it compares against, and
takes its comparison set by hand. This derives one.
tools/token_bench.py基准测试的质量取决于其对比对象,而需要手动指定对比集。本工具可自动生成对比集。
tools/token_bench.pyRun it
运行方式
bash
python3 -m venv /tmp/vectors
/tmp/vectors/bin/pip install evoc model2vec matplotlib
/tmp/vectors/bin/python check/build-context-token-vectors/scripts/vectors.py --serve--serve--port8932--out <file>matplotlibevocevoc.label_propagationimport evoc--root~/.agents/skills--modelminishlab/potion-base-8M-kbash
python3 -m venv /tmp/vectors
/tmp/vectors/bin/pip install evoc model2vec matplotlib
/tmp/vectors/bin/python check/build-context-token-vectors/scripts/vectors.py --serve--serve--port--out <file>matplotlibevocevoc.label_propagationimport evoc--root~/.agents/skills--modelminishlab/potion-base-8M-kTune it
参数调优
Every EVoC parameter is both a flag and a live control. Only values you set are
passed, so a run that changed nothing says rather than looking
tuned. Empty live controls restore the corresponding default.
EVoC defaults| Flag | Turns |
|---|---|
| How many points make a cluster. Lower splits, higher merges. |
| The kNN graph's width. Lower sees local structure, higher sees global. |
| The density estimate. |
| How readily a point is called noise. |
| The node embedding, and where layers separate. |
The useful act is comparing two settings, never trusting one:
EVoC defaults 8 clusters, 49 noise
--base-min-cluster-size 3 --n-neighbors 10 9 clusters, 53 noise
--noise-level 0.2 7 clusters, 39 noiseThe page prints the settings behind its current result, so a screenshot still
says what produced it.
所有EVoC参数既可用作命令行标志,也可作为实时控制项。仅会传递你设置的值,因此未做任何修改的运行会显示而非已调优状态。清空实时控制项将恢复对应参数的默认值。
EVoC defaults| 标志 | 作用 |
|---|---|
| 构成一个聚类所需的点数。值越小聚类越分散,值越大聚类越集中。 |
| kNN图的宽度。值越小越关注局部结构,值越大越关注全局结构。 |
| 密度估计值。 |
| 判定点为噪声的阈值。 |
| 节点嵌入参数,以及层分隔的阈值。 |
有效的做法是对比两种设置,而非轻信单一结果:
EVoC defaults 8 clusters, 49 noise
--base-min-cluster-size 3 --n-neighbors 10 9 clusters, 53 noise
--noise-level 0.2 7 clusters, 39 noise页面会打印当前结果对应的设置参数,因此截图也能说明该结果的生成条件。
Explore it
探索功能
The dashboard is not a report. Switch layer to move between the resolutions
EVoC found, coarsest first. Rail organizes known skills as , ,
, , then the and aids; this is display metadata and
never changes the vectors. Filter to Local, All, or Noise. Search by
skill name, by a peer's name, or by a cluster id such as . Click any point or
row to inspect one skill: its membership strength, its full neighbour list, and
every other member of its cluster at the current layer.
firstbuildlandcheckkitfixc4该仪表盘并非报告。切换layer可在EVoC识别出的不同分辨率间切换,从最粗粒度开始。Rail将已知skill分为、、、,以及和辅助类;这仅为展示元数据,不会更改向量数据。可筛选Local(本地)、All(全部)或Noise(噪声)。可按skill名称、同类skill名称或聚类ID(如)进行搜索。点击任意点或行可查看单个skill的详情:其成员强度、完整邻居列表,以及当前层级下所属聚类的所有其他成员。
firstbuildlandcheckkitfixc4Read it
结果解读
| Output | Means |
|---|---|
| Cosine similarity | How close two skills' doctrine sits. Roughly: above 0.80 a real peer, 0.65 to 0.80 a loose one, below 0.65 no peer at all. |
| A cluster tag | The skill was placed, and the other members of that cluster are its neighbourhood. |
| It was placed nowhere. |
| The scatter plot | Two principal components, for orientation only. Clustering ran in full dimensionality, so two points that look adjacent may not be. The neighbour table carries the real numbers. |
noiseSKILL.md| 输出项 | 含义 |
|---|---|
| Cosine similarity | 衡量两个skill的规则(doctrine)相近程度。大致标准:0.80以上为真正的同类skill,0.65至0.80为松散同类,0.65以下则无同类skill。 |
| 聚类标签 | 该skill被归入某一聚类,该聚类的其他成员为其同类群体。 |
| 该skill未被归入任何聚类。 |
| 散点图 | 两个主成分,仅用于定位参考。聚类是在全维度空间中运行的,因此看起来相邻的两个点实际可能并不相近。邻居表格中的数据才是真实的相似度数值。 |
noiseSKILL.mdThe seed is not tuning
随机种子不属于调优范畴
EVoC is stochastic. Without two runs over identical input return
different labels, and a comparison set that changes per run is not one.
is declared in the script and is part of any result worth quoting.
random_stateSEEDEVoC是随机算法。若未设置,对相同输入的两次运行会返回不同的标签,而每次运行都变化的对比集不能称为稳定的对比集。脚本中声明的是任何可引用结果的一部分。
random_stateSEEDWhat it will not do
不支持的功能
The live companion writes nothing. A deliberate writes only its page.
Neither mode authors a , edits , ranks a skill, or
records a judgement. Reading it may change which comparison you run next;
nothing here runs one.
--out--flowtoken_bench.pyIts three dependencies live in a virtual environment you create. Nothing under
or imports them, and this skill ships none of
them.
first/aesthetic/scripts/tools/实时配套工具不会写入任何数据。显式使用参数仅会生成对应页面的快照。两种模式均不会生成、编辑、对skill进行排名或记录判断结果。解读结果可能会改变你接下来要运行的对比测试,但本工具本身不会执行任何对比测试。
--out--flowtoken_bench.py本工具的三个依赖项需安装在你创建的虚拟环境中。或下的任何文件均不会导入这些依赖,且本skill未附带这些依赖项。
first/aesthetic/scripts/tools/