huggingface / huggingface/course

Inconsistent output in `raw_train_dataset.features` example: `num_classes` not displayed in `ClassLabel` output

Open
#730 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
4.2k
Forks
1.4k
Avg merge
13m
Merged PRs (30d)
1

Description

In [3. Fine-tuning a pretrained model - Processing the data - Loading a dataset from the Hub](https://huggingface.co/learn/nlp-course/chapter3/2?fw=pt#loading-a-dataset-from-the-hub), there is an example of the output provided when doing:

```python out
raw_train_dataset.features
```

It should expect (as per the document):

```python out
{'sentence1': Value(dtype='string', id=None),
'sentence2': Value(dtype='string', id=None),
'label': ClassLabel(num_classes=2, names=['not_equivalent', 'equivalent'], names_file=None, id=None),
'idx': Value(dtype='int32', id=None)}
```

but it actually outputs:

```python out
{'sentence1': Value(dtype='string', id=None),
'sentence2': Value(dtype='string', id=None),
'label': ClassLabel(names=['not_equivalent', 'equivalent'], id=None),
'idx': Value(dtype='int32', id=None)}
```

The `ClassLabel` output doesn't include `num_classes` and `name_file`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.