voorhs commited on
Commit
8bd70f0
·
1 Parent(s): 7e13823

add model card

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