From c95622ea50748a5891e76a97a8cd1c0fb93b35c8 Mon Sep 17 00:00:00 2001 From: Alex-Brooks Date: Wed, 10 Apr 2024 09:30:24 -0600 Subject: [PATCH] Escape commas in tsa / entities Signed-off-by: Alex-Brooks --- scripts/pull_and_format_datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pull_and_format_datasets.py b/scripts/pull_and_format_datasets.py index f19509547..8d67e6c0b 100644 --- a/scripts/pull_and_format_datasets.py +++ b/scripts/pull_and_format_datasets.py @@ -62,7 +62,7 @@ def get_entites_output_text(datum): # TODO: check this for TSA, but seems like it is the same as entities if not mentions: return "None" - mention_strs = [f"{mention['text']}: {mention['type']}" for mention in mentions] + mention_strs = [f"{mention['text']}: {mention['type']}".replace(",", "\\,") for mention in mentions] return ", ".join(mention_strs) with open(file_path, "r") as entities_file: