jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ HuggingFaceデータセットビューア

hugging-face-dataset-viewer

Hugging Faceの膨大なデータセットから、

⏱ RAG構築 1週間 → 1日

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Query Hugging Face datasets through the Dataset Viewer API for splits, rows, search, filters, and parquet links.

🇯🇵 日本人クリエイター向け解説

一言でいうと

Hugging Faceの膨大なデータセットから、

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o hugging-face-dataset-viewer.zip https://jpskill.com/download/2988.zip && unzip -o hugging-face-dataset-viewer.zip && rm hugging-face-dataset-viewer.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/2988.zip -OutFile "$d\hugging-face-dataset-viewer.zip"; Expand-Archive "$d\hugging-face-dataset-viewer.zip" -DestinationPath $d -Force; ri "$d\hugging-face-dataset-viewer.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して hugging-face-dataset-viewer.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → hugging-face-dataset-viewer フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Hugging Face Dataset Viewer を使って、最小構成のサンプルコードを示して
  • Hugging Face Dataset Viewer の主な使い方と注意点を教えて
  • Hugging Face Dataset Viewer を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Hugging Face Dataset Viewer

使用する場面

このスキルは、Dataset Viewer API を通じて Hugging Face データセットを読み取り専用で探索する必要がある場合に使用します。

このスキルは、データセットの探索と抽出のために、読み取り専用の Dataset Viewer API 呼び出しを実行するために使用します。

コアワークフロー

  1. オプションで、/is-valid を使用してデータセットの可用性を検証します。
  2. /splits を使用して config + split を解決します。
  3. /first-rows でプレビューします。
  4. offsetlength (最大 100) を使用して、/rows でコンテンツをページ分割します。
  5. テキストマッチングには /search を、行の述語には /filter を使用します。
  6. /parquet を介して parquet リンクを、/size/statistics を介して合計/メタデータを取得します。

デフォルト

  • ベース URL: https://datasets-server.huggingface.co
  • デフォルトの API メソッド: GET
  • クエリパラメータは URL エンコードする必要があります。
  • offset は 0 ベースです。
  • 行のようなエンドポイントの場合、length の最大値は通常 100 です。
  • ゲート付き/プライベートデータセットには Authorization: Bearer <HF_TOKEN> が必要です。

Dataset Viewer

  • データセットの検証: /is-valid?dataset=<namespace/repo>
  • サブセットと分割のリスト表示: /splits?dataset=<namespace/repo>
  • 最初の行のプレビュー: /first-rows?dataset=<namespace/repo>&config=<config>&split=<split>
  • 行のページ分割: /rows?dataset=<namespace/repo>&config=<config>&split=<split>&offset=<int>&length=<int>
  • テキストの検索: /search?dataset=<namespace/repo>&config=<config>&split=<split>&query=<text>&offset=<int>&length=<int>
  • 述語によるフィルタリング: /filter?dataset=<namespace/repo>&config=<config>&split=<split>&where=<predicate>&orderby=<sort>&offset=<int>&length=<int>
  • parquet シャードのリスト表示: /parquet?dataset=<namespace/repo>
  • サイズの合計の取得: /size?dataset=<namespace/repo>
  • 列の統計情報の取得: /statistics?dataset=<namespace/repo>&config=<config>&split=<split>
  • Croissant メタデータの取得 (利用可能な場合): /croissant?dataset=<namespace/repo>

ページネーションパターン:

curl "https://datasets-server.huggingface.co/rows?dataset=stanfordnlp/imdb&config=plain_text&split=train&offset=0&length=100"
curl "https://datasets-server.huggingface.co/rows?dataset=stanfordnlp/imdb&config=plain_text&split=train&offset=100&length=100"

ページネーションが部分的な場合は、num_rows_totalnum_rows_per_pagepartial などの応答フィールドを使用して継続ロジックを駆動します。

検索/フィルターに関する注意点:

  • /search は文字列列に一致します (全文検索スタイルの動作は API の内部にあります)。
  • /filterwhere に述語構文を、orderby にオプションのソートを必要とします。
  • フィルタリングと検索は読み取り専用で、副作用がないようにしてください。

データセットのクエリ

SQL クエリには、Hub parquet エイリアスパスで npx parquetlens を使用します。

Parquet エイリアスの形式:

hf://datasets/<namespace>/<repo>@~parquet/<config>/<split>/<shard>.parquet

Dataset Viewer の /parquet から <config><split><shard> を導出します。

curl -s "https://datasets-server.huggingface.co/parquet?dataset=cfahlgren1/hub-stats" \
  | jq -r '.parquet_files[] | "hf://datasets/\(.dataset)@~parquet/\(.config)/\(.split)/\(.filename)"'

SQL クエリの実行:

npx -y -p parquetlens -p @parquetlens/sql parquetlens \
  "hf://datasets/<namespace>/<repo>@~parquet/<config>/<split>/<shard>.parquet" \
  --sql "SELECT * FROM data LIMIT 20"

SQL エクスポート

  • CSV: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.csv' (FORMAT CSV, HEADER, DELIMITER ',')"
  • JSON: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.json' (FORMAT JSON)"
  • Parquet: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.parquet' (FORMAT PARQUET)"

データセットの作成とアップロード

依存関係の制約に応じて、以下のいずれかのフローを使用します。

ローカル依存関係なし (Hub UI):

  • ブラウザでデータセットリポジトリを作成: https://huggingface.co/new-dataset
  • リポジトリの「Files and versions」ページで parquet ファイルをアップロードします。
  • Dataset Viewer でシャードが表示されることを確認します。
