ArneBinder
commited on
Commit
•
a211a3c
1
Parent(s):
66c4554
skip broken example (id=00411)
Browse files
cdcp.py
CHANGED
@@ -124,6 +124,9 @@ class CDCP(datasets.GeneratorBasedBuilder):
|
|
124 |
text_file_names = sorted(glob.glob(f"{path}/*.txt"))
|
125 |
for text_file_name in text_file_names:
|
126 |
txt_fn = Path(text_file_name)
|
|
|
|
|
|
|
127 |
ann_fn = txt_fn.with_suffix(".ann.json")
|
128 |
with open(txt_fn, encoding="utf-8") as f:
|
129 |
text = f.read()
|
@@ -160,7 +163,7 @@ class CDCP(datasets.GeneratorBasedBuilder):
|
|
160 |
for tail_idx in range(tail_first_idx, tail_last_idx + 1):
|
161 |
relations.append({"head": head_idx, "tail": tail_idx, "label": "reason"})
|
162 |
yield _id, {
|
163 |
-
"id":
|
164 |
"text": text,
|
165 |
"propositions": propositions,
|
166 |
"relations": relations,
|
|
|
124 |
text_file_names = sorted(glob.glob(f"{path}/*.txt"))
|
125 |
for text_file_name in text_file_names:
|
126 |
txt_fn = Path(text_file_name)
|
127 |
+
ex_id = txt_fn.stem
|
128 |
+
if ex_id == "00411":
|
129 |
+
continue # this example is broken (same text as 00410, but with missing some annotations)
|
130 |
ann_fn = txt_fn.with_suffix(".ann.json")
|
131 |
with open(txt_fn, encoding="utf-8") as f:
|
132 |
text = f.read()
|
|
|
163 |
for tail_idx in range(tail_first_idx, tail_last_idx + 1):
|
164 |
relations.append({"head": head_idx, "tail": tail_idx, "label": "reason"})
|
165 |
yield _id, {
|
166 |
+
"id": ex_id,
|
167 |
"text": text,
|
168 |
"propositions": propositions,
|
169 |
"relations": relations,
|