Datasets:
Update README.md
Browse files# dstc3
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
dream = Dataset.from_datasets("AutoIntent/dstc3")
```
## Source
This dataset is taken from `marcel-gohsen/dstc3` and formatted with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):
```python
from datasets import load_dataset
from autointent import Dataset
# load original data
dstc3 = load_dataset("marcel-gohsen/dstc3")
# extract intent names
dstc3["test"] = dstc3["test"].filter(lambda example: example["transcript"] != "")
intent_names = sorted(set(name for intents in dstc3["test"]["intent"] for name in intents))
intent_names.remove("reqmore")
dstc3["test"].filter(lambda example: "reqmore" in example["intent"])
name_to_id = {name: i for i, name in enumerate(intent_names)}
# parse complicated dstc format
def transform(example: dict):
return {
"utterance": example["transcript"],
"label": [name_to_id[intent_name] for intent_name in example["intent"] if intent_name != "reqmore"],
}
dstc_converted = dstc3["test"].map(transform, remove_columns=dstc3["test"].features.keys())
# format to autointent.Dataset
intents = [{"id": i, "name": name} for i, name in enumerate(intent_names)]
utterances = []
oos_utterances = []
for rec in dstc_converted.to_list():
if len(rec["label"]) == 0:
rec.pop("label")
oos_utterances.append(rec["utterance"])
else:
utterances.append(rec)
oos_records = [{"utterance": ut} for ut in set(oos_utterances)]
dstc_converted = Dataset.from_dict({"intents": intents, "train": utterances + oos_records})
```
@@ -14,7 +14,7 @@ dataset_info:
|
|
14 |
num_bytes: 14659.241462959508
|
15 |
num_examples: 375
|
16 |
download_size: 148215
|
17 |
-
dataset_size: 628471
|
18 |
- config_name: intents
|
19 |
features:
|
20 |
- name: id
|
@@ -46,4 +46,8 @@ configs:
|
|
46 |
data_files:
|
47 |
- split: intents
|
48 |
path: intents/intents-*
|
49 |
-
|
|
|
|
|
|
|
|
|
|
14 |
num_bytes: 14659.241462959508
|
15 |
num_examples: 375
|
16 |
download_size: 148215
|
17 |
+
dataset_size: 628471
|
18 |
- config_name: intents
|
19 |
features:
|
20 |
- name: id
|
|
|
46 |
data_files:
|
47 |
- split: intents
|
48 |
path: intents/intents-*
|
49 |
+
task_categories:
|
50 |
+
- text-classification
|
51 |
+
language:
|
52 |
+
- en
|
53 |
+
---
|