text stringlengths 137 1.74k | source stringclasses 4
values | url stringlengths 56 73 | source_section stringlengths 4 20 | file_type stringclasses 1
value | id stringlengths 3 3 |
|---|---|---|---|---|---|
The how-to guides offer a more comprehensive overview of all the tools 🤗 Datasets offers and how to use them. This will help you tackle messier real-world datasets where you may need to manipulate the dataset structure or content to get it ready for training.
The guides assume you are familiar and comfortable with t... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/how_to.md | https://huggingface.co/docs/datasets/en/how_to/#overview | #overview | .md | 0_0 |
Welcome to the 🤗 Datasets tutorials! These beginner-friendly tutorials will guide you through the fundamentals of working with 🤗 Datasets. You'll load and prepare a dataset for training with your machine learning framework of choice. Along the way, you'll learn how to load different dataset configurations and splits,... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/tutorial.md | https://huggingface.co/docs/datasets/en/tutorial/#overview | #overview | .md | 1_0 |
Before you start, you'll need to setup your environment and install the appropriate packages. 🤗 Datasets is tested on **Python 3.7+**.
<Tip>
If you want to use 🤗 Datasets with TensorFlow or PyTorch, you'll need to install them separately. Refer to the [TensorFlow installation page](https://www.tensorflow.org/inst... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#installation | #installation | .md | 2_0 |
You should install 🤗 Datasets in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep things tidy and avoid dependency conflicts.
1. Create and navigate to your project directory:
```bash
mkdir ~/my-project
cd ~/my-project
```
2. Start a virtual environment inside your directory:
```bas... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#virtual-environment | #virtual-environment | .md | 2_1 |
The most straightforward way to install 🤗 Datasets is with pip:
```bash
pip install datasets
```
Run the following command to check if 🤗 Datasets has been properly installed:
```bash
python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])"
```
This command downloads versio... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#pip | #pip | .md | 2_2 |
To work with audio datasets, you need to install the [`Audio`] feature as an extra dependency:
```bash
pip install datasets[audio]
```
<Tip warning={true}>
To decode mp3 files, you need to have at least version 1.1.0 of the `libsndfile` system library. Usually, it's bundled with the python [`soundfile`](https://g... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#audio | #audio | .md | 2_3 |
To work with image datasets, you need to install the [`Image`] feature as an extra dependency:
```bash
pip install datasets[vision]
``` | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#vision | #vision | .md | 2_4 |
Building 🤗 Datasets from source lets you make changes to the code base. To install from the source, clone the repository and install with the following commands:
```bash
git clone https://github.com/huggingface/datasets.git
cd datasets
pip install -e .
```
Again, you can check if 🤗 Datasets was properly installed... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#source | #source | .md | 2_5 |
🤗 Datasets can also be installed from conda, a package management system:
```bash
conda install -c huggingface -c conda-forge datasets
``` | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/installation.md | https://huggingface.co/docs/datasets/en/installation/#conda | #conda | .md | 2_6 |
[Arrow](https://arrow.apache.org/) enables large amounts of data to be processed and moved quickly. It is a specific data format that stores data in a columnar memory layout. This provides several significant advantages:
* Arrow's standard format allows [zero-copy reads](https://en.wikipedia.org/wiki/Zero-copy) which... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/about_arrow.md | https://huggingface.co/docs/datasets/en/about_arrow/#what-is-arrow | #what-is-arrow | .md | 3_0 |
🤗 Datasets uses Arrow for its local caching system. It allows datasets to be backed by an on-disk cache, which is memory-mapped for fast lookup.
This architecture allows for large datasets to be used on machines with relatively small device memory.
For example, loading the full English Wikipedia dataset only takes a... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/about_arrow.md | https://huggingface.co/docs/datasets/en/about_arrow/#memory-mapping | #memory-mapping | .md | 3_1 |
Iterating over a memory-mapped dataset using Arrow is fast. Iterating over Wikipedia on a laptop gives you speeds of 1-3 Gbit/s:
```python
>>> s = """batch_size = 1000
... for batch in wiki.iter(batch_size):
... ...
... """
>>> elapsed_time = timeit.timeit(stmt=s, number=1, globals=globals())
>>> print(f"Time to... | /Users/nielsrogge/Documents/python_projecten/datasets/docs/source/about_arrow.md | https://huggingface.co/docs/datasets/en/about_arrow/#performance | #performance | .md | 3_2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.