Skip to main content

LlamaIndex Readers Integration: HuggingFace Datasets

Overview

HuggingFace Datasets Reader is a tool designed to load HuggingFace datasets as documents.

Installation

You can install HuggingFace Datasets Reader via pip:

pip install llama-index-readers-datasets

Usage

from llama_index.readers.datasets import DatasetsReader
from datasets import load_dataset

reader = DatasetsReader()

# Load train split (default) as metadata
docs = reader.load_data("lhoestq/demo1")

# Load test split as metadata
docs = reader.load_data("lhoestq/demo1", split="test")

# Load specify the dictionary key to use as text value
docs = reader.load_data("lhoestq/demo1", text_key="review")

# Pass additional arguments to datasets.load_dataset
docs = reader.load_data("lhoestq/demo1", cache_dir="/tmp/huggingface")

# Load from a preloaded dataset (ignore all other arguments)
dataset = load_dataset("lhoestq/demo1", split="train")
docs = reader.load_data(dataset=dataset)

# Lazy loading (stream samples)
for it in reader.lazy_load_data(
    "lhoestq/demo1", split="test", text_key="review", doc_id_key="id"
):
    print(it)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_readers_datasets-0.3.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_datasets-0.3.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_readers_datasets-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_readers_datasets-0.3.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_datasets-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b9c4d013d553e0df6f4324fb570271fcede5536616d86bf7a26755a53df5a0ae
MD5 fe568a9339fc8614c5f1a03ccb416125
BLAKE2b-256 5919c400bc40f4bb50d830ec16e6041fd0457edd9f99c9357193490924071076

See more details on using hashes here.

File details

Details for the file llama_index_readers_datasets-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_readers_datasets-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_readers_datasets-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7386768fa1cd520fcf8de0eef27a21a446dc2fa64d03eaff8afc88798b6f74eb
MD5 972761b925862d2cb47a28d619f6eaed
BLAKE2b-256 ba2aa08305753905525ba8e78d8251f9f77dbee87ec8319052ebc838fd3499bd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page