Skip to content

Commit 1980a13

Browse files
authored
Copal task (EleutherAI#1803)
* add copal * change name to copal id for clarity and the task name * remove `copal_id...` to yaml to make it work * checkmark on README * change group name to `copal_id`
1 parent d32ce5c commit 1980a13

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

lm_eval/tasks/copal_id/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# COPAL
2+
3+
### Paper
4+
5+
Title: `COPAL-ID: Indonesian Language Reasoning with Local Culture and Nuances`
6+
7+
Abstract: `https://arxiv.org/abs/2311.01012`
8+
9+
`COPAL-ID is an Indonesian causal commonsense reasoning dataset that captures local nuances. It provides a more natural portrayal of day-to-day causal reasoning within the Indonesian (especially Jakartan) cultural sphere. Professionally written and validatid from scratch by natives, COPAL-ID is more fluent and free from awkward phrases, unlike the translated XCOPA-ID.`
10+
11+
Homepage: `https://github.com/haryoa/copal-id`
12+
13+
14+
### Citation
15+
16+
```
17+
@article{wibowo2023copal,
18+
title={COPAL-ID: Indonesian Language Reasoning with Local Culture and Nuances},
19+
author={Wibowo, Haryo Akbarianto and Fuadi, Erland Hilman and Nityasya, Made Nindyatama and Prasojo, Radityo Eko and Aji, Alham Fikri},
20+
journal={arXiv preprint arXiv:2311.01012},
21+
year={2023}
22+
}
23+
```
24+
25+
### Groups and Tasks
26+
27+
#### Groups
28+
29+
* `copal_id`
30+
31+
#### Tasks
32+
33+
* `copal_id_standard`: `Standard version of COPAL dataset, use formal language and less local nuances`
34+
* `copal_id_colloquial`: `Colloquial version of COPAL dataset, use informal language and more local nuances`
35+
36+
### Checklist
37+
38+
For adding novel benchmarks/datasets to the library:
39+
* [x] Is the task an existing benchmark in the literature?
40+
* [x] Have you referenced the original paper that introduced the task?
41+
* [x] If yes, does the original paper provide a reference implementation? If so, have you checked against the reference implementation and documented how to run such a test?
42+
43+
44+
If other tasks on this dataset are already supported:
45+
* [ ] Is the "Main" variant of this task clearly denoted?
46+
* [ ] Have you provided a short sentence in a README on what each new variant adds / evaluates?
47+
* [ ] Have you noted which, if any, published evaluation setups are matched by this variant?
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: standard.yaml
2+
task: copal_id_colloquial
3+
task_alias: colloquial
4+
test_split: test_colloquial

lm_eval/tasks/copal_id/standard.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
group: copal_id
2+
task: copal_id_standard
3+
task_alias: standard
4+
dataset_path: haryoaw/COPAL
5+
dataset_name: id
6+
output_type: multiple_choice
7+
test_split: test
8+
doc_to_text: !function utils.doc_to_text_id
9+
doc_to_target: label
10+
doc_to_choice: !function utils.doc_to_choice
11+
metric_list:
12+
- metric: acc
13+
metadata:
14+
version: 1.0

lm_eval/tasks/copal_id/utils.py

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from functools import partial
2+
3+
4+
def convert_choice(choice):
5+
return choice[0].lower() + choice[1:]
6+
7+
8+
def doc_to_text(doc, connector):
9+
conn = connector[doc["question"]]
10+
return doc["premise"].strip()[:-1] + f" {conn}"
11+
12+
13+
def doc_to_choice(doc):
14+
return [convert_choice(doc["choice1"]), convert_choice(doc["choice2"])]
15+
16+
17+
doc_to_text_id = partial(
18+
doc_to_text,
19+
connector={
20+
"cause": "karena",
21+
"effect": "maka",
22+
},
23+
)

0 commit comments

Comments
 (0)