← Back to Skills Marketplace
wangminrui2022

funasr-punctuation-restore

by 顶尖王牌程序员 · GitHub ↗ · v1.0.6 · MIT-0
cross-platform ⚠ suspicious
246
Downloads
0
Stars
0
Active Installs
7
Versions
Install in OpenClaw
/install funasr-punctuation-restore
Description
当用户想要**给文本恢复标点**、**ASR 转录结果加标点**、**无标点文本加标点**、**转录文本整理标点**、**批量给文件或目录加标点**时自动触发。 使用 FunASR ct-punc 模型,为一段文本、单个记事本文件(.txt)、或整个目录一键恢复中文/英文标点符号。 支持直接输入文本、单个文件路径...
README (SKILL.md)

\r \r

Funasr-Punctuation-Restore\r

\r 功能:使用 FunASR ct-punc 模型一键恢复标点(支持文本/文件/目录)。目录模式会在同级创建结构完全一致的 _punctuated 镜像目录(原目录不变)。支持 GPU 加速 + 自动清理显存。\r \r

触发时机(Triggers)\r

  • 用户提供一段没有标点或标点不全的文本,要求“加标点”“恢复标点”“整理标点”。\r
  • 用户提供 .txt 文件路径或整个文件夹,要求批量处理。\r
  • 常用于 ASR(语音转文字)后的后处理场景。\r
  • 支持直接粘贴文本、单个文件、或整个目录。\r \r

支持的模型(推荐顺序)\r

  1. punc_ct-transformer_cn-en-common-vocab471067-large → 基于 Transformer 的中英文混合文本标点恢复模型,适合 ASR 结果自动加标点。\r \r

参数提取指南\r

当决定调用此技能时,请从用户上下文中提取以下参数:\r

  1. --text "\x3C文本内容>" (如果用户直接提供了文本)\r
  2. --file "\x3C文件路径>" (如果用户提供了单个 .txt 文件路径)\r
  3. --dir "\x3C目录路径>" (如果用户提供了文件夹路径,会批量处理)\r \r

执行步骤\r

  1. 解析输入:识别用户是提供了文本、单个文件,还是整个目录。\r
  2. 默认目标:若未指定输出路径,默认在输入同级创建 [原文件名]_punctuated.txt_punctuated 目录(原文件/目录保持不变)。\r
  3. 调用命令:使用以下兼容性命令启动脚本(优先 python3,失败则 python)。脚本会自动创建虚拟环境、检测 GPU 并安装对应版本。\r \r
    (python3 scripts/punctuation_restore.py (--text "\x3C文本内容>" | --file "\x3C文件路径>" | --dir "\x3C目录路径>")) || (python scripts/punctuation_restore.py (--text "\x3C文本内容>" | --file "\x3C文件路径>" | --dir "\x3C目录路径>"))
    
