Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
laiking commited on
Commit
8c4c683
1 Parent(s): 5177d3f

Use Sequence for labels features

Browse files

Hi !
I noticed that the labels features were not wrapped in a `datasets.Sequence` object, but directly in a python list, is there a specific reason for that ? as I used the [run_classification.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/text-classification/run_classification.py#L460C12-L460C68) HuggingFace example script I ran into the error when testing : raw_datasets["train"].features["label"].dtype == "list" for multi label classification that's what made me notice this.

Files changed (1) hide show
  1. hallmarks_of_cancer.py +1 -1
hallmarks_of_cancer.py CHANGED
@@ -118,7 +118,7 @@ class HallmarksOfCancerDataset(datasets.GeneratorBasedBuilder):
118
  {
119
  "document_id": datasets.Value("string"),
120
  "text": datasets.Value("string"),
121
- "label": [datasets.ClassLabel(names=_CLASS_NAMES)],
122
  }
123
  )
124
 
 
118
  {
119
  "document_id": datasets.Value("string"),
120
  "text": datasets.Value("string"),
121
+ "label": datasets.Sequence(datasets.ClassLabel(names=_CLASS_NAMES)),
122
  }
123
  )
124