eurlex / README.md
darrinka's picture
Upload dataset
8c0d9ea verified
|
raw
history blame
2.24 kB
---
dataset_info:
- config_name: default
features:
- name: utterance
dtype: string
- name: label
sequence: int64
splits:
- name: train
num_bytes: 396298199
num_examples: 55000
- name: test
num_bytes: 59593199
num_examples: 5000
download_size: 189778506
dataset_size: 455891398
- config_name: intents
features:
- name: id
dtype: int64
- name: name
dtype: 'null'
- name: tags
sequence: 'null'
- name: regexp_full_match
sequence: 'null'
- name: regexp_partial_match
sequence: 'null'
- name: description
dtype: 'null'
splits:
- name: intents
num_bytes: 420
num_examples: 21
download_size: 2970
dataset_size: 420
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: test
path: data/test-*
- config_name: intents
data_files:
- split: intents
path: intents/intents-*
task_categories:
- text-classification
language:
- en
---
# eurlex
This is a text classification dataset. It is intended for machine learning research and experimentation.
This dataset is obtained via formatting another publicly available data to be compatible with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html).
## Usage
It is intended to be used with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):
```python
from autointent import Dataset
eurlex = Dataset.from_datasets("AutoIntent/eurlex")
```
## Source
This dataset is taken from `coastalcph/multi_eurlex` and formatted with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):
```python
from datasets import load_dataset
from autointent import Dataset
eurlex = load_dataset("coastalcph/multi_eurlex", "en", split="train", trust_remote_code=True)
labels = []
def transform(example: dict):
for intent in example["labels"]:
labels.append(intent)
return {"utterance": example["text"], "label": example["labels"]}
labels = [{"id": label, "name": None} for label in set(labels)]
multilabel_eurlex = eurlex.map(transform, remove_columns=eurlex.features.keys())
eurlex_converted = Dataset.from_dict({"intents": labels, "train": multilabel_eurlex.to_list()})
```