AndersGiovanni/roberta-large-10-dim
Text Classification • Updated • 3
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
# Here's the list of labels and mappings between id and label.
labels = [
"social_support",
"conflict",
"trust",
"fun",
"similarity",
"identity",
"respect",
"romance",
"knowledge",
"power",
]
id2label = {i: label for i, label in enumerate(labels)}
label2id = {label: i for i, label in enumerate(labels)}
# Given an examples, this is how you map
sample = {
"text": "This is just a made up text"
"labels": [0, 0, 0, 1, 0, 0, 0, 0, 0, 1]
}
labels_str = [id2label[i] for i, label in enumerate(sample['labels']) if label == 1]