Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -44,4 +44,51 @@ configs:
|
|
| 44 |
path: data/test-*
|
| 45 |
- split: validation
|
| 46 |
path: data/validation-*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
path: data/test-*
|
| 45 |
- split: validation
|
| 46 |
path: data/validation-*
|
| 47 |
+
language:
|
| 48 |
+
- en
|
| 49 |
+
pretty_name: open-jev-refactored
|
| 50 |
+
task_categories:
|
| 51 |
+
- text-classification
|
| 52 |
+
tags:
|
| 53 |
+
- Jev
|
| 54 |
+
- Decision-modelling
|
| 55 |
+
- Curated-Dataset
|
| 56 |
---
|
| 57 |
+
|
| 58 |
+
### Sample script to tokenize the dataset:
|
| 59 |
+
```
|
| 60 |
+
import datasets
|
| 61 |
+
from nltk.tokenize import wordpunct_tokenize
|
| 62 |
+
|
| 63 |
+
hf_openjev_dataset_id = "Man1103/OpenJev-Refactored"
|
| 64 |
+
hf_openjev_dataset = datasets.load_dataset(path=hf_openjev_dataset_id, cache_dir="/content/data/jev/curated")
|
| 65 |
+
|
| 66 |
+
def get_corpus(dataset):
|
| 67 |
+
total_corpus_list = []
|
| 68 |
+
for data in dataset:
|
| 69 |
+
for qno_target in data["qno-target"]:
|
| 70 |
+
question = qno_target["question"]
|
| 71 |
+
options = ",".join([option for option in qno_target["options"]])
|
| 72 |
+
total_corpus_list.append(question + options)
|
| 73 |
+
return total_corpus_list
|
| 74 |
+
|
| 75 |
+
curated_dataset_train = hf_openjev_dataset["train"]
|
| 76 |
+
train_list = get_corpus(curated_dataset_train)
|
| 77 |
+
|
| 78 |
+
curated_dataset_test = hf_openjev_dataset["test"]
|
| 79 |
+
test_list = get_corpus(curated_dataset_test)
|
| 80 |
+
|
| 81 |
+
curated_dataset_val = hf_openjev_dataset["validation"]
|
| 82 |
+
val_list = get_corpus(curated_dataset_val)
|
| 83 |
+
|
| 84 |
+
total_corpus = train_list + test_list + val_list
|
| 85 |
+
total_corpus = ",".join(total_corpus)
|
| 86 |
+
|
| 87 |
+
tokens = wordpunct_tokenize(total_corpus)
|
| 88 |
+
vocab = set(tokens)
|
| 89 |
+
|
| 90 |
+
token2idx = {token: idx for idx, token in enumerate(vocab)}
|
| 91 |
+
idx2token = {idx: token for idx, token in enumerate(vocab)}
|
| 92 |
+
|
| 93 |
+
print(f"Token count: {len(tokens)}, Vocab size: {len(vocab)}")
|
| 94 |
+
```
|