Hugging Face Datasets

Hugging Face ile Çalışmak

Jacob H. Marquez

Lead Data Engineer

hf_datasets1.jpg

1 https://huggingface.co/datasets
Hugging Face ile Çalışmak

hf_datasets2.jpg

1 https://huggingface.co/datasets
Hugging Face ile Çalışmak
Hugging Face ile Çalışmak
Hugging Face ile Çalışmak
Hugging Face ile Çalışmak

Datasets paketinin kurulumu

 

pip install datasets

  • 🌐 {{2}} öğesine erişin
  • 📥 {{3}} indirin
  • 🔧 {{5}} kullanın
  • 🤝 {{6}} paylaşın

hf_datasets.jpg

1 https://huggingface.co/docs/datasets/loading
Hugging Face ile Çalışmak

Bir veri kümesi indirme

from datasets import load_dataset

data = load_dataset("IVN-RIN/BioBERT_Italian")

$$

Split parametresi

data = load_dataset("IVN-RIN/BioBERT_Italian", split="train")
1 https://huggingface.co/docs/datasets/v2.15.0/loading
Hugging Face ile Çalışmak

Apache Arrow veri kümesi biçimleri

 

Apache Arrow veri kümesi

1 https://arrow.apache.org/overview/
Hugging Face ile Çalışmak

Veri işleme

data = load_dataset("IVN-RIN/BioBERT_Italian", split="train")


# " bella " desenine göre filtrele filtered = data.filter(lambda row: " bella " in row['text']) print(filtered)
Dataset({
    features: ['text'],
    num_rows: 1122
})
1 https://huggingface.co/docs/datasets/process#select-and-filter
Hugging Face ile Çalışmak

Veri işleme

# İlk iki satırı seç
sliced = filtered.select(range(2))


print(sliced)
Dataset({features: ['text'], num_rows: 2})
# İlk satırın 'text' alanını al
print(sliced[0]['text'])
Concentrazioni atmosferiche di PCDD/PCDF...
1 https://huggingface.co/docs/datasets/process#select-and-filter
Hugging Face ile Çalışmak

Hadi pratik yapalım!

Hugging Face ile Çalışmak

Preparing Video For Download...