Datasets:
Update README.md
Browse filesChanged the snippet to load the correct data split.
README.md
CHANGED
@@ -777,10 +777,11 @@ Each instance has scalar attributes (canvas) and sequence attributes (elements).
|
|
777 |
To get a label for categorical values, use the `int2str` method:
|
778 |
|
779 |
```python
|
|
|
780 |
key = "font"
|
781 |
-
example =
|
782 |
|
783 |
-
|
784 |
```
|
785 |
|
786 |
### Data Fields
|
|
|
777 |
To get a label for categorical values, use the `int2str` method:
|
778 |
|
779 |
```python
|
780 |
+
data = dataset['train'] # obtain the train set
|
781 |
key = "font"
|
782 |
+
example = data[0] # obtain first sample in train set
|
783 |
|
784 |
+
data.features[key].feature.int2str(example[key]) # obtain the text equivalent of the encoded values
|
785 |
```
|
786 |
|
787 |
### Data Fields
|