curl -s "https://datasets-server.huggingface.co/parquet?dataset=<namespace>/<repo>"

低依存 CLI フロー (npx @huggingface/hub / hfjs):

  • 認証トークンを設定します。
export HF_TOKEN=<your_hf_token>
  • parquet フォルダーをデータセットリポジトリにアップロードします (リポジトリが存在しない場合は自動作成されます)。
npx -y @huggingface/hub upload datasets/<namespace>/<repo> ./local/parquet-folder data
  • 作成時にプライベートリポジトリとしてアップロードします。
npx -y @huggingface/hub upload datasets/<namespace>/<repo> ./local/parquet-folder data --private

アップロード後、/parquet を呼び出して @~parquet でクエリするための <config>/<split>/<shard> の値を見つけます。

制限事項

  • このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
  • 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
  • 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して説明を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Hugging Face Dataset Viewer

When to Use

Use this skill when you need read-only exploration of a Hugging Face dataset through the Dataset Viewer API.

Use this skill to execute read-only Dataset Viewer API calls for dataset exploration and extraction.

Core workflow

  1. Optionally validate dataset availability with /is-valid.
  2. Resolve config + split with /splits.
  3. Preview with /first-rows.
  4. Paginate content with /rows using offset and length (max 100).
  5. Use /search for text matching and /filter for row predicates.
  6. Retrieve parquet links via /parquet and totals/metadata via /size and /statistics.

Defaults

  • Base URL: https://datasets-server.huggingface.co
  • Default API method: GET
  • Query params should be URL-encoded.
  • offset is 0-based.
  • length max is usually 100 for row-like endpoints.
  • Gated/private datasets require Authorization: Bearer <HF_TOKEN>.

Dataset Viewer

  • Validate dataset: /is-valid?dataset=<namespace/repo>
  • List subsets and splits: /splits?dataset=<namespace/repo>
  • Preview first rows: /first-rows?dataset=<namespace/repo>&config=<config>&split=<split>
  • Paginate rows: /rows?dataset=<namespace/repo>&config=<config>&split=<split>&offset=<int>&length=<int>
  • Search text: /search?dataset=<namespace/repo>&config=<config>&split=<split>&query=<text>&offset=<int>&length=<int>
  • Filter with predicates: /filter?dataset=<namespace/repo>&config=<config>&split=<split>&where=<predicate>&orderby=<sort>&offset=<int>&length=<int>
  • List parquet shards: /parquet?dataset=<namespace/repo>
  • Get size totals: /size?dataset=<namespace/repo>
  • Get column statistics: /statistics?dataset=<namespace/repo>&config=<config>&split=<split>
  • Get Croissant metadata (if available): /croissant?dataset=<namespace/repo>

Pagination pattern:

curl "https://datasets-server.huggingface.co/rows?dataset=stanfordnlp/imdb&config=plain_text&split=train&offset=0&length=100"
curl "https://datasets-server.huggingface.co/rows?dataset=stanfordnlp/imdb&config=plain_text&split=train&offset=100&length=100"

When pagination is partial, use response fields such as num_rows_total, num_rows_per_page, and partial to drive continuation logic.

Search/filter notes:

  • /search matches string columns (full-text style behavior is internal to the API).
  • /filter requires predicate syntax in where and optional sort in orderby.
  • Keep filtering and searches read-only and side-effect free.

Querying Datasets

Use npx parquetlens with Hub parquet alias paths for SQL querying.

Parquet alias shape:

hf://datasets/<namespace>/<repo>@~parquet/<config>/<split>/<shard>.parquet

Derive <config>, <split>, and <shard> from Dataset Viewer /parquet:

curl -s "https://datasets-server.huggingface.co/parquet?dataset=cfahlgren1/hub-stats" \
  | jq -r '.parquet_files[] | "hf://datasets/\(.dataset)@~parquet/\(.config)/\(.split)/\(.filename)"'

Run SQL query:

npx -y -p parquetlens -p @parquetlens/sql parquetlens \
  "hf://datasets/<namespace>/<repo>@~parquet/<config>/<split>/<shard>.parquet" \
  --sql "SELECT * FROM data LIMIT 20"

SQL export

  • CSV: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.csv' (FORMAT CSV, HEADER, DELIMITER ',')"
  • JSON: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.json' (FORMAT JSON)"
  • Parquet: --sql "COPY (SELECT * FROM data LIMIT 1000) TO 'export.parquet' (FORMAT PARQUET)"

Creating and Uploading Datasets

Use one of these flows depending on dependency constraints.

Zero local dependencies (Hub UI):

  • Create dataset repo in browser: https://huggingface.co/new-dataset
  • Upload parquet files in the repo "Files and versions" page.
  • Verify shards appear in Dataset Viewer:
curl -s "https://datasets-server.huggingface.co/parquet?dataset=<namespace>/<repo>"

Low dependency CLI flow (npx @huggingface/hub / hfjs):

  • Set auth token:
export HF_TOKEN=<your_hf_token>
  • Upload parquet folder to a dataset repo (auto-creates repo if missing):
npx -y @huggingface/hub upload datasets/<namespace>/<repo> ./local/parquet-folder data
  • Upload as private repo on creation:
npx -y @huggingface/hub upload datasets/<namespace>/<repo> ./local/parquet-folder data --private

After upload, call /parquet to discover <config>/<split>/<shard> values for querying with @~parquet.

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.