返回 Skill 列表
extension
分类: 开发与工程无需 API Key

multi-dataset-unification-pipeline

当用户请求查找、分析并合并来自Hugging Face或类似仓库的多个数据集到一个统一格式时。此技能处理整个流程,包括搜索数据集、检查其结构、解析格式规范、将各种数据集格式(如ToolACE、Glaive、XLAM等)转换为标准化模式,并将它们合并成一个输出文件。关键触发词包括涉及'数据集统一'、'格式转换'、'合并数据集'、'Hugging Face数据集'、'工具调用数据集'、'JSONL输出'的请求,或者用户提供像'unified_format.md'这样的格式规范文档时。

person作者: jakexiaohubgithub

Instructions

1. Understand the Request

  • Identify the target datasets (names, IDs, or search queries).
  • Locate and read any provided format specification (e.g., unified_format.md).
  • Clarify the scope: number of entries per dataset, output file name/location.

2. Search and Validate Datasets

  • Use huggingface-dataset_search to find each dataset.
  • Use huggingface-hub_repo_details to get metadata and confirm availability.
  • Note the dataset size and structure.

3. Analyze Dataset Structures

  • Load a sample from each dataset using datasets.load_dataset.
  • Examine the column names and a few sample entries.
  • Identify the native format (e.g., ToolACE uses system/conversations, Glaive uses conversations/tools, XLAM uses query/answers/tools).

4. Convert to Unified Format

  • Always refer to the provided unified_format.md (or equivalent) for the target schema.
  • Key Rules:
    • conversation_id: Format as {source_short_name}_{index} (e.g., toolace_0).
    • messages: List of messages with role (user/assistant/tool), content, and optionally tool_calls or tool_call_id.
    • tool_calls: For assistant messages, include id (format tool_call_{n}), name, arguments.
    • tools: List of normalized tool definitions.
    • Remove system messages if they only contain tool instructions.
    • If assistant only made tool calls, set content to null.
    • Do not add tool return results or assistant replies not in the original data.
  • Use the bundled scripts/convert_and_merge.py for reliable, deterministic conversion of ToolACE, Glaive, and XLAM formats.
  • For new dataset formats, write a custom converter following the patterns in the script.

5. Merge and Output

  • Limit entries per dataset as requested (default: first 500).
  • Merge all converted entries into a single list.
  • Write to a JSONL file in the workspace (default: unified_tool_call.jsonl).
  • Verify the output: count entries, check file size, validate format against the specification.

6. Finalize

  • Provide a summary: datasets found, entries converted, output location.
  • Optionally, show a sample entry from each source for validation.
  • Confirm the task is complete.