File size: 2,572 Bytes
6c4ce70
 
7e13823
6c4ce70
 
 
 
 
 
 
 
 
 
 
7e13823
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c4ce70
 
 
 
 
7e13823
 
 
 
a7bf209
 
 
 
6c4ce70
8bd70f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f481f46
8bd70f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a7bf209
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
---
dataset_info:
- config_name: default
  features:
  - name: utterance
    dtype: string
  - name: label
    dtype: int64
  splits:
  - name: train
    num_bytes: 16
    num_examples: 1
  download_size: 1106
  dataset_size: 16
- config_name: intents
  features:
  - name: id
    dtype: int64
  - name: name
    dtype: string
  - name: tags
    sequence: 'null'
  - name: regexp_full_match
    sequence: string
  - name: regexp_partial_match
    sequence: string
  - name: description
    dtype: 'null'
  splits:
  - name: intents
    num_bytes: 10141
    num_examples: 13
  download_size: 8811
  dataset_size: 10141
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
- config_name: intents
  data_files:
  - split: intents
    path: intents/intents-*
task_categories:
- text-classification
language:
- ru
---


# Dream

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_ru = Dataset.from_datasets("AutoIntent/dream-ru")
```

## Source

This dataset is taken from [DeepPavlov Library](https://github.com/deeppavlov/DeepPavlov)'s repository. It was formatted with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):

```python
# define utils
import json
import requests
from autointent import Dataset

def load_json_from_github(github_file: str):
    raw_text = requests.get(github_file).text
    return json.loads(raw_text)

def convert_dream(dream_dict):
    intents = []
    for i, (intent_name, all_phrases) in enumerate(dream_dict["intent_phrases"].items()):
        intent_record = {
            "id": i,
            "name": intent_name,
            "tags": [],
            "regexp_full_match": all_phrases["phrases"],
            "regexp_partial_match": all_phrases.get("reg_phrases", []),
        }
        intents.append(intent_record)
    return Dataset.from_dict({"intents": intents, "train": [{"utterance": "test", "label": 0}]})

# load and format
github_file = "https://raw.githubusercontent.com/deeppavlov/dream/26ff1aaf1c9019c60b74468705bd6d9b7ebc5353/annotators/IntentCatcherTransformers/intent_phrases_RU.json"
dream = load_json_from_github(github_file)
dream_converted = convert_dream(dream)
```