AttributeError: 'Value' object has no attribute 'names'
{'login': 'emnaboughariou', 'id': 102913847, 'node_id': 'U_kgDOBiJXNw', 'avatar_url': 'https://avatars.githubusercontent.com/u/102913847?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/emnaboughariou', 'html_url': 'https://github.com/emnaboughariou', 'followers_url': 'https://api.github.com/users/emnaboughariou/followers', 'following_url': 'https://api.github.com/users/emnaboughariou/following{/other_user}', 'gists_url': 'https://api.github.com/users/emnaboughariou/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/emnaboughariou/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/emnaboughariou/subscriptions', 'organizations_url': 'https://api.github.com/users/emnaboughariou/orgs', 'repos_url': 'https://api.github.com/users/emnaboughariou/repos', 'events_url': 'https://api.github.com/users/emnaboughariou/events{/privacy}', 'received_events_url': 'https://api.github.com/users/emnaboughariou/received_events', 'type': 'User', 'site_admin': False}
[]
[]
Hi ! It looks like your "isDif" column is a Sequence of Value("string"), not a Sequence of ClassLabel.

You can convert your Value("string") feature type to a ClassLabel feature type this way:
```python
from datasets import ClassLabel, Sequence

# provide the label_names yourself
label_names = [...]
# OR get them from the dataset
label_names = sorted(set(label for labels in raw_datasets["train"]["isDif"] for label in labels))

# Cast to ClassLabel
raw_datasets = raw_datasets.cast_column("isDif", Sequence(ClassLabel(names=label_names)))
```
 thank you 
it works 💯 
Hello

I'm trying to build a model for custom token classification 
I already followed the token classification course on huggingface

while adapting the code to my work, this message occures : 
'Value' object has no attribute 'names'

Here's my code:
`raw_datasets` 
generates
DatasetDict({
    train: Dataset({
        features: ['isDisf', 'pos', 'tokens', 'id'],
        num_rows: 14
    })
})

`raw_datasets["train"][3]["isDisf"]`
generates 
['B_RM', 'I_RM', 'I_RM', 'B_RP', 'I_RP', 'O', 'O']

`dis_feature = raw_datasets["train"].features["isDisf"]
dis_feature`
generates
Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)

and
`label_names = dis_feature.feature.names
label_names`
generates
AttributeError                            Traceback (most recent call last)
[<ipython-input-28-972fd54a869a>](https://localhost:8080/#) in <module>
----> 1 label_names = dis_feature.feature.names
      2 label_names

AttributeError: 'Value' object has
AttributeError: 'Value' object has no attribute 'names'

Thank you for your help
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5262/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}