AttributeError: 'Value' object has no attribute 'names'
MEMBER
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)))
```

2022-11-18T14:30:15Z
https://github.com/huggingface/datasets/issues/5262#issuecomment-1320071428
https://api.github.com/repos/huggingface/datasets/issues/5262
IC_kwDODunzps5OrrEE
https://api.github.com/repos/huggingface/datasets/issues/comments/1320071428/reactions
2022-11-18T14:30:15Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1320071428
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
thank you 
it works 💯 
2022-11-22T10:09:23Z
https://github.com/huggingface/datasets/issues/5262#issuecomment-1323414531
https://api.github.com/repos/huggingface/datasets/issues/5262
IC_kwDODunzps5O4bQD
https://api.github.com/repos/huggingface/datasets/issues/comments/1323414531/reactions
2022-11-22T10:09:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1323414531
https://avatars.githubusercontent.com/u/102913847?v=4
https://api.github.com/users/emnaboughariou/events{/privacy}
https://api.github.com/users/emnaboughariou/followers
https://api.github.com/users/emnaboughariou/following{/other_user}
https://api.github.com/users/emnaboughariou/gists{/gist_id}
https://github.com/emnaboughariou
emnaboughariou
U_kgDOBiJXNw
https://api.github.com/users/emnaboughariou/orgs
https://api.github.com/users/emnaboughariou/received_events
https://api.github.com/users/emnaboughariou/repos
https://api.github.com/users/emnaboughariou/starred{/owner}{/repo}
https://api.github.com/users/emnaboughariou/subscriptions
User
https://api.github.com/users/emnaboughariou
public
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