voorhs commited on
Commit
bb56fd5
·
1 Parent(s): 6a84199

add dataset card

Browse files
Files changed (1) hide show
  1. README.md +54 -0
README.md CHANGED
@@ -42,3 +42,57 @@ configs:
42
  - split: intents
43
  path: intents/intents-*
44
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  - split: intents
43
  path: intents/intents-*
44
  ---
45
+
46
+ # Russian hwu64
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/hwu64_ru")
60
+ ```
61
+
62
+ ## Source
63
+
64
+ This dataset is taken from private github repository `LadaNikitina/ruHWU64` and formatted with our [AutoIntent Library](https://deeppavlov.github.io/AutoIntent/index.html):
65
+
66
+ ```python
67
+ from datasets import load_from_disk
68
+ from autointent import Dataset
69
+
70
+ def convert_ruhwu64(hwu64_train):
71
+ intent_names = sorted(hwu64_train.unique("intent"))
72
+ name_to_id = dict(zip(intent_names, range(len(intent_names)), strict=False))
73
+ n_classes = len(intent_names)
74
+
75
+ classwise_utterance_records = [[] for _ in range(n_classes)]
76
+ intents = [
77
+ {
78
+ "id": i,
79
+ "name": name,
80
+ }
81
+ for i, name in enumerate(intent_names)
82
+ ]
83
+
84
+ for batch in hwu64_train.iter(batch_size=16, drop_last_batch=False):
85
+ for txt, name in zip(batch["text"], batch["intent"], strict=False):
86
+ intent_id = name_to_id[name]
87
+ target_list = classwise_utterance_records[intent_id]
88
+ target_list.append({"utterance": txt, "label": intent_id})
89
+
90
+ utterances = [rec for lst in classwise_utterance_records for rec in lst]
91
+ return Dataset.from_dict({"intents": intents, "train": utterances})
92
+
93
+ # load and format
94
+ ! git clone git@github.com:LadaNikitina/ruHWU64 data/RuHWU64
95
+ ! rm -rf data/RuHWU64/.git
96
+ ruhwu64 = load_from_disk("data/RuHWU64")
97
+ ruhwu64_converted = convert_ruhwu64(ruhwu64["train"])
98
+ ```