Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -68,13 +68,36 @@ To split the dataset (common_voices20.csv), we performed an 80-20 split into tra
|
|
| 68 |
<h2>How to use<h2>
|
| 69 |
|
| 70 |
```python
|
| 71 |
-
from
|
|
|
|
|
|
|
| 72 |
|
| 73 |
-
|
|
|
|
| 74 |
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
-
print(dataset)
|
| 78 |
```
|
| 79 |
|
| 80 |
---
|
|
|
|
| 68 |
<h2>How to use<h2>
|
| 69 |
|
| 70 |
```python
|
| 71 |
+
from huggingface_hub import hf_hub_download
|
| 72 |
+
import zipfile
|
| 73 |
+
import os
|
| 74 |
|
| 75 |
+
# Repo and files
|
| 76 |
+
REPO_ID = "TransferRapid/CommonVoices20_ro"
|
| 77 |
|
| 78 |
+
filenames = [
|
| 79 |
+
"common_voices20.csv",
|
| 80 |
+
"test_common_voices20.csv",
|
| 81 |
+
"train_common_voices20.csv",
|
| 82 |
+
"common_voices20_audio.zip"
|
| 83 |
+
]
|
| 84 |
+
|
| 85 |
+
# Download files
|
| 86 |
+
for filename in filenames:
|
| 87 |
+
print(f"Downloading {filename}...")
|
| 88 |
+
file_path = hf_hub_download(repo_id=REPO_ID, filename=filename, repo_type="dataset", local_dir="./")
|
| 89 |
+
print(f"Downloaded {filename} to: {file_path}")
|
| 90 |
+
|
| 91 |
+
# Extract ZIP files
|
| 92 |
+
if filename.endswith('.zip'):
|
| 93 |
+
extracted_dir = filename.replace('.zip', '')
|
| 94 |
+
with zipfile.ZipFile(file_path, 'r') as zip_ref:
|
| 95 |
+
zip_ref.extractall(extracted_dir)
|
| 96 |
+
print(f"Extracted files to: {extracted_dir}")
|
| 97 |
+
print(os.listdir(extracted_dir))
|
| 98 |
+
else:
|
| 99 |
+
print(f"{filename} is available.")
|
| 100 |
|
|
|
|
| 101 |
```
|
| 102 |
|
| 103 |
---
|