Skip to content
Back to skills

Calibrate Response Mapper

ASecurity

基于参考文本校准问答对中的响应。当用户提到校准回答、校准响应、语言风格校准、回答优化等需求时使用此skill。 即使用户没有明确说出"校准",只要任务涉及根据参考文本调整问答对中的回答,就应该使用此skill。

  • 539 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
ai-agentspythonbashapi

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 5 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add cas-bigdatalab/piflow --skill calibrate_response_mapper --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Calibrate Response Mapper?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Calibrate Response Mapper
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cas-bigdatalab-calibrate-response-mapper/badge)](https://www.skillsdirectory.com/skills/cas-bigdatalab-calibrate-response-mapper)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: calibrate_response_mapper
description: |
  基于参考文本校准问答对中的响应。当用户提到校准回答、校准响应、语言风格校准、回答优化等需求时使用此skill。
  即使用户没有明确说出"校准",只要任务涉及根据参考文本调整问答对中的回答,就应该使用此skill。

name_zh: 基于参考文本校准问答对中的响应算子
input_params:
  - name: input_path
    type: string
    required: true
    description: 输入JSON文件路径

  - name: output_path
    type: string
    required: true
    description: 输出JSON文件路径

  - name: api_model
    type: string
    required: true
    description: LLM模型名称,如 'qwen2.5-72b-instruct'

  - name: api_endpoint
    type: string
    required: false
    description: API端点URL

  - name: response_path
    type: string
    required: false
    default: choices.0.message.content
    description: 响应内容路径

output_params:
  - name: output_path
    type: json_file
    description: 校准后的JSON文件,包含校准后的response字段
tag: 数据转换
publisher: COMMUNITY
---

# Calibrate Response Mapper

基于参考文本校准问答对中的响应(回答),使回答更加详细、准确,并贴合参考文本的语言风格。

本SKILL使用依赖data_juicer,请在调用前安装好python环境并安装data_juicer,你可用同以下指令进行安装:
```
pip install py-data-juicer
```

## 核心参数

| 参数 | 类型 | 必填 | 默认值 | 说明 |
|------|------|------|--------|------|
| input_path | string | 是 | - | 输入JSON文件路径 |
| output_path | string | 是 | - | 输出JSON文件路径 |
| api_model | string | 是 | - | LLM模型名称,如 'qwen2.5-72b-instruct' |
| api_endpoint | string | 否 | - | API端点URL |
| response_path | string | 否 | choices.0.message.content | 响应内容路径 |

## 使用方法

```bash
python scripts/run_calibrate_response_mapper.py --input_path <input_path> --output_path <output_path> --api_model <model_name> [--api_endpoint <endpoint>] [--response_path <path>]
```

## 实现原理

参照测试代码 test_calibrate_response_mapper.py 中的 `_run_op` 函数:

```python
# 1. 初始化算子(必须指定api_model)
op = CalibrateResponseMapper(api_model='qwen2.5-72b-instruct')

# 2. 将数据转为Dataset,使用 op.run(dataset) 处理
dataset = Dataset.from_list(samples)
result_dataset = op.run(dataset)
```

## 输入输出格式

### 输入格式 (JSON数组)

```json
[
  {
    "text": "参考文本,包含语言风格示例...",
    "query": "原始问题",
    "response": "原始回答"
  }
]
```

### 输出格式 (JSON数组)

```json
[
  {
    "text": "参考文本,包含语言风格示例...",
    "query": "原始问题",
    "response": "校准后的回答"
  }
]
```

注意:此算子只校准 response 字段,query 字段保持不变。

## 示例

```bash
python scripts/run_calibrate_response_mapper.py --input_path example_input.json --output_path output.json --api_model "qwen2.5-72b-instruct"
```

## 注意事项

- **必须设置环境变量**:使用前需设置 API key
  ```bash
  export OPENAI_API_KEY=your_api_key
  # 或
  export DASHSCOPE_API_KEY=your_api_key
  ```
- api_model 参数必须指定
- 输入数据需要包含 text(参考)、query(问题)、response(回答)三个字段
- 该算子只校准回答(response),问题(query)保持不变
- 该算子调用 LLM API,可能需要较长时间

Files in this skill

  • SKILL.md3.4 KB
  • assets/icon.png13.6 KB
  • scripts/example_input.json698 B
  • scripts/run_calibrate_response_mapper.py2.5 KB
  • skill.json1.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…