add model card
Browse files
README.md
CHANGED
|
@@ -42,3 +42,52 @@ configs:
|
|
| 42 |
- split: intents
|
| 43 |
path: intents/intents-*
|
| 44 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
- split: intents
|
| 43 |
path: intents/intents-*
|
| 44 |
---
|
| 45 |
+
|
| 46 |
+
# Dream
|
| 47 |
+
|
| 48 |
+
This is a text classification dataset. It is intended for machine learning research and experimentation.
|
| 49 |
+
|
| 50 |
+
This dataset is obtained via formatting another publicly available data to be compatible with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html).
|
| 51 |
+
|
| 52 |
+
## Usage
|
| 53 |
+
|
| 54 |
+
It is intended to be used with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):
|
| 55 |
+
|
| 56 |
+
```python
|
| 57 |
+
from autointent import Dataset
|
| 58 |
+
|
| 59 |
+
dream = Dataset.from_datasets("AutoIntent/dream")
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Source
|
| 63 |
+
|
| 64 |
+
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):
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
# define utils
|
| 68 |
+
import json
|
| 69 |
+
import requests
|
| 70 |
+
from autointent import Dataset
|
| 71 |
+
|
| 72 |
+
def load_json_from_github(github_file: str):
|
| 73 |
+
raw_text = requests.get(github_file).text
|
| 74 |
+
return json.loads(raw_text)
|
| 75 |
+
|
| 76 |
+
def convert_dream(dream_dict):
|
| 77 |
+
intents = []
|
| 78 |
+
for i, (intent_name, all_phrases) in enumerate(dream_dict["intent_phrases"].items()):
|
| 79 |
+
intent_record = {
|
| 80 |
+
"id": i,
|
| 81 |
+
"name": intent_name,
|
| 82 |
+
"tags": [],
|
| 83 |
+
"regexp_full_match": all_phrases["phrases"],
|
| 84 |
+
"regexp_partial_match": all_phrases.get("reg_phrases", []),
|
| 85 |
+
}
|
| 86 |
+
intents.append(intent_record)
|
| 87 |
+
return Dataset.from_dict({"intents": intents, "train": [{"utterance": "test", "label": 0}]})
|
| 88 |
+
|
| 89 |
+
# load and format
|
| 90 |
+
github_file = "https://raw.githubusercontent.com/deeppavlov/dream/2cad3e0b63b4ecde1e500676d31f1e34c53e1dc7/annotators/IntentCatcherTransformers/intent_phrases.json"
|
| 91 |
+
dream = load_json_from_github(github_file)
|
| 92 |
+
dream_converted = convert_dream(dream)
|
| 93 |
+
```
|