Files
ai-agent-book/book-vi/images/fig3-8.svg
T
liqiang b119135836
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s
ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
2026-08-20 13:12:50 +00:00

32 lines
6.3 KiB
XML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 40 800 340" width="800" height="340" style="background:#ffffff">
<defs><marker id="ah" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#333333" /></marker><marker id="ah-light" markerWidth="12" markerHeight="8" refX="12" refY="4" orient="auto"><polygon points="0 0, 12 4, 0 8" fill="#999999" /></marker></defs>
<rect x="40" y="50" width="720" height="50" rx="4" fill="#f5f5f5" stroke="#999999" stroke-width="2" />
<text x="60" y="75" font-family="'Courier New', Courier, monospace" font-size="16" fill="#333333" text-anchor="start" dominant-baseline="central">Score(Q,D) = Σ IDF(qi) × TF(qi,D)×(k1+1) / (TF + k1×(1-b+b×|D|/avgdl))</text>
<rect x="40" y="120" width="220" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="150" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold"><tspan x="150" dy="142.36">Độ bão hòa tần số</tspan><tspan x="150" dy="21.6">từ (TF)</tspan></text>
<line x1="60" y1="163" x2="240" y2="163" stroke="#999999" stroke-width="2" />
<text x="150" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="150" dy="183.4">k₁ kiểm soát tốc độ bão</tspan><tspan x="150" dy="17.28">hòa</tspan></text>
<text x="150" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="150" dy="217.96">Tần suất từ ​↑ nhưng</tspan><tspan x="150" dy="17.28">đóng góp giảm dần</tspan></text>
<text x="150" y="252.52" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Số lần xuất hiện tăng gấp đôi</text>
<text x="150" y="269.8" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Điểm không tăng gấp đôi</text>
<rect x="290" y="120" width="220" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="400" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold"><tspan x="400" dy="151">Tần số tài liệu</tspan><tspan x="400" dy="21.6">nghịch đảo (IDF)</tspan></text>
<line x1="310" y1="163" x2="490" y2="163" stroke="#999999" stroke-width="2" />
<text x="400" y="192.04" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">Đo độ hiếm của một từ</text>
<text x="400" y="209.32" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">"của" → IDF ≈ 0</text>
<text x="400" y="226.6" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">"Kết án" → IDF ≈ 5.2</text>
<text x="400" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="400" dy="243.88">Trọng lượng từ hiếm &gt;&gt; từ</tspan><tspan x="400" dy="17.28">thông dụng</tspan></text>
<rect x="540" y="120" width="220" height="170" rx="6" fill="#f0f0f0" stroke="#333333" stroke-width="2" />
<text x="650" y="144.52" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="20" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold">Chuẩn hóa độ dài (b)</text>
<line x1="560" y1="163" x2="740" y2="163" stroke="#999999" stroke-width="2" />
<text x="650" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="650" dy="163.96">b ∈ [0,1] Cường độ chuẩn</tspan><tspan x="650" dy="17.28">hóa</tspan></text>
<text x="650" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="650" dy="198.52">b=0: không xem xét độ</tspan><tspan x="650" dy="17.28">dài</tspan></text>
<text x="650" y="233.08" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal">b=1: chuẩn hóa hoàn toàn</text>
<text x="650" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="16" fill="#666666" text-anchor="middle" dominant-baseline="central" font-weight="normal"><tspan x="650" dy="250.36">Tránh thiên vị tài liệu</tspan><tspan x="650" dy="17.28">dài</tspan></text>
<line x1="150" y1="290" x2="150" y2="315" stroke="#999999" stroke-width="2" />
<line x1="400" y1="290" x2="400" y2="315" stroke="#999999" stroke-width="2" />
<line x1="650" y1="290" x2="650" y2="315" stroke="#999999" stroke-width="2" />
<rect x="40" y="315" width="720" height="48" rx="6" fill="#d0d0d0" stroke="#333333" stroke-width="2" />
<text x="400.0" y="0" font-family="Arial, 'Helvetica Neue', Helvetica, 'PingFang SC', 'Microsoft YaHei', sans-serif" font-size="17.59" fill="#333333" text-anchor="middle" dominant-baseline="central" font-weight="bold"><tspan x="400" dy="329.5">Điểm cuối = Σ [IDF × TF bão hòa đã chuẩn hóa</tspan><tspan x="400" dy="19">theo độ dài]</tspan></text>
</svg>