Chuyển đến nội dung
Skillpedia
Học máy48k · #4835

hugging-face-datasets

Skill này làm gì

Công cụ này giúp bạn tạo và quản lý tập dữ liệu (tập hợp thông tin) trên Hugging Face Hub. Bạn có thể dùng nó để truy vấn, chỉnh sửa và thậm chí tạo tập dữ liệu mới bằng các lệnh tương tự SQL.

Khi nào nên dùng

  • ✓Khi bạn cần tạo hoặc cập nhật một tập dữ liệu trên Hugging Face.
  • ✓Khi muốn tìm kiếm hoặc biến đổi dữ liệu trong tập dữ liệu bằng lệnh kiểu SQL.
  • ✓Để quản lý nội dung và siêu dữ liệu của một tập dữ liệu.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-datasets/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-datasets/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn tạo một tập dữ liệu mới với các câu hỏi dinh dưỡng từ tập 'cais/mmlu' và lưu nó với tên 'my-nutrition-dataset'.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bên trong, công cụ dùng các lệnh cụ thể để giao tiếp với Hugging Face Hub. Nó cho phép bạn viết truy vấn để chọn, lọc và sắp xếp dữ liệu, giống như làm việc với cơ sở dữ liệu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Overview

This skill provides tools to manage datasets on the Hugging Face Hub with a focus on creation, configuration, content management, and SQL-based data manipulation. It is designed to complement the existing Hugging Face MCP server by providing dataset editing and querying capabilities.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use

  • You need to create, configure, or update datasets on the Hugging Face Hub.
  • You want SQL-style querying, transformation, or export flows over Hub datasets.
  • You are managing dataset content and metadata directly rather than only searching existing datasets.

Python API Usage

from sql_manager import HFDatasetSQL

sql = HFDatasetSQL()

# Query
results = sql.query("cais/mmlu", "SELECT * FROM data WHERE subject='nutrition' LIMIT 10")

# Get schema
schema = sql.describe("cais/mmlu")

# Sample
samples = sql.sample("cais/mmlu", n=5, seed=42)

# Count
count = sql.count("cais/mmlu", where="subject='nutrition'")

# Histogram
dist = sql.histogram("cais/mmlu", "subject")

# Filter and transform
results = sql.filter_and_transform(
    "cais/mmlu",
    select="subject, COUNT(*) as cnt",
    group_by="subject",
    order_by="cnt DESC",
    limit=10
)

# Push to Hub
url = sql.push_to_hub(
    "cais/mmlu",
    "username/nutrition-subset",
    sql="SELECT * FROM data WHERE subject='nutrition'",
    private=True
)

# Export locally
sql.export_to_parquet("cais/mmlu", "output.parquet", sql="SELECT * FROM data LIMIT 100")

sql.close()

Example 1: Create Training Subset from Existing Dataset

# 1. Explore the source dataset
uv run scripts/sql_manager.py describe --dataset "cais/mmlu"
uv run scripts/sql_manager.py histogram --dataset "cais/mmlu" --column "subject"

# 2. Query and create subset
uv run scripts/sql_manager.py query \
  --dataset "cais/mmlu" \
  --sql "SELECT * FROM data WHERE subject IN ('nutrition', 'anatomy', 'clinical_knowledge')" \
  --push-to "username/mmlu-medical-subset" \
  --private

Example 2: Transform and Reshape Data

# Transform MMLU to QA format with correct answers extracted
uv run scripts/sql_manager.py query \
  --dataset "cais/mmlu" \
  --sql "SELECT question, choices[answer] as correct_answer, subject FROM data" \
  --push-to "username/mmlu-qa-format"

Example 3: Merge Multiple Dataset Splits

# Export multiple splits and combine
uv run scripts/sql_manager.py export \
  --dataset "cais/mmlu" \
  --split "*" \
  --output "mmlu_all.parquet"

Example 4: Quality Filtering

# Filter for high-quality examples
uv run scripts/sql_manager.py query \
  --dataset "squad" \
  --sql "SELECT * FROM data WHERE LENGTH(context) > 500 AND LENGTH(question) > 20" \
  --push-to "username/squad-filtered"

Example 5: Create Custom Training Dataset

# 1. Query source data
uv run scripts/sql_manager.py export \
  --dataset "cais/mmlu" \
  --sql "SELECT question, subject FROM data WHERE subject='nutrition'" \
  --output "nutrition_source.jsonl" \
  --format jsonl

# 2. Process with your pipeline (add answers, format, etc.)

# 3. Push processed data
uv run scripts/dataset_manager.py init --repo_id "username/nutrition-training"
uv run scripts/dataset_manager.py add_rows \
  --repo_id "username/nutrition-training" \
  --template qa \
  --rows_json "$(cat processed_data.json)"

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

Hugging Face Hub là gì?

Đó là nền tảng trực tuyến nơi mọi người chia sẻ và cộng tác trên mô hình AI và tập dữ liệu.

“Datasets” là gì?

Đây là tập hợp thông tin có tổ chức, như văn bản, hình ảnh hoặc số liệu, dùng để huấn luyện hoặc kiểm thử mô hình AI.

“Truy vấn kiểu SQL” nghĩa là gì?

Nghĩa là dùng một ngôn ngữ lệnh (SQL), thường dùng cho cơ sở dữ liệu, để tìm kiếm và xử lý dữ liệu trong tập dữ liệu.

Chi tiết

Mô tả gốc của tác giả

Create and manage datasets on Hugging Face Hub. Supports initializing repos, defining configs/system prompts, streaming row updates, and SQL-based dataset querying/transformation. Designed to work alongside HF MCP server for comprehensive dataset workflows.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4835
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự