Hub documentation
데이터셋 병합 및 내보내기
단일 로그인(SSO) 감사 로그 스토리지 리전 비공개 데이터셋용 Data Studio 리소스 그룹(액세스 제어) 고급 컴퓨트 옵션 고급 보안 토큰 관리 서비스 계정 발행자 분석 게이팅 그룹 컬렉션 네트워크 보안 다운로드 분석 속도 제한 블로그 글
PRO 플랜 리포지토리 레포지토리 시작하기 저장소 설정 저장 용량 제한 스토리지 백엔드(Xet) 로컬 캐시 Pull Requests & Discussions 알림 컬렉션 Webhooks GitHub Actions 노트북 다음 단계 라이선스
모델 모델 허브 모델 카드 평가 결과 리더보드 데이터 게이트된 모델 모델 업로드 모델 다운로드 통합 라이브러리 모델 위젯 모델 추론 모델 다운로드 통계 모델 릴리스 체크리스트 하드웨어 로컬 앱 자주 묻는 질문 고급 주제
데이터셋 Datasets 개요 Dataset Cards 게이트된 데이터셋 데이터셋 업로드 데이터셋 업로드 (LLM용) 데이터셋 다운로드 스트리밍 데이터셋 통합 라이브러리
Spaces Argilla Daft Dask 데이터셋 Data Designer Distilabel DuckDB Embedding Atlas fenic FiftyOne Lance Pandas Polars Spark WebDataset
Data Studio Agent Traces 데이터셋 다운로드 통계 Spaces 개요 Spaces GPU 업그레이드 Spaces ZeroGPU Spaces Dev Mode Spaces 디스크 사용량 및 저장소 Spaces 사용자 지정 도메인 MCP 서버로 사용 가능한 Spaces Spaces를 에이전트 도구로 API 엔드포인트로 사용하는 Spaces Gradio Spaces Streamlit Spaces Static HTML Spaces Docker Spaces Space 임베드하기 Docker로 Spaces 실행 Spaces 구성 참조 HF로 로그인 버튼 주요 Spaces Spaces 변경 이력 고급 주제
Storage Buckets new 컨테이너 이미지 new Jobs Jobs 개요 빠른 시작 Pricing and Billing 작업 관리 구성 Docker 이미지 사용 모델 서빙 모델 학습 예제 및 튜토리얼 대규모 데이터셋 처리 Schedule Jobs Webhook 자동화 참고
에이전트 에이전트 개요 AI 에이전트를 위한 Hugging Face CLI Hugging Face MCP 서버 Hugging Face Agent Skills HF SDK를 사용하여 에이전트 구축하기 llama.cpp를 활용한 로컬 에이전트 에이전트 라이브러리 세션 추적 형식
기타 데이터셋 병합 및 내보내기
이 섹션에서는 두 데이터셋을 결합하고 결과를 내보내는 방법을 보여줍니다. 첫 번째 데이터셋은 CSV 형식이고, 두 번째 데이터셋은 Parquet 형식입니다. 데이터셋을 살펴보는 것으로 시작해 보겠습니다:
첫 번째는 TheFusion21/PokemonCards입니다:
FROM 'hf://datasets/TheFusion21/PokemonCards/train.csv' LIMIT 3;
┌─────────┬──────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────┬───────┬─────────────────┐
│ id │ image_url │ caption │ name │ hp │ set_name │
│ varchar │ varchar │ varchar │ varchar │ int64 │ varchar │
├─────────┼──────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────┼───────┼─────────────────┤
│ pl3-1 │ https://images.pok… │ A Basic, SP Pokemon Card of type Darkness with the title Absol G and 70 HP of rarity Rare Holo from the set Supreme Victors. It has … │ Absol G │ 70 │ Supreme Victors │
│ ex12-1 │ https://images.pok… │ A Stage 1 Pokemon Card of type Colorless with the title Aerodactyl and 70 HP of rarity Rare Holo evolved from Mysterious Fossil from … │ Aerodactyl │ 70 │ Legend Maker │
│ xy5-1 │ https://images.pok… │ A Basic Pokemon Card of type Grass with the title Weedle and 50 HP of rarity Common from the set Primal Clash and the flavor text: It… │ Weedle │ 50 │ Primal Clash │
└─────────┴──────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────┴───────┴─────────────────┘두 번째는 wanghaofan/pokemon-wiki-captions입니다:
FROM 'hf://datasets/wanghaofan/pokemon-wiki-captions/data/*.parquet' LIMIT 3;
┌──────────────────────┬───────────┬──────────┬──────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ image │ name_en │ name_zh │ text_en │ text_zh │
│ struct(bytes blob,… │ varchar │ varchar │ varchar │ varchar │
├──────────────────────┼───────────┼──────────┼──────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ {'bytes': \x89PNG\… │ abomasnow │ 暴雪王 │ Grass attributes,Blizzard King standing on two feet, with … │ 草属性,双脚站立的暴雪王,全身白色的绒毛,淡紫色的眼睛,几缕长条装的毛皮盖着它的嘴巴 │
│ {'bytes': \x89PNG\… │ abra │ 凯西 │ Super power attributes, the whole body is yellow, the head… │ 超能力属性,通体黄色,头部外形类似狐狸,尖尖鼻子,手和脚上都有三个指头,长尾巴末端带着一个褐色圆环 │
│ {'bytes': \x89PNG\… │ absol │ 阿勃梭鲁 │ Evil attribute, with white hair, blue-gray part without ha… │ 恶属性,有白色毛发,没毛发的部分是蓝灰色,头右边类似弓的角,红色眼睛 │
└──────────────────────┴───────────┴──────────┴──────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┘
이제 name 컬럼을 기준으로 이 두 데이터셋을 결합해 보겠습니다:
SELECT a.image_url
, a.caption AS card_caption
, a.name
, a.hp
, b.text_en as wiki_caption
FROM 'hf://datasets/TheFusion21/PokemonCards/train.csv' a
JOIN 'hf://datasets/wanghaofan/pokemon-wiki-captions/data/*.parquet' b
ON LOWER(a.name) = b.name_en
LIMIT 3;
┌──────────────────────┬──────────────────────┬────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ image_url │ card_caption │ name │ hp │ wiki_caption │
│ varchar │ varchar │ varchar │ int64 │ varchar │
├──────────────────────┼──────────────────────┼────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ https://images.pok… │ A Stage 1 Pokemon … │ Aerodactyl │ 70 │ A Pokémon with rock attributes, gray body, blue pupils, purple inner wings, two sharp claws on the wings, jagged teeth, and an arrow-like … │
│ https://images.pok… │ A Basic Pokemon Ca… │ Weedle │ 50 │ Insect-like, caterpillar-like in appearance, with a khaki-yellow body, seven pairs of pink gastropods, a pink nose, a sharp poisonous need… │
│ https://images.pok… │ A Basic Pokemon Ca… │ Caterpie │ 50 │ Insect attributes, caterpillar appearance, green back, white abdomen, Y-shaped red antennae on the head, yellow spindle-shaped tail, two p… │
└──────────────────────┴──────────────────────┴────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
COPY 명령을 사용하여 결과를 Parquet 파일로 내보낼 수 있습니다:
COPY (SELECT a.image_url
, a.caption AS card_caption
, a.name
, a.hp
, b.text_en as wiki_caption
FROM 'hf://datasets/TheFusion21/PokemonCards/train.csv' a
JOIN 'hf://datasets/wanghaofan/pokemon-wiki-captions/data/*.parquet' b
ON LOWER(a.name) = b.name_en)
TO 'output.parquet' (FORMAT PARQUET);새로운 Parquet 파일을 검증해 보겠습니다:
SELECT COUNT(*) FROM 'output.parquet';
┌──────────────┐
│ count_star() │
│ int64 │
├──────────────┤
│ 9460 │
└──────────────┘
마지막으로, 생성된 데이터셋을 Hub에 업로드해 보겠습니다. Hub UI, huggingface_hub 클라이언트 라이브러리 등을 사용하여 Parquet 파일을 업로드할 수 있으며, 자세한 내용은 여기에서 확인하세요.
그리고 끝입니다! 두 데이터셋을 성공적으로 결합하고, 결과를 내보내고, Hugging Face Hub에 업로드했습니다.
Update on GitHub