misc. bugs and quality of life
CONTRIBUTOR
Cool thanks, I made those changes. LMK if you think it's ready for merge.
2020-08-17T15:30:37Z
https://github.com/huggingface/datasets/pull/475#issuecomment-674950259
https://api.github.com/repos/huggingface/datasets/issues/475
MDEyOklzc3VlQ29tbWVudDY3NDk1MDI1OQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/674950259/reactions
2020-08-17T15:30:46Z
https://api.github.com/repos/huggingface/datasets/issues/comments/674950259
https://avatars.githubusercontent.com/u/9353833?v=4
https://api.github.com/users/joeddav/events{/privacy}
https://api.github.com/users/joeddav/followers
https://api.github.com/users/joeddav/following{/other_user}
https://api.github.com/users/joeddav/gists{/gist_id}
https://github.com/joeddav
joeddav
MDQ6VXNlcjkzNTM4MzM=
https://api.github.com/users/joeddav/orgs
https://api.github.com/users/joeddav/received_events
https://api.github.com/users/joeddav/repos
https://api.github.com/users/joeddav/starred{/owner}{/repo}
https://api.github.com/users/joeddav/subscriptions
User
https://api.github.com/users/joeddav
public
MEMBER
Ok to merge for me
2020-08-17T20:48:39Z
https://github.com/huggingface/datasets/pull/475#issuecomment-675106840
https://api.github.com/repos/huggingface/datasets/issues/475
MDEyOklzc3VlQ29tbWVudDY3NTEwNjg0MA==
https://api.github.com/repos/huggingface/datasets/issues/comments/675106840/reactions
2020-08-17T20:48:39Z
https://api.github.com/repos/huggingface/datasets/issues/comments/675106840
https://avatars.githubusercontent.com/u/7353373?v=4
https://api.github.com/users/thomwolf/events{/privacy}
https://api.github.com/users/thomwolf/followers
https://api.github.com/users/thomwolf/following{/other_user}
https://api.github.com/users/thomwolf/gists{/gist_id}
https://github.com/thomwolf
thomwolf
MDQ6VXNlcjczNTMzNzM=
https://api.github.com/users/thomwolf/orgs
https://api.github.com/users/thomwolf/received_events
https://api.github.com/users/thomwolf/repos
https://api.github.com/users/thomwolf/starred{/owner}{/repo}
https://api.github.com/users/thomwolf/subscriptions
User
https://api.github.com/users/thomwolf
public
A few misc. bugs and QOL improvements that I've come across in using the library. Let me know if you don't like any of them and I can adjust/remove them.

1. Printing datasets without a description field throws an error when formatting the `single_line_description`. This fixes that, and also adds some formatting to the repr to make it slightly more readable.
```
>>> print(list_datasets()[0])
nlp.ObjectInfo(
	id='aeslc',
	description='A collection of email messages of employees in the Enron Corporation.There are two features:  - email_body: email body text.  - subject_line: email subject text.',
	files=[nlp.S3Object('aeslc.py'), nlp.S3Object('dataset_infos.json'), nlp.S3Object('dummy/1.0.0/dummy_data-zip-extracted/dummy_data/AESLC-master/enron_subject_line/dev/allen-p_inbox_29.subject'), nlp.S3Object('dummy/1.0.0/dummy_data-zip-extracted/dummy_data/AESLC-master/enron_subject_line/test/allen-p_inbox_24.subject'), nlp.S3Object('dummy/1.0.0/dummy_data-zip-extracted/dummy_data/AESLC-master/enron_subject_line/train/allen-p_inbox_20.subject'), nlp.S3Object('dummy/1.0.0/dummy_data.zip'), nlp.S3Object('urls_checksums/checksums.txt')]
)
```

2. Add id-only option to `list_datasets` and `list_metrics` to allow the user to easily print out just the names of the datasets & metrics. I often found myself annoyed that this took so many strokes to do.

```python
[dataset.id for dataset in list_datasets()] # before
list_datasets(id_only=True) # after
```

3. Fix null-seed randomization caching. When using `train_test_split` and `shuffle`, the computation was being cached even without a seed or generator being passed. The result was that calling `.shuffle` more than once on the same dataset didn't do anything without passing a distinct seed or generator. Likewise with `train_test_split`.

4. Indexing by iterables of bool. I added support for passing an iterable of type bool to `_getitem` as a numpy/pandas-like indexing method. Let me know if you think it's redundant with `filter` (I know it's not optimal memory-wise), but I think it's nice to have as a lightweight alternative to do simple things without having to create a copy of the entire dataset, e.g.

```python
dataset[dataset['label'] == 0] # numpy-like bool indexing to look at instances with labels of 0
```

5. Add an `input_column` argument to `map` and `filter`, which allows you to filter/map on a particular column rather than passing the whole dict to the function. Also adds `fn_kwargs` to be passed to the function. I think these together make mapping much cleaner in many cases such as mono-column tokenization:

```python
# before
dataset = dataset.map(lambda batch: tokenizer(batch["text"])
# after
dataset = dataset.map(tokenizer, input_column="text")
dataset = dataset.map(tokenizer, input_column="text", fn_kwargs={"truncation": True, "padding": True})
```