OpenParable
Skip to content
← Back to skills

Scichem Normalizer

Documents
scichem_normalizer

Scichem Normalizer is an Agent Skill for documents published in the cas-bigdatalab/piflow repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

科学公式/化学式规整 Skill:统一文本列中的数学符号、Unicode 上下标、化学反应箭头、全角 ASCII 和多余空格。 适用于实验记录、论文摘录、化学反应式和科学公式文本;不负责公式语义解析、单位换算或化学配平。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/cas-bigdatalab/piflow/blob/HEAD/workspace/skills/scichem_normalizer/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/scichem-normalizer, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

SciChem Normalizer 科学公式化学式规整 Skill

功能概述

本 skill 对结构化数据中的科学公式和化学式文本做轻量规整:将特殊加减乘除、全角 ASCII、括号和等号转换为标准 ASCII;将 Unicode 上标/下标转为 ^/_ 标记;将反应箭头统一为 -> 或 <->;折叠多余空格。

触发条件

当用户请求以下任务时,应使用此 skill:

  • 科学公式符号规整
  • 化学式上下标清洗
  • 反应箭头统一
  • 实验记录中的公式文本标准化

核心参数说明

必需参数

参数说明
--input_path输入 CSV/TSV/Excel 等结构化文件路径
--output_path输出结构化文件路径

可选参数

参数说明默认值
--text_columns处理的文本列,逗号分隔;不填则处理全部字符串列全部字符串列

输入文件格式

id	text
1	The reaction H₂ + O₂ → H₂O releases energy.
2	Concentration was 5 × 10⁻³ mol/L.

使用方法

python scripts/scichem_normalizer.py \
  --input_path input.tsv \
  --output_path output.csv \
  --text_columns text

处理示例

输入文本输出文本
H₂ + O₂ → H₂OH_2 + O_2 -> H_2O
5 × 10⁻³ mol/L5 * 10^-3 mol/L
Already ASCII formula H2OAlready ASCII formula H2O

输出示例

id,text
1,H_2 + O_2 -> H_2O
2,5 * 10^-3 mol/L

环境要求

依赖 Python、pandas,以及本仓库 DC 公用 data_io 读写工具。

注意事项

  1. 该 skill 做符号级规整,不做化学方程式配平或科学公式语义解析。
  2. Unicode 上下标会转换为 ^/_ 文本标记,需确保后续流程接受这种表示。
  3. 单位换算、科学计数法数值换算不属于本 skill。