Skip to content

[Docs] Fix English comma punctuation in Chinese API documentation#7814

Closed
ooooo-create wants to merge 1 commit intoPaddlePaddle:developfrom
StatefulDust:fix/cn-punctuation-in-api-docs-1772296950-06ee9b31f5216990
Closed

[Docs] Fix English comma punctuation in Chinese API documentation#7814
ooooo-create wants to merge 1 commit intoPaddlePaddle:developfrom
StatefulDust:fix/cn-punctuation-in-api-docs-1772296950-06ee9b31f5216990

Conversation

@ooooo-create
Copy link
Collaborator

Summary

Fixed Chinese punctuation violations in 3 API documentation files. According to the repository's documentation standards, Chinese documents should use Chinese punctuation symbols (,。()etc.) instead of English ones (, . () etc.).

Files Changed

docs/api/paddle/nanquantile_cn.rst

  • Fixed: , 忽略元素中的,忽略元素中的

docs/api/paddle/random__cn.rst

  • Fixed: 占位参数,当前未实现占位参数,当前未实现

docs/api/paddle/nn/functional/scaled_dot_product_attention_cn.rst

  • Fixed 其中, 其中,
  • Fixed (Tensor, 可选)(Tensor,可选)
  • Fixed multiple instances of , 默认值为,默认值为
  • Fixed (str, 可选)(str,可选)
  • Fixed 欲了解更多信息, 请参阅欲了解更多信息,请参阅

Documentation Standard Reference

Per .github/copilot-instructions.md:

中文文档中尽量避免使用英文标点符号,如逗号、句号、引号等,均应使用中文标点符号

Translation: Chinese documents should avoid English punctuation marks (commas, periods, quotation marks, etc.) and should use Chinese punctuation marks instead.

Generated by API Docs Checker


🔄 Synced from StatefulDust#23

Replace English commas with Chinese commas(,)in Chinese API documentation
for three files, following the documentation standard that states Chinese
documents should use Chinese punctuation symbols, not English ones.

Files fixed:
- docs/api/paddle/nanquantile_cn.rst: Fix English comma in description
- docs/api/paddle/random__cn.rst: Fix English comma in parameter description
- docs/api/paddle/nn/functional/scaled_dot_product_attention_cn.rst: Fix
  multiple English commas in description and parameter definitions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@paddle-bot
Copy link

paddle-bot bot commented Mar 1, 2026

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7814.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

📚 本次 PR 文档预览链接(点击展开)
ℹ️ 预览提醒
请等待 Docs-NEW 流水线运行完成后再点击预览链接,否则可能会看到旧版本内容或遇到链接无法访问的情况。

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 旨在按仓库中文文档规范,修复中文 API 文档中英文标点(主要是逗号)带来的排版与一致性问题,提升 Sphinx 文档渲染质量与可读性。

Changes:

  • 将中文 API 文档中的英文逗号 , 替换为中文逗号 ,并去除不必要的标点后空格。
  • 统一部分参数描述中的逗号用法(如 “默认值为” 等句式)。
  • 修正部分段落的中文标点风格(如 “其中,”、“欲了解更多信息, 请参阅” 等)。

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
docs/api/paddle/nanquantile_cn.rst 将分隔逗号改为中文逗号,改善中文标点一致性。
docs/api/paddle/random__cn.rst 将参数说明中的英文逗号改为中文逗号。
docs/api/paddle/nn/functional/scaled_dot_product_attention_cn.rst 批量替换英文逗号为中文逗号并清理逗号后的空格,提升中文排版一致性。

.. py:function:: paddle.nanquantile(x, q, axis=None, keepdim=False, interpolation='linear', name=None)

沿给定的轴 ``axis`` 计算 ``x`` 中元素的分位数, 忽略元素中的 ``NaN`` 。
沿给定的轴 ``axis`` 计算 ``x`` 中元素的分位数忽略元素中的 ``NaN`` 。
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NaN” 后面的中文句号前多了一个空格(“NaN 。”),中文排版通常不应在标点前留空格;建议去掉该空格。

Suggested change
沿给定的轴 ``axis`` 计算 ``x`` 中元素的分位数,忽略元素中的 ``NaN``
沿给定的轴 ``axis`` 计算 ``x`` 中元素的分位数,忽略元素中的 ``NaN``。

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 22
- **query** (Tensor) - 注意力模块中的查询张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
- **key** (Tensor) - 注意力模块中的关键张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
- **value** (Tensor) - 注意力模块中的值张量。具有以下形状的四维张量: [batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数说明里的数据类型写成了 “float61”,与上方 warning(float16/bfloat16)以及返回值描述不一致,应该是 “float16” 的笔误;建议统一为 float16。

Suggested change
- **query** (Tensor) - 注意力模块中的查询张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
- **key** (Tensor) - 注意力模块中的关键张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
- **value** (Tensor) - 注意力模块中的值张量。具有以下形状的四维张量: [batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float61 或 bfloat16。
- **query** (Tensor) - 注意力模块中的查询张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float16 或 bfloat16。
- **key** (Tensor) - 注意力模块中的关键张量。具有以下形状的四维张量:[batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float16 或 bfloat16。
- **value** (Tensor) - 注意力模块中的值张量。具有以下形状的四维张量: [batch_size, seq_len, num_heads, head_dim],或者三维张量:[seq_len, num_heads, head_dim]。数据类型可以是 float16 或 bfloat16。

Copilot uses AI. Check for mistakes.
- **attn_mask** (Tensor可选) - 与添加到注意力分数的 ``query``、 ``key``、 ``value`` 类型相同的浮点掩码默认值为空。
- **dropout_p** (float) - ``dropout`` 的比例默认值为 0.00 即不进行正则化。
- **is_causal** (bool) - 是否启用因果关系默认值为 False 即不启用。
- **training** (bool): - 是否处于训练阶段默认值为 True 即处于训练阶段。
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参数列表里 “training (bool): -” 的 “(bool)” 后多了一个冒号,和同段其它参数的写法不一致,也可能影响 Sphinx 渲染;建议改为与其它条目一致的 “training (bool) - ...”。

Suggested change
- **training** (bool): - 是否处于训练阶段,默认值为 True 即处于训练阶段。
- **training** (bool) - 是否处于训练阶段,默认值为 True 即处于训练阶段。

Copilot uses AI. Check for mistakes.
@@ -15,7 +15,7 @@ random_ 为 Inplace 版本实现,对输入 `x` 采用 Inplace 策略。
- **x** (Tensor) - 输入多维 Tensor,可选的数据类型为 'int32'、'int64'、'float32'、'float64'、'float16'、'bfloat16'。
- **from** (int,可选) - 生成随机值的范围下限,默认为 0。。
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的默认值描述末尾出现了重复句号(“0。。”),会影响文档质量;建议改为单个中文句号“0。”。

Suggested change
- **from** (int,可选) - 生成随机值的范围下限,默认为 0。
- **from** (int,可选) - 生成随机值的范围下限,默认为 0。

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants