Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -46,6 +46,7 @@ Based on the compilation process, each data instance is expected to contain the
|
|
| 46 |
}
|
| 47 |
}
|
| 48 |
|
|
|
|
| 49 |
How to Use & Integration Guide
|
| 50 |
Since the dataset is quite large (ranging between 10 million and 100 million rows), loading it entirely into RAM might be inefficient depending on your hardware setup. Below are the recommended ways to handle the data.
|
| 51 |
|
|
@@ -53,25 +54,41 @@ Since the dataset is quite large (ranging between 10 million and 100 million row
|
|
| 53 |
1. Loading via Hugging Face datasets (Standard Workflow)
|
| 54 |
If you want to download and cache the dataset automatically, make sure you have the datasets library installed (pip install datasets).
|
| 55 |
|
|
|
|
| 56 |
from datasets import load_dataset
|
| 57 |
|
|
|
|
| 58 |
# Load the entire dataset into memory/cache
|
|
|
|
|
|
|
| 59 |
dataset = load_dataset("DLMveloper/DLM_DATASET")
|
| 60 |
print("Dataset loaded successfully:")
|
| 61 |
print(dataset)
|
| 62 |
|
|
|
|
| 63 |
# Access a specific slice or sample
|
|
|
|
|
|
|
| 64 |
first_sample = dataset['train'][0]
|
| 65 |
print(f"Sample Text: {first_sample['text']}")
|
| 66 |
|
|
|
|
| 67 |
2. Stream Loading (Highly Recommended for Large Scale)
|
| 68 |
To avoid high memory overhead and start training or preprocessing immediately without waiting for the entire dataset to download, use the streaming=True parameter:
|
|
|
|
|
|
|
| 69 |
from datasets import load_dataset
|
| 70 |
|
|
|
|
| 71 |
# Initialize a streaming instance of the dataset
|
|
|
|
|
|
|
| 72 |
streaming_dataset = load_dataset("DLMveloper/DLM_DATASET", streaming=True)
|
| 73 |
|
|
|
|
| 74 |
# Iterate through the data dynamically on-the-fly
|
|
|
|
|
|
|
| 75 |
print("Streaming the first 5 examples:")
|
| 76 |
for i, sample in enumerate(streaming_dataset['train'].take(5)):
|
| 77 |
print(f"\n--- Sample {i+1} ---")
|
|
@@ -100,6 +117,8 @@ with open(file_path, "r", encoding="utf-8") as file:
|
|
| 100 |
# Inject your custom tokenization, filtering, or training logic here
|
| 101 |
pass
|
| 102 |
|
|
|
|
|
|
|
| 103 |
Intended Applications
|
| 104 |
This dataset is highly versatile and can be adapted for several downstream tasks:
|
| 105 |
Multilingual Language Modeling: Enhancing model capabilities across English, Russian, and especially Kazakh (kk), which is highly valuable due to the scarcity of high-quality Kazakh datasets.
|
|
|
|
| 46 |
}
|
| 47 |
}
|
| 48 |
|
| 49 |
+
|
| 50 |
How to Use & Integration Guide
|
| 51 |
Since the dataset is quite large (ranging between 10 million and 100 million rows), loading it entirely into RAM might be inefficient depending on your hardware setup. Below are the recommended ways to handle the data.
|
| 52 |
|
|
|
|
| 54 |
1. Loading via Hugging Face datasets (Standard Workflow)
|
| 55 |
If you want to download and cache the dataset automatically, make sure you have the datasets library installed (pip install datasets).
|
| 56 |
|
| 57 |
+
|
| 58 |
from datasets import load_dataset
|
| 59 |
|
| 60 |
+
|
| 61 |
# Load the entire dataset into memory/cache
|
| 62 |
+
|
| 63 |
+
|
| 64 |
dataset = load_dataset("DLMveloper/DLM_DATASET")
|
| 65 |
print("Dataset loaded successfully:")
|
| 66 |
print(dataset)
|
| 67 |
|
| 68 |
+
|
| 69 |
# Access a specific slice or sample
|
| 70 |
+
|
| 71 |
+
|
| 72 |
first_sample = dataset['train'][0]
|
| 73 |
print(f"Sample Text: {first_sample['text']}")
|
| 74 |
|
| 75 |
+
|
| 76 |
2. Stream Loading (Highly Recommended for Large Scale)
|
| 77 |
To avoid high memory overhead and start training or preprocessing immediately without waiting for the entire dataset to download, use the streaming=True parameter:
|
| 78 |
+
|
| 79 |
+
|
| 80 |
from datasets import load_dataset
|
| 81 |
|
| 82 |
+
|
| 83 |
# Initialize a streaming instance of the dataset
|
| 84 |
+
|
| 85 |
+
|
| 86 |
streaming_dataset = load_dataset("DLMveloper/DLM_DATASET", streaming=True)
|
| 87 |
|
| 88 |
+
|
| 89 |
# Iterate through the data dynamically on-the-fly
|
| 90 |
+
|
| 91 |
+
|
| 92 |
print("Streaming the first 5 examples:")
|
| 93 |
for i, sample in enumerate(streaming_dataset['train'].take(5)):
|
| 94 |
print(f"\n--- Sample {i+1} ---")
|
|
|
|
| 117 |
# Inject your custom tokenization, filtering, or training logic here
|
| 118 |
pass
|
| 119 |
|
| 120 |
+
|
| 121 |
+
|
| 122 |
Intended Applications
|
| 123 |
This dataset is highly versatile and can be adapted for several downstream tasks:
|
| 124 |
Multilingual Language Modeling: Enhancing model capabilities across English, Russian, and especially Kazakh (kk), which is highly valuable due to the scarcity of high-quality Kazakh datasets.
|