Skip to content

Commit a279538

Browse files
committed
ruff fix
1 parent 4ea577a commit a279538

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

create_splits_of_verying_difficulty.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def convert_to_hf_format(data_point):
4747
try:
4848
tags[start] = "B-" + label
4949
tags[start + 1 : end + 1] = ["I-" + label] * (end - start)
50-
except:
50+
except IndexError:
5151
pass
5252
return {"tokens": data_point["tokenized_text"], "ner_tags": tags, "spans": spans}
5353

@@ -60,7 +60,7 @@ def create_splits(
6060
):
6161
try:
6262
df = pd.read_pickle("new_splits.pkl")
63-
except:
63+
except FileNotFoundError:
6464
raise FileNotFoundError("Please run the compute_new_splits function first to generate the data.")
6565
df = df[(df["train_dataset"] == dataset_name)]
6666

0 commit comments

Comments
 (0)