Skip to content

Commit

Permalink
Escape commas in tsa / entities
Browse files Browse the repository at this point in the history
Signed-off-by: Alex-Brooks <[email protected]>
  • Loading branch information
alex-jw-brooks committed Apr 10, 2024
1 parent 7c40d64 commit c95622e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pull_and_format_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c95622e

Please sign in to comment.