Usage Guidance
What to consider before installing/running this skill: - It will perform network downloads (PyPI, ModelScope, PyTorch wheels) and may install large packages (torch) and a model (~GBs). Expect significant disk, network, and time use. - The code forcibly downgrades setuptools (pip install setuptools<=81.2.0) as soon as the module is imported; that modifies the current Python environment before any isolated venv is created. If you run this inside a shared/system Python, that can break other tooling. - The venv is created at a parent-level path (VENV_DIR), likely shared across skills; this can modify a shared environment. Consider running the skill only in an isolated container or explicitly editing config to point VENV_DIR to a directory you control. - The script will probe system interfaces (nvidia-smi) and may run subprocesses; review and run in a sandbox if you don't trust network installs. - If you want to proceed safely: run the code in an isolated VM/container, or modify the code so installs happen inside a pre-created isolated venv (and remove the global setuptools downgrade), or run manually after auditing the pip targets and model URLs. - Things that would make this benign: removing import-time global pip actions (no global setuptools change), creating the venv inside the skill folder (not a shared parent venv), and documenting all runtime installs in SKILL.md so the user understands network and environment changes.
Capability Analysis
Type: OpenClaw Skill Name: funasr-punctuation-restore Version: 1.0.6 The skill provides punctuation restoration using the FunASR framework. It includes robust environment management scripts (env_manager.py and ensure_package.py) that automate the creation of a virtual environment, detect NVIDIA GPUs for acceleration, and install necessary dependencies like PyTorch and FunASR. While the skill performs significant automated setup and downloads models from ModelScope, these actions are transparently documented and align with the stated purpose of running local AI inference. No indicators of data exfiltration, malicious persistence, or prompt injection were identified.
Capability Assessment
Purpose & Capability
The skill's functionality (punctuation restoration) matches use of FunASR and model downloads, but the code also downgrades setuptools and runs pip installs using the current Python interpreter at import time. These global changes and shared venv placement (VENV_DIR is outside the skill folder) are not necessary for the simple stated task and are disproportionate.
Instruction Scope
SKILL.md documents running scripts with --text/--file/--dir and creating a local venv. However, the implementation performs additional actions not clearly described: it invokes ensure_package at import time (which triggers global pip installs and setuptools modification), probes system NVIDIA tools (nvidia-smi), and can walk arbitrary directories when processing a --dir. The import-time side effects (package installs) are not mentioned in the runtime instructions.
Install Mechanism
There is no formal install spec, but the code will dynamically pip install multiple packages and download remote model artifacts from ModelScope and PyTorch wheel hosts at runtime. That network-based install behavior is expected for model-backed tools, but the fact that ensure_package.forcefully modifies setuptools and performs pip installs before creating an isolated venv increases risk and surprises users.
Credentials
The skill requests no explicit credentials, but it modifies the runtime environment: fix_setuptools_for_legacy_packages() runs at import time and issues a pip install to force setuptools<=81.2.0 using the running interpreter, and ensure_package.pip may install packages into the current environment. VENV_DIR points to a parent-level 'venv' (potentially a shared location), which may alter/override other skills or system behaviour — this is disproportionate for a punctuation-only skill.
Persistence & Privilege
always:false and user-invocable:true (normal), but the skill persists large artifacts: it creates a venv (in a shared location), caches models under models/, and writes logs to LOG_DIR. Creating/updating a shared venv and downgrading setuptools increases long-term impact on the host environment.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install funasr-punctuation-restore
  3. After installation, invoke the skill by name or use /funasr-punctuation-restore
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.6
Version 1.0.6 - No changes to files were detected in this release. - Functionality and documentation remain the same as the previous version.
v1.0.5
- No changes in code or documentation; version bump only. - All features and usage remain the same as previous version.
v1.0.4
- No changes detected in this version; documentation and functionality remain unchanged.
v1.0.3
- Expanded the description to clarify trigger scenarios and common user requests. - Added rich examples of natural language triggers for better discoverability and guidance. - Highlighted important constraints: skill handles only text punctuation restoration (not audio, translation, or other NLP tasks). - Provided a clear parameter extraction guide for when and how to invoke the skill. - No changes to code or core behavior; this is a documentation and usability update.
v1.0.2
- No changes detected in this version. - Functionality, usage instructions, and metadata remain unchanged.
v1.0.1
- Fixed documentation: corrected code block in usage instructions to close the parentheses properly. - No code or functional changes.
v1.0.0
Funasr-Punctuation-Restore v1.0.0 - Initial release. - Provides one-click punctuation restoration for text, single files, or entire directories using FunASR ct-punc model. - Supports Chinese-English mixed text with the punc_ct-transformer_cn-en-common-vocab471067-large model. - Automatically creates a punctuated output (file or directory), preserving the original files. - Supports GPU acceleration and automated GPU memory management. - Easy execution: automatically handles virtual environment setup and runs with python3 or python as fallback.
Metadata
Slug funasr-punctuation-restore
Version 1.0.6
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 7
Frequently Asked Questions

What is funasr-punctuation-restore?

当用户想要**给文本恢复标点**、**ASR 转录结果加标点**、**无标点文本加标点**、**转录文本整理标点**、**批量给文件或目录加标点**时自动触发。 使用 FunASR ct-punc 模型,为一段文本、单个记事本文件(.txt)、或整个目录一键恢复中文/英文标点符号。 支持直接输入文本、单个文件路径... It is an AI Agent Skill for Claude Code / OpenClaw, with 246 downloads so far.

How do I install funasr-punctuation-restore?

Run "/install funasr-punctuation-restore" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is funasr-punctuation-restore free?

Yes, funasr-punctuation-restore is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does funasr-punctuation-restore support?

funasr-punctuation-restore is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created funasr-punctuation-restore?

It is built and maintained by 顶尖王牌程序员 (@wangminrui2022); the current version is v1.0.6.

💬 Comments