Datasets:
Tasks:
Text Generation
Sub-tasks:
dialogue-modeling
Languages:
Russian
Size:
1M<n<10M
Tags:
conversations
License:
| import datasets | |
| import os | |
| from datasets import Dataset, DatasetDict | |
| import gzip | |
| import json | |
| _CITATION = """\ | |
| @misc{Conversations, | |
| author = {Ilya Koziev}, | |
| title = {Russian-Language Dialogues Dataset}, | |
| year = {2025}, | |
| publisher = {Hugging Face}, | |
| howpublished = {\\url{https://huggingface.co/datasets/inkoziev/Conversations}}, | |
| } | |
| """ | |
| _DESCRIPTION = """\ | |
| Russian-Language Dialogues Dataset | |
| """ | |
| class DatasetConfig(datasets.BuilderConfig): | |
| def __init__(self, **kwargs): | |
| super(DatasetConfig, self).__init__(**kwargs) | |
| class Conversations(datasets.GeneratorBasedBuilder): | |
| BUILDER_CONFIG_CLASS = DatasetConfig | |
| BUILDER_CONFIGS = [ | |
| DatasetConfig(name="Conversations", | |
| version=datasets.Version("27.02.2025"), | |
| description=_DESCRIPTION, | |
| ), | |
| ] | |
| def _info(self): | |
| return datasets.DatasetInfo( | |
| description=_DESCRIPTION, | |
| features=datasets.Features( | |
| { | |
| "domain": datasets.Value("string"), | |
| "conversation": datasets.Value("string"), | |
| } | |
| ), | |
| supervised_keys=None, | |
| homepage="", | |
| citation=_CITATION, | |
| ) | |
| def _split_generators(self, dl_manager): | |
| download_url = "https://huggingface.co/datasets/inkoziev/Conversations/resolve/main/conversations.jsonl.gz" | |
| #download_url = "/home/inkoziev/github/Conversations/conversations.jsonl.gz" | |
| path = dl_manager.download(download_url) | |
| return [ | |
| datasets.SplitGenerator( | |
| name=datasets.Split.TRAIN, | |
| gen_kwargs={"datapath": path}, | |
| ) | |
| ] | |
| def _generate_examples(self, datapath): | |
| with gzip.open(datapath, "rt", encoding="utf-8") as f: | |
| for iline, line in enumerate(f): | |
| yield iline, json.loads(line) | |