Update README.md
Browse files
README.md
CHANGED
@@ -40,4 +40,35 @@ configs:
|
|
40 |
path: data/test-*
|
41 |
tags: []
|
42 |
---
|
|
|
|
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
path: data/test-*
|
41 |
tags: []
|
42 |
---
|
43 |
+
# Arabic aya dataset
|
44 |
+
This dataset is the arabic partition of the Cohere aya dataset using this simple code:
|
45 |
|
46 |
+
```python
|
47 |
+
# Helper Function.
|
48 |
+
def drop_keys(x,):
|
49 |
+
keys = ["language_code", "user_id"]
|
50 |
+
for key in keys:
|
51 |
+
x.pop(key)
|
52 |
+
return x
|
53 |
+
|
54 |
+
# Train split.
|
55 |
+
aya_train = datasets.load_dataset("CohereForAI/aya_dataset", split="train")
|
56 |
+
arb_train = aya_train.filter(lambda x: x["language_code"] == "arb")
|
57 |
+
arb_train = arb_train.map(drop_keys)
|
58 |
+
|
59 |
+
# Test split.
|
60 |
+
aya_test = datasets.load_dataset("CohereForAI/aya_dataset", split="test")
|
61 |
+
arb_test = aya_test.filter(lambda x: x["language_code"] == "arb")
|
62 |
+
arb_test = arb_test.map(drop_keys)
|
63 |
+
|
64 |
+
# create dataset dictionary.
|
65 |
+
arabic_aya = datasets.DatasetDict({
|
66 |
+
"train":arb_train,
|
67 |
+
"test":arb_test
|
68 |
+
})
|
69 |
+
|
70 |
+
# Upload to hf hub.
|
71 |
+
arabic_aya.push_to_hub("abuelnasr/cohere_aya_arabic")
|
72 |
+
```
|
73 |
+
|
74 |
+
for more information visi the original data repo: [CohereForAI/aya_dataset](https://huggingface.co/datasets/CohereForAI/aya_dataset).
|