commit 446e8c0ef8dd8162fa76826893e43c4db52ffe42
parent a02677026c33d217b07506ec99bfea99f20c1d63
Author: Sondre Wold <sondrewold1@gmail.com>
Date: Tue, 26 Aug 2025 09:55:27 +0200
fast error handling
Diffstat:
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/experiment.py b/experiment.py
@@ -247,8 +247,14 @@ def find_diff(a: str, b: str) -> list[str] | None:
if a == b: # Should not happen for SICK or NCIP, but you never know.
return None
- words_a = a.split()
- words_b = b.split()
+ #print(f"A={a}\nB={b}\n##############")
+
+ try:
+ words_a = a.split()
+ words_b = b.split()
+ except:
+ raise Exception(f"Parse error. A={a}, B={b}")
+
prefix_len = 0
min_len = min(len(words_a), len(words_b))
@@ -400,7 +406,7 @@ def main() -> None:
elif args.experiment_type == "ncip-non":
# Here we measure the difference between two non-idiomatic phrases in context.
sentence_A = df["synonym both"].values.tolist()
- sentence_B = df["both synonym alt2_1"].values.tolist()
+ sentence_B = df["both synonym alt1_1"].values.tolist()
elif args.experiment_type == "sick":
lexA = df.loc[df["sentence_A_expRule"] == "S2_lex"]