Skip to content

Commit b8e3b5d

Browse files
committed
更新docs
1 parent cb27473 commit b8e3b5d

File tree

7 files changed

+60
-2
lines changed

7 files changed

+60
-2
lines changed

official/docs/advanced.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ sidebar_position: 4
236236

237237
#### openai temperature 设置
238238

239-
openai 的temperature参数用于调节语言模型的输出文本的随机性和创造性。设置较低的温度值(如 0.1 或 0.2)会生成更确定、一致且可预测的文本,而较高的温度值(如 0.8 或 1.0)则使输出更随机、多样化,增加文本的创造性。
239+
openai 的"temperature"参数用于调节语言模型的输出文本的随机性和创造性。设置较低的温度值(如 0.1 或 0.2)会生成更确定、一致且可预测的文本,而较高的温度值(如 0.8 或 1.0)则使输出更随机、多样化,增加文本的创造性。
240240

241241
具体设置在[开发设置](https://dash.immersivetranslate.com/#developer) -> Edit Full User Config 中,找到 `openai` 对应的字段,插入一条新字段 `temperature` 即可完成设置。
242242

@@ -526,6 +526,26 @@ export interface Rule {
526526
}
527527
```
528528

529+
530+
### 自定义翻译的令牌比例校验
531+
> 为规避大语言模型的"幻觉"现象,我们内置了一项翻译质量校验机制。程序会通过计算响应文本与请求文本的令牌(Token)比例来评估结果的合理性。如果该比例异常(过高或过低),翻译将被视为无效并触发备用方案。
532+
>
533+
> 若您在"自定义专家模式"中有意让模型输出与原文长度差异较大的内容(例如执行摘要、扩写等任务),则可能需要调整此校验设置。您可以通过以下选项覆盖默认行为,以确保自定义指令正常执行。
534+
>
535+
> 具体来说,您可以调整以下两个参数:
536+
> - `maxTokensRatio`:定义了响应文本与请求文本之间的最大允许令牌数比例。如果实际比例超过此设定值,系统会判定响应过长,并将其视为无效。
537+
> - `minTokensRatio`:定义了响应文本与请求文本之间的最小允许令牌数比例。如果实际比例低于此设定值,系统会判定响应过短,并将其视为无效。
538+
539+
```json
540+
...
541+
"translationServices": {
542+
"claude": {
543+
"maxTokensRatio": 8,
544+
"minTokensRatio": 0.21,
545+
}
546+
...
547+
```
548+
529549
### 修改默认翻译缓存自动清理时长
530550
插件针对翻译缓存,默认 30 天自动清除。目的是为了防止缓存过大,导致后续翻译卡顿。可以如下操作修改默认值
531551

@@ -552,7 +572,7 @@ export interface Rule {
552572
"systemPrompt": "あなたはプロフェッショナルで正確な翻訳エンジンです。翻訳されたテキストのみを返し、説明は一切行いません。",
553573
"prompt": "次のテキストを{{to}}に翻訳してください:\n\n<text>\n{{text}}\n</text>\n\n翻訳結果を直接出力し、追加のテキストやタグは一切含めないでください。",
554574
"multiplePrompt": "\"id\"フィールドと \"{{imt_source_field}}\" フィールドを含むYAML形式の入力が与えられます。以下が入力です:\n\n<yaml>\n{{yaml}}\n</yaml>\n\nYAMLの各エントリについて、\"{{imt_source_field}}\" フィールドの内容を {{to}} に翻訳してください。そのエントリの \"{{imt_source_field}}\" フィールドに翻訳結果を書き戻してください。\n\n以下は期待される形式の例です:\n\n{{normal_result_yaml_example}}\n\n追加のタグを一切含めずに、翻訳されたYAMLを直接返してください。",
555-
"subtitlePrompt": "YAML形式のビデオ字幕セットの \"{{imt_sub_source_field}}\" フィールドを {{to}} に翻訳します。以下がYAML形式の元の字幕です:\n\n<yaml_subtitles>\n{{yaml}}\n</yaml_subtitles>\n\n各字幕エントリの \"{{imt_sub_source_field}}\" フィールドのみを簡体字中国語に翻訳してください。\"id\" フィールドは翻訳や変更をしないでください。\n\n翻訳された字幕を同じYAML形式で出力し、各字幕エントリを一行ずつにしてください。\"id\" フィールドは変更せず、\"{{imt_sub_source_field}}\" フィールドに {{to}} の翻訳を含めてください。\n\n追加のタグを一切含めずに、翻訳されたYAMLを直接返してください。"
575+
"subtitlePrompt": "YAML形式のビデオ字幕セットの \"{{imt_sub_source_field}}\" フィールドを {{to}} に翻訳します。以下がYAML形式の元の字幕です:\n\n<yaml_subtitles>\n{{yaml}}\n</yaml_subtitles>\n\n各字幕エントリの \"{{imt_sub_source_field}}\" フィールドのみを簡体字中国語に翻訳してください。\"id\" フィールドは翻訳や変更をしないでください。\n\n翻訳された字幕を同じYAML形式で出力し、各字幕エントリを一行ずつにしてください。\"id\" フィールドは変更せず、\"{{imt_sub_source_field}}\" フィールドに {{to}} の翻訳を含めてください。\n\n請直接返回翻訳後の YAML,不要添加任何額外的標籤"
556576
},
557577
{
558578
"id": "auto2zh-TW",

official/docs/toggleTranslateAll.png

302 KB
Loading

official/docs/wechatLogin.png

148 KB
Loading

official/i18n/en-US/docusaurus-plugin-content-docs/current/advanced.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,25 @@ In 【[Developer Settings](https://dash.immersivetranslate.com/#developer)】->
526526
}
527527
```
528528

529+
### Custom Translation Token Ratio Validation
530+
> To mitigate the "hallucination" phenomenon of Large Language Models, we have a built-in translation quality validation mechanism. The program evaluates the reasonableness of the result by calculating the token ratio between the response text and the request text. If this ratio is abnormal (too high or too low), the translation will be considered invalid and a fallback will be triggered.
531+
>
532+
> If you intend for the model to output content with a length significantly different from the original text in "Custom Expert Mode" (e.g., for tasks like summarization or expansion), you may need to adjust this validation setting. You can override the default behavior with the following options to ensure your custom instructions execute correctly.
533+
>
534+
> Specifically, you can adjust the following two parameters:
535+
> - `maxTokensRatio`: Defines the maximum allowed token ratio between the response text and the request text. If the actual ratio exceeds this value, the system will deem the response too long and consider it invalid.
536+
> - `minTokensRatio`: Defines the minimum allowed token ratio between the response text and the request text. If the actual ratio is below this value, the system will deem the response too short and consider it invalid.
537+
538+
```json
539+
...
540+
"translationServices": {
541+
"claude": {
542+
"maxTokensRatio": 8,
543+
"minTokensRatio": 0.21,
544+
}
545+
...
546+
```
547+
529548
### Modify Default Translation Cache Auto-Cleanup Duration
530549
The plugin defaults to automatically clearing the translation cache every 30 days. The purpose is to prevent the cache from becoming too large, which could cause subsequent translations to lag. You can modify the default value as follows:
531550

Loading

official/i18n/zh-TW/docusaurus-plugin-content-docs/current/advanced.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,25 @@ export interface Rule {
526526
}
527527
```
528528

529+
### 自訂翻譯的權杖比例校驗
530+
> 為規避大型語言模型的「幻覺」現象,我們內建了一項翻譯品質校驗機制。程式會透過計算回應文字與請求文字的權杖(Token)比例來評估結果的合理性。如果該比例異常(過高或過低),翻譯將被視為無效並觸發備用方案。
531+
>
532+
> 若您在「自訂專家模式」中有意讓模型輸出與原文長度差異較大的內容(例如執行摘要、擴寫等任務),則可能需要調整此校驗設定。您可以透過以下選項覆蓋預設行為,以確保自訂指令正常執行。
533+
>
534+
> 具體來說,您可以調整以下兩個參數:
535+
> - `maxTokensRatio`:定義了回應文字與請求文字之間的最大允許權杖數比例。如果實際比例超過此設定值,系統會判定回應過長,並將其視為無效。
536+
> - `minTokensRatio`:定義了回應文字與請求文字之間的最小允許權杖數比例。如果實際比例低於此設定值,系統會判定回應過短,並將其視為無效。
537+
538+
```json
539+
...
540+
"translationServices": {
541+
"claude": {
542+
"maxTokensRatio": 8,
543+
"minTokensRatio": 0.21,
544+
}
545+
...
546+
```
547+
529548
### 修改預設翻譯快取自動清理時長
530549
擴充功能針對翻譯快取,預設 30 天自動清除。目的是為了防止快取過大,導致後續翻譯卡頓。可以如下操作修改預設值
531550

Loading

0 commit comments

Comments
 (0)