Datasets:
change script
Browse files12 unmodified lines13141516171819202117 unmodified lines3940414243444546475 unmodified lines5354555657585910 unmodified lines7071727374757618 unmodified lines95969798991001011021031041051061071081091101111121131141151161172 unmodified lines12012112212312412512612 unmodified lines# limitations under the License."""LCCC: Large-scale Cleaned Chinese Conversation corpus (LCCC) is a large corpus of Chinese conversations.A rigorous data cleaning pipeline is designed to ensure the quality of the corpus.This pipeline involves a set of rules and several classifier-based filters.Noises such as offensive or sensitive words, special symbols, emojis,grammatically incorrect sentences, and incoherent conversations are filtered."""17 unmodified lines# Description of the dataset here_DESCRIPTION = """\LCCC: Large-scale Cleaned Chinese Conversation corpus (LCCC) is a large corpus of Chinese conversations.A rigorous data cleaning pipeline is designed to ensure the quality of the corpus.This pipeline involves a set of rules and several classifier-based filters.Noises such as offensive or sensitive words, special symbols, emojis,grammatically incorrect sentences, and incoherent conversations are filtered."""5 unmodified lines"train": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_train.jsonl.gz","valid": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_valid.jsonl.gz","test": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_test.jsonl.gz",}}10 unmodified linesdef _info(self):features = datasets.Features({"dialog": datasets.Value("string"),})return datasets.DatasetInfo(18 unmodified linesif self.config.name == "large":return [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={ "filepath": os.path.join(downloaded_data), "split": "train", })]if self.config.name == "base":return [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={ "filepath": os.path.join(downloaded_data["train"]), "split": "train", },),datasets.SplitGenerator(name=datasets.Split.TEST,gen_kwargs={ "filepath": os.path.join(downloaded_data["test"]), "split": "test" },),datasets.SplitGenerator(name=datasets.Split.VALIDATION,gen_kwargs={ "filepath": os.path.join(downloaded_data["valid"]), "split": "dev", },),]2 unmodified lineswith open(filepath, encoding="utf-8") as f:for key, row in enumerate(f):row = row.strip()if len(row) == 0: continueyield key, {"dialog": json.loads(row),}12 unmodified lines13141516171819202117 unmodified lines3940414243444546475 unmodified lines5354555657585910 unmodified lines7071727374757618 unmodified lines95969798991001011021031041051061071081091101111121131141151161171181191201211221231241251262 unmodified lines12913013113213313413513612 unmodified lines# limitations under the License."""LCCC: Large-scale Cleaned Chinese Conversation corpus (LCCC) is a large corpus of Chinese conversations.A rigorous data cleaning pipeline is designed to ensure the quality of the corpus.This pipeline involves a set of rules and several classifier-based filters.Noises such as offensive or sensitive words, special symbols, emojis,grammatically incorrect sentences, and incoherent conversations are filtered."""17 unmodified lines# Description of the dataset here_DESCRIPTION = """\LCCC: Large-scale Cleaned Chinese Conversation corpus (LCCC) is a large corpus of Chinese conversations.A rigorous data cleaning pipeline is designed to ensure the quality of the corpus.This pipeline involves a set of rules and several classifier-based filters.Noises such as offensive or sensitive words, special symbols, emojis,grammatically incorrect sentences, and incoherent conversations are filtered."""5 unmodified lines"train": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_train.jsonl.gz","valid": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_valid.jsonl.gz","test": "https://huggingface.co/datasets/silver/lccc/resolve/main/lccc_base_test.jsonl.gz",},}10 unmodified linesdef _info(self):features = datasets.Features({"dialog": [datasets.Value("string")],})return datasets.DatasetInfo(18 unmodified linesif self.config.name == "large":return [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={"filepath": os.path.join(downloaded_data),"split": "train",},)]if self.config.name == "base":return [datasets.SplitGenerator(name=datasets.Split.TRAIN,gen_kwargs={"filepath": os.path.join(downloaded_data["train"]),"split": "train",},),datasets.SplitGenerator(name=datasets.Split.TEST,gen_kwargs={"filepath": os.path.join(downloaded_data["test"]), "split": "test"},),datasets.SplitGenerator(name=datasets.Split.VALIDATION,gen_kwargs={"filepath": os.path.join(downloaded_data["valid"]),"split": "dev",},),]2 unmodified lineswith open(filepath, encoding="utf-8") as f:for key, row in enumerate(f):row = row.strip()if len(row) == 0:continueyield key, {"dialog": json.loads(row),}
lccc.py+24-14