File size: 2,737 Bytes
d0bfe65
 
 
 
 
80e79f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0bfe65
 
 
 
 
 
 
 
 
80e79f5
 
d0bfe65
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3

"""
Run this script as ./conversion_script.py to convert the EventCausality entries from
the CREST v2 aggregation file to HF-compatible parquet files.

KNOWN UNFIXABLE (2026-07-11) -- do not "fix" this by pointing it at
CogComp/TCR's data. Researched at length trying to find a direct source
to replace CREST for this dataset (as was done for CaTeRS, BioCause,
COPA, TCR): EventCausality's original release (Do, Chan & Roth, EMNLP
2011, 580 manually-annotated causal links on 25 CNN articles) was never
publicly archived anywhere reachable -- confirmed by reading the paper
itself (which only promises "we plan to make this dataset available
soon" via a CogComp resource-page URL that is now a dead/JS-templated
page with no static fallback), and by searching the whole CogComp GitHub
org (no matching repo).

The only accessible data touching these same 25 documents is
github.com/CogComp/TCR (see ../TCR/conversion_script.py) -- but that is a
DIFFERENT, later, re-annotated dataset built for a different paper (Ning
et al., ACL 2018): events were re-extracted with ClearTK rather than
reusing Do et al.'s original manual event set, and causal links were
independently re-annotated and pruned (580 -> 172, a different label
scheme too: TCR's binary causes/caused_by vs. EventCausality's
causality/relatedness). Repointing this converter at TCR's data would
silently conflate two distinct datasets under one citation -- decided
NOT to do that. This script is therefore left exactly as it was: still fed by
CREST's own (independently confirmed corrupted/incomplete: 0 train rows)
aggregation, which is the best available approximation of the true
EventCausality data until/unless a first-party archive of the original
release resurfaces. If you're comparing models against "EventCausality"
using this data, treat effectiveness numbers on it as unreliable for
that reason -- it is not a data-loading bug in the usual sense.
"""

# 1) Install dependencies:
#    pip install git+https://github.com/TheMrSheldon/causality-toolkit.git
# 2) Source file (fetched automatically via pandas):
#  - https://raw.githubusercontent.com/phosseini/CREST/master/data/crest_v2.xlsx

from pathlib import Path

from causalatee.data.constants import Task
from causalatee.data.conversion import CREST2HF, CRESTSource

converter = CREST2HF(
    "https://raw.githubusercontent.com/phosseini/CREST/master/data/crest_v2.xlsx",
    Path.cwd(),
    prefix="eventcausality",
    filters={"source": CRESTSource.EventCausality},
)

for split in ["train", "dev", "test"]:
    converter.convert(Task.CausalityDetection, split)
    converter.convert(Task.CausalCandidateExtraction, split)
    converter.convert(Task.CausalityIdentification, split)