Apostrophe encoding issues

#1
by gserapio - opened

Thanks for sharing this valuable resource! Not sure if this is intentional in the dataset, but quite a few sentences have apostrophes decoded strangely. For instance, see below how the second and third sentences replace the expected apostrophe with a space and capitalize the next letter. In the last sentence, the apostrophe in "I'm" decodes properly but "haven't" gets outputted as "haven T":

['My parents are science deniers, but un religious.',
 'Story I ve ever heard.',
 'I don T believe any A.',
 'I work at my community garden center, and volunteer at the animal shelter.',
 "I'm wiccan, but haven T told them."]

To reproduce:

from datasets import load_dataset
import random

# load dataset
dataset = load_dataset("bavard/personachat_truecased")

# access training split
train_data = dataset["train"]

# get personality descriptions as a list
personality_descriptions = train_data["personality"]
personality_descriptions

# sample 50 of the descriptions
random.seed(42)
personality_descriptions_sampled = random.sample(personality_descriptions, k=50)

personality_descriptions_sampled[1]

Is there an easy way to fix this? TIA!

Sign up or log in to